};
QDeclarativeDebugConnectionPrivate::QDeclarativeDebugConnectionPrivate(QDeclarativeDebugConnection *c)
-: QObject(c), q(c), protocol(0), gotHello(false)
+ : QObject(c), q(c), protocol(0), gotHello(false)
{
protocol = new QPacketProtocol(q, this);
QObject::connect(c, SIGNAL(connected()), this, SLOT(connected()));
pack >> message;
QHash<QString, QDeclarativeDebugClient *>::Iterator iter =
- plugins.find(name);
+ plugins.find(name);
if (iter == plugins.end()) {
qWarning() << "QDeclarativeDebugConnection: Message received for missing plugin" << name;
} else {
}
QDeclarativeDebugConnection::QDeclarativeDebugConnection(QObject *parent)
-: QTcpSocket(parent), d(new QDeclarativeDebugConnectionPrivate(this))
+ : QTcpSocket(parent), d(new QDeclarativeDebugConnectionPrivate(this))
{
}
{
QHash<QString, QDeclarativeDebugClient*>::iterator iter = d->plugins.begin();
for (; iter != d->plugins.end(); ++iter) {
- iter.value()->d_func()->connection = 0;
- iter.value()->statusChanged(QDeclarativeDebugClient::NotConnected);
+ iter.value()->d_func()->connection = 0;
+ iter.value()->statusChanged(QDeclarativeDebugClient::NotConnected);
}
}
}
QDeclarativeDebugClientPrivate::QDeclarativeDebugClientPrivate()
-: connection(0)
+ : connection(0)
{
}
QDeclarativeDebugClient::QDeclarativeDebugClient(const QString &name,
- QDeclarativeDebugConnection *parent)
-: QObject(*(new QDeclarativeDebugClientPrivate), parent)
+ QDeclarativeDebugConnection *parent)
+ : QObject(*(new QDeclarativeDebugClientPrivate), parent)
{
Q_D(QDeclarativeDebugClient);
d->name = name;
}
QDeclarativeDebugServerConnection *QDeclarativeDebugServerPrivate::loadConnectionPlugin(
- const QString &pluginName)
+ const QString &pluginName)
{
QStringList pluginCandidates;
const QStringList paths = QCoreApplication::libraryPaths();
if (!appD->qmljsDebugArgumentsString().isEmpty()) {
if (!QDeclarativeEnginePrivate::qml_debugging_enabled) {
const QString message =
- QString::fromAscii("QDeclarativeDebugServer: Ignoring \"-qmljsdebugger=%1\". "
- "Debugging has not been enabled.").arg(
- appD->qmljsDebugArgumentsString());
+ QString::fromAscii("QDeclarativeDebugServer: Ignoring \"-qmljsdebugger=%1\". "
+ "Debugging has not been enabled.").arg(
+ appD->qmljsDebugArgumentsString());
qWarning("%s", qPrintable(message));
return 0;
}
}
QDeclarativeDebugServer::QDeclarativeDebugServer()
-: QObject(*(new QDeclarativeDebugServerPrivate))
+ : QObject(*(new QDeclarativeDebugServerPrivate))
{
}
QT_BEGIN_NAMESPACE
QDeclarativeDebugServicePrivate::QDeclarativeDebugServicePrivate()
-: server(0)
+ : server(0)
{
}
QDeclarativeDebugService::QDeclarativeDebugService(const QString &name, QObject *parent)
-: QObject(*(new QDeclarativeDebugServicePrivate), parent)
+ : QObject(*(new QDeclarativeDebugServicePrivate), parent)
{
Q_D(QDeclarativeDebugService);
d->name = name;
namespace {
- struct ObjectReference
- {
- QPointer<QObject> object;
- int id;
- };
+struct ObjectReference
+{
+ QPointer<QObject> object;
+ int id;
+};
- struct ObjectReferenceHash
- {
- ObjectReferenceHash() : nextId(0) {}
+struct ObjectReferenceHash
+{
+ ObjectReferenceHash() : nextId(0) {}
- QHash<QObject *, ObjectReference> objects;
- QHash<int, QObject *> ids;
+ QHash<QObject *, ObjectReference> objects;
+ QHash<int, QObject *> ids;
- int nextId;
- };
+ int nextId;
+};
}
Q_GLOBAL_STATIC(ObjectReferenceHash, objectReferenceHash);
return -1;
ObjectReferenceHash *hash = objectReferenceHash();
- QHash<QObject *, ObjectReference>::Iterator iter =
- hash->objects.find(object);
+ QHash<QObject *, ObjectReference>::Iterator iter =
+ hash->objects.find(object);
if (iter == hash->objects.end()) {
int id = hash->nextId++;
hash->ids.insert(id, object);
iter->object = object;
iter->id = id;
- }
+ }
return iter->id;
}
return 0;
- QHash<QObject *, ObjectReference>::Iterator objIter =
- hash->objects.find(*iter);
+ QHash<QObject *, ObjectReference>::Iterator objIter =
+ hash->objects.find(*iter);
Q_ASSERT(objIter != hash->objects.end());
if (objIter->object == 0) {
if(objectName.isEmpty())
objectName = QLatin1String("<unnamed>");
- QString rv = QString::fromUtf8(obj->metaObject()->className()) +
- QLatin1String(": ") + objectName;
+ QString rv = QString::fromUtf8(obj->metaObject()->className()) +
+ QLatin1String(": ") + objectName;
return rv;
}
}
QDeclarativeDebugTrace::QDeclarativeDebugTrace()
-: QDeclarativeDebugService(QLatin1String("CanvasFrameRate")),
- m_enabled(false), m_deferredSend(true), m_messageReceived(false)
+ : QDeclarativeDebugService(QLatin1String("CanvasFrameRate")),
+ m_enabled(false), m_deferredSend(true), m_messageReceived(false)
{
m_timer.start();
if (status() == Enabled) {
void QDeclarativeDebugTrace::addEvent(EventType t)
{
- if (QDeclarativeDebugService::isDebuggingEnabled())
+ if (QDeclarativeDebugService::isDebuggingEnabled())
traceInstance()->addEventImpl(t);
}
void QDeclarativeDebugTrace::startRange(RangeType t)
{
- if (QDeclarativeDebugService::isDebuggingEnabled())
+ if (QDeclarativeDebugService::isDebuggingEnabled())
traceInstance()->startRangeImpl(t);
}
void QDeclarativeDebugTrace::rangeData(RangeType t, const QString &data)
{
- if (QDeclarativeDebugService::isDebuggingEnabled())
+ if (QDeclarativeDebugService::isDebuggingEnabled())
traceInstance()->rangeDataImpl(t, data);
}
void QDeclarativeDebugTrace::endRange(RangeType t)
{
- if (QDeclarativeDebugService::isDebuggingEnabled())
+ if (QDeclarativeDebugService::isDebuggingEnabled())
traceInstance()->endRangeImpl(t);
}
};
QDeclarativeEngineDebugClient::QDeclarativeEngineDebugClient(QDeclarativeDebugConnection *client,
- QDeclarativeEngineDebugPrivate *p)
-: QDeclarativeDebugClient(QLatin1String("QDeclarativeEngine"), client), priv(p)
+ QDeclarativeEngineDebugPrivate *p)
+ : QDeclarativeDebugClient(QLatin1String("QDeclarativeEngine"), client), priv(p)
{
}
}
QDeclarativeEngineDebugPrivate::QDeclarativeEngineDebugPrivate(QDeclarativeDebugConnection *c)
-: client(new QDeclarativeEngineDebugClient(c, this)), nextId(0)
+ : client(new QDeclarativeEngineDebugClient(c, this)), nextId(0)
{
}
}
void QDeclarativeEngineDebugPrivate::remove(QDeclarativeEngineDebug *c,
- QDeclarativeDebugRootContextQuery *q)
+ QDeclarativeDebugRootContextQuery *q)
{
if (c && q) {
QDeclarativeEngineDebugPrivate *p = (QDeclarativeEngineDebugPrivate *)QObjectPrivate::get(c);
}
void QDeclarativeEngineDebugPrivate::decode(QDataStream &ds, QDeclarativeDebugObjectReference &o,
- bool simple)
+ bool simple)
{
QDeclarativeEngineDebugService::QDeclarativeObjectData data;
ds >> data;
prop.m_hasNotifySignal = data.hasNotifySignal;
prop.m_valueTypeName = data.valueTypeName;
switch (data.type) {
- case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::Basic:
- case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::List:
- case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::SignalProperty:
- {
- prop.m_value = data.value;
- break;
- }
- case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::Object:
- {
- QDeclarativeDebugObjectReference obj;
- obj.m_debugId = prop.m_value.toInt();
- prop.m_value = QVariant::fromValue(obj);
- break;
- }
- case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::Unknown:
- break;
+ case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::Basic:
+ case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::List:
+ case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::SignalProperty:
+ {
+ prop.m_value = data.value;
+ break;
+ }
+ case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::Object:
+ {
+ QDeclarativeDebugObjectReference obj;
+ obj.m_debugId = prop.m_value.toInt();
+ prop.m_value = QVariant::fromValue(obj);
+ break;
+ }
+ case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::Unknown:
+ break;
}
o.m_properties << prop;
}
return;
rootContextQuery.remove(queryId);
- if (!ds.atEnd())
+ if (!ds.atEnd())
decode(ds, query->m_context);
query->m_client = 0;
}
QDeclarativeEngineDebug::QDeclarativeEngineDebug(QDeclarativeDebugConnection *client, QObject *parent)
-: QObject(*(new QDeclarativeEngineDebugPrivate(client)), parent)
+ : QObject(*(new QDeclarativeEngineDebugPrivate(client)), parent)
{
}
QByteArray message;
QDataStream ds(&message, QIODevice::WriteOnly);
- ds << QByteArray("FETCH_OBJECT") << queryId << object.debugId()
+ ds << QByteArray("FETCH_OBJECT") << queryId << object.debugId()
<< false << true;
d->client->sendMessage(message);
} else {
QByteArray message;
QDataStream ds(&message, QIODevice::WriteOnly);
- ds << QByteArray("FETCH_OBJECT") << queryId << object.debugId()
+ ds << QByteArray("FETCH_OBJECT") << queryId << object.debugId()
<< true << true;
d->client->sendMessage(message);
} else {
}
QDeclarativeDebugWatch::QDeclarativeDebugWatch(QObject *parent)
-: QObject(parent), m_state(Waiting), m_queryId(-1), m_client(0), m_objectDebugId(-1)
+ : QObject(parent), m_state(Waiting), m_queryId(-1), m_client(0), m_objectDebugId(-1)
{
}
QDeclarativeDebugQuery::QDeclarativeDebugQuery(QObject *parent)
-: QObject(parent), m_state(Waiting)
+ : QObject(parent), m_state(Waiting)
{
}
}
QDeclarativeDebugEnginesQuery::QDeclarativeDebugEnginesQuery(QObject *parent)
-: QDeclarativeDebugQuery(parent), m_client(0), m_queryId(-1)
+ : QDeclarativeDebugQuery(parent), m_client(0), m_queryId(-1)
{
}
QDeclarativeDebugEnginesQuery::~QDeclarativeDebugEnginesQuery()
{
- if (m_client && m_queryId != -1)
+ if (m_client && m_queryId != -1)
QDeclarativeEngineDebugPrivate::remove(m_client, this);
}
}
QDeclarativeDebugRootContextQuery::QDeclarativeDebugRootContextQuery(QObject *parent)
-: QDeclarativeDebugQuery(parent), m_client(0), m_queryId(-1)
+ : QDeclarativeDebugQuery(parent), m_client(0), m_queryId(-1)
{
}
QDeclarativeDebugRootContextQuery::~QDeclarativeDebugRootContextQuery()
{
- if (m_client && m_queryId != -1)
+ if (m_client && m_queryId != -1)
QDeclarativeEngineDebugPrivate::remove(m_client, this);
}
}
QDeclarativeDebugObjectQuery::QDeclarativeDebugObjectQuery(QObject *parent)
-: QDeclarativeDebugQuery(parent), m_client(0), m_queryId(-1)
+ : QDeclarativeDebugQuery(parent), m_client(0), m_queryId(-1)
{
}
QDeclarativeDebugObjectQuery::~QDeclarativeDebugObjectQuery()
{
- if (m_client && m_queryId != -1)
+ if (m_client && m_queryId != -1)
QDeclarativeEngineDebugPrivate::remove(m_client, this);
}
}
QDeclarativeDebugExpressionQuery::QDeclarativeDebugExpressionQuery(QObject *parent)
-: QDeclarativeDebugQuery(parent), m_client(0), m_queryId(-1)
+ : QDeclarativeDebugQuery(parent), m_client(0), m_queryId(-1)
{
}
QDeclarativeDebugExpressionQuery::~QDeclarativeDebugExpressionQuery()
{
- if (m_client && m_queryId != -1)
+ if (m_client && m_queryId != -1)
QDeclarativeEngineDebugPrivate::remove(m_client, this);
}
}
QDeclarativeDebugEngineReference::QDeclarativeDebugEngineReference()
-: m_debugId(-1)
+ : m_debugId(-1)
{
}
QDeclarativeDebugEngineReference::QDeclarativeDebugEngineReference(int debugId)
-: m_debugId(debugId)
+ : m_debugId(debugId)
{
}
QDeclarativeDebugEngineReference::QDeclarativeDebugEngineReference(const QDeclarativeDebugEngineReference &o)
-: m_debugId(o.m_debugId), m_name(o.m_name)
+ : m_debugId(o.m_debugId), m_name(o.m_name)
{
}
}
QDeclarativeDebugObjectReference::QDeclarativeDebugObjectReference()
-: m_debugId(-1), m_contextDebugId(-1)
+ : m_debugId(-1), m_contextDebugId(-1)
{
}
QDeclarativeDebugObjectReference::QDeclarativeDebugObjectReference(int debugId)
-: m_debugId(debugId), m_contextDebugId(-1)
+ : m_debugId(debugId), m_contextDebugId(-1)
{
}
QDeclarativeDebugObjectReference::QDeclarativeDebugObjectReference(const QDeclarativeDebugObjectReference &o)
-: m_debugId(o.m_debugId), m_class(o.m_class), m_idString(o.m_idString),
- m_name(o.m_name), m_source(o.m_source), m_contextDebugId(o.m_contextDebugId),
- m_properties(o.m_properties), m_children(o.m_children)
+ : m_debugId(o.m_debugId), m_class(o.m_class), m_idString(o.m_idString),
+ m_name(o.m_name), m_source(o.m_source), m_contextDebugId(o.m_contextDebugId),
+ m_properties(o.m_properties), m_children(o.m_children)
{
}
}
QDeclarativeDebugContextReference::QDeclarativeDebugContextReference()
-: m_debugId(-1)
+ : m_debugId(-1)
{
}
QDeclarativeDebugContextReference::QDeclarativeDebugContextReference(const QDeclarativeDebugContextReference &o)
-: m_debugId(o.m_debugId), m_name(o.m_name), m_objects(o.m_objects), m_contexts(o.m_contexts)
+ : m_debugId(o.m_debugId), m_name(o.m_name), m_objects(o.m_objects), m_contexts(o.m_contexts)
{
}
QDeclarativeDebugContextReference &QDeclarativeDebugContextReference::operator=(const QDeclarativeDebugContextReference &o)
{
- m_debugId = o.m_debugId; m_name = o.m_name; m_objects = o.m_objects;
+ m_debugId = o.m_debugId; m_name = o.m_name; m_objects = o.m_objects;
m_contexts = o.m_contexts;
return *this;
}
}
QDeclarativeDebugFileReference::QDeclarativeDebugFileReference()
-: m_lineNumber(-1), m_columnNumber(-1)
+ : m_lineNumber(-1), m_columnNumber(-1)
{
}
QDeclarativeDebugFileReference::QDeclarativeDebugFileReference(const QDeclarativeDebugFileReference &o)
-: m_url(o.m_url), m_lineNumber(o.m_lineNumber), m_columnNumber(o.m_columnNumber)
+ : m_url(o.m_url), m_lineNumber(o.m_lineNumber), m_columnNumber(o.m_columnNumber)
{
}
}
QDeclarativeDebugPropertyReference::QDeclarativeDebugPropertyReference()
-: m_objectDebugId(-1), m_hasNotifySignal(false)
+ : m_objectDebugId(-1), m_hasNotifySignal(false)
{
}
QDeclarativeDebugPropertyReference::QDeclarativeDebugPropertyReference(const QDeclarativeDebugPropertyReference &o)
-: m_objectDebugId(o.m_objectDebugId), m_name(o.m_name), m_value(o.m_value),
- m_valueTypeName(o.m_valueTypeName), m_binding(o.m_binding),
- m_hasNotifySignal(o.m_hasNotifySignal)
+ : m_objectDebugId(o.m_objectDebugId), m_name(o.m_name), m_value(o.m_value),
+ m_valueTypeName(o.m_valueTypeName), m_binding(o.m_binding),
+ m_hasNotifySignal(o.m_hasNotifySignal)
{
}
** $QT_END_LICENSE$
**
****************************************************************************/
+
#ifndef QDECLARATIVEENGINEDEBUG_H
#define QDECLARATIVEENGINEDEBUG_H
class QDeclarativeEngineDebugPrivate;
class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeEngineDebug : public QObject
{
-Q_OBJECT
+ Q_OBJECT
public:
enum Status { NotConnected, Unavailable, Enabled };
Status status() const;
QDeclarativeDebugPropertyWatch *addWatch(const QDeclarativeDebugPropertyReference &,
- QObject *parent = 0);
+ QObject *parent = 0);
QDeclarativeDebugWatch *addWatch(const QDeclarativeDebugContextReference &, const QString &,
- QObject *parent = 0);
+ QObject *parent = 0);
QDeclarativeDebugObjectExpressionWatch *addWatch(const QDeclarativeDebugObjectReference &, const QString &,
- QObject *parent = 0);
+ QObject *parent = 0);
QDeclarativeDebugWatch *addWatch(const QDeclarativeDebugObjectReference &,
- QObject *parent = 0);
+ QObject *parent = 0);
QDeclarativeDebugWatch *addWatch(const QDeclarativeDebugFileReference &,
- QObject *parent = 0);
+ QObject *parent = 0);
void removeWatch(QDeclarativeDebugWatch *watch);
QDeclarativeDebugEnginesQuery *queryAvailableEngines(QObject *parent = 0);
QDeclarativeDebugRootContextQuery *queryRootContexts(const QDeclarativeDebugEngineReference &,
- QObject *parent = 0);
- QDeclarativeDebugObjectQuery *queryObject(const QDeclarativeDebugObjectReference &,
- QObject *parent = 0);
- QDeclarativeDebugObjectQuery *queryObjectRecursive(const QDeclarativeDebugObjectReference &,
+ QObject *parent = 0);
+ QDeclarativeDebugObjectQuery *queryObject(const QDeclarativeDebugObjectReference &,
QObject *parent = 0);
- QDeclarativeDebugExpressionQuery *queryExpressionResult(int objectDebugId,
- const QString &expr,
- QObject *parent = 0);
+ QDeclarativeDebugObjectQuery *queryObjectRecursive(const QDeclarativeDebugObjectReference &,
+ QObject *parent = 0);
+ QDeclarativeDebugExpressionQuery *queryExpressionResult(int objectDebugId,
+ const QString &expr,
+ QObject *parent = 0);
bool setBindingForObject(int objectDebugId, const QString &propertyName,
const QVariant &bindingExpression, bool isLiteralValue,
QString source = QString(), int line = -1);
class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugWatch : public QObject
{
-Q_OBJECT
+ Q_OBJECT
public:
enum State { Waiting, Active, Inactive, Dead };
class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugQuery : public QObject
{
-Q_OBJECT
+ Q_OBJECT
public:
enum State { Waiting, Error, Completed };
State state() const;
bool isWaiting() const;
-// bool waitUntilCompleted();
+ // bool waitUntilCompleted();
Q_SIGNALS:
void stateChanged(QDeclarativeDebugQuery::State);
class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugEnginesQuery : public QDeclarativeDebugQuery
{
-Q_OBJECT
+ Q_OBJECT
public:
virtual ~QDeclarativeDebugEnginesQuery();
QList<QDeclarativeDebugEngineReference> engines() const;
class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugRootContextQuery : public QDeclarativeDebugQuery
{
-Q_OBJECT
+ Q_OBJECT
public:
virtual ~QDeclarativeDebugRootContextQuery();
QDeclarativeDebugContextReference rootContext() const;
class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugObjectQuery : public QDeclarativeDebugQuery
{
-Q_OBJECT
+ Q_OBJECT
public:
virtual ~QDeclarativeDebugObjectQuery();
QDeclarativeDebugObjectReference object() const;
class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDebugExpressionQuery : public QDeclarativeDebugQuery
{
-Q_OBJECT
+ Q_OBJECT
public:
virtual ~QDeclarativeDebugExpressionQuery();
QVariant expression() const;
}
QDeclarativeEngineDebugService::QDeclarativeEngineDebugService(QObject *parent)
-: QDeclarativeDebugService(QLatin1String("QDeclarativeEngine"), parent),
- m_watch(new QDeclarativeWatcher(this))
+ : QDeclarativeDebugService(QLatin1String("QDeclarativeEngine"), parent),
+ m_watch(new QDeclarativeWatcher(this))
{
QObject::connect(m_watch, SIGNAL(propertyChanged(int,int,QMetaProperty,QVariant)),
this, SLOT(propertyChanged(int,int,QMetaProperty,QVariant)));
{
// see QmlCompiler::isSignalPropertyName
return signalName.length() >= 3 && signalName.startsWith(QLatin1String("on")) &&
- signalName.at(2).isLetter() && signalName.at(2).isUpper();
+ signalName.at(2).isLetter() && signalName.at(2).isUpper();
}
static bool hasValidSignal(QObject *object, const QString &propertyName)
rv.valueTypeName = QString::fromUtf8(prop.typeName());
rv.name = QString::fromUtf8(prop.name());
rv.hasNotifySignal = prop.hasNotifySignal();
- QDeclarativeAbstractBinding *binding =
- QDeclarativePropertyPrivate::binding(QDeclarativeProperty(obj, rv.name));
+ QDeclarativeAbstractBinding *binding =
+ QDeclarativePropertyPrivate::binding(QDeclarativeProperty(obj, rv.name));
if (binding)
rv.binding = binding->expression();
return QLatin1String("<unknown value>");
}
-void QDeclarativeEngineDebugService::buildObjectDump(QDataStream &message,
- QObject *object, bool recur, bool dumpProperties)
+void QDeclarativeEngineDebugService::buildObjectDump(QDataStream &message,
+ QObject *object, bool recur, bool dumpProperties)
{
message << objectData(object);
QString ctxtName = ctxt->objectName();
int ctxtId = QDeclarativeDebugService::idForObject(ctxt);
- message << ctxtName << ctxtId;
+ message << ctxtName << ctxtId;
int count = 0;
void QDeclarativeEngineDebugService::buildStatesList(QObject *obj)
{
if (QDeclarativeState *state = qobject_cast<QDeclarativeState *>(obj)) {
- m_allStates.append(state);
+ m_allStates.append(state);
}
QObjectList children = obj->children();
int engineId = -1;
ds >> queryId >> engineId;
- QDeclarativeEngine *engine =
- qobject_cast<QDeclarativeEngine *>(QDeclarativeDebugService::objectForId(engineId));
+ QDeclarativeEngine *engine =
+ qobject_cast<QDeclarativeEngine *>(QDeclarativeDebugService::objectForId(engineId));
QByteArray reply;
QDataStream rs(&reply, QIODevice::WriteOnly);
}
void QDeclarativeEngineDebugService::setBinding(int objectId,
- const QString &propertyName,
- const QVariant &expression,
- bool isLiteralValue,
- QString filename,
- int line)
+ const QString &propertyName,
+ const QVariant &expression,
+ bool isLiteralValue,
+ QString filename,
+ int line)
{
QObject *object = objectForId(objectId);
QDeclarativeContext *context = qmlContext(object);
} else if (hasValidSignal(object, propertyName)) {
QDeclarativeProperty property(object, propertyName, context);
QDeclarativePropertyPrivate::setSignalExpression(property, 0);
- } else {
+ } else {
if (QDeclarativePropertyChanges *propertyChanges = qobject_cast<QDeclarativePropertyChanges *>(object)) {
propertyChanges->removeProperty(propertyName);
}
return;
QDeclarativePropertyCache::Data dummy;
- QDeclarativePropertyCache::Data *prop =
- QDeclarativePropertyCache::property(context->engine(), object, method, dummy);
+ QDeclarativePropertyCache::Data *prop =
+ QDeclarativePropertyCache::property(context->engine(), object, method, dummy);
if (!prop || !prop->isVMEFunction())
return;
paramStr.append(QString::fromUtf8(paramNames.at(ii)));
}
- QString jsfunction = QLatin1String("(function ") + method + QLatin1String("(") + paramStr +
- QLatin1String(") {");
+ QString jsfunction = QLatin1String("(function ") + method + QLatin1String("(") + paramStr +
+ QLatin1String(") {");
jsfunction += body;
jsfunction += QLatin1String("\n})");
- QDeclarativeVMEMetaObject *vmeMetaObject =
- static_cast<QDeclarativeVMEMetaObject*>(QObjectPrivate::get(object)->metaObject);
+ QDeclarativeVMEMetaObject *vmeMetaObject =
+ static_cast<QDeclarativeVMEMetaObject*>(QObjectPrivate::get(object)->metaObject);
Q_ASSERT(vmeMetaObject); // the fact we found the property above should guarentee this
int lineNumber = vmeMetaObject->vmeMethodLineNumber(prop->coreIndex);
\brief The QPacketProtocol class encapsulates communicating discrete packets
across fragmented IO channels, such as TCP sockets.
- QPacketProtocol makes it simple to send arbitrary sized data "packets" across
+ QPacketProtocol makes it simple to send arbitrary sized data "packets" across
fragmented transports such as TCP and UDP.
As transmission boundaries are not respected, sending packets over protocols
class QPacketProtocolPrivate : public QObject
{
-Q_OBJECT
+ Q_OBJECT
public:
QPacketProtocolPrivate(QPacketProtocol * parent, QIODevice * _dev)
- : QObject(parent), inProgressSize(-1), maxPacketSize(MAX_PACKET_SIZE),
- waitingForPacket(false), dev(_dev)
+ : QObject(parent), inProgressSize(-1), maxPacketSize(MAX_PACKET_SIZE),
+ waitingForPacket(false), dev(_dev)
{
Q_ASSERT(4 == sizeof(qint32));
specified \a parent.
*/
QPacketProtocol::QPacketProtocol(QIODevice * dev, QObject * parent)
-: QObject(parent), d(new QPacketProtocolPrivate(this, dev))
+ : QObject(parent), d(new QPacketProtocolPrivate(this, dev))
{
Q_ASSERT(dev);
}
/*!
Returns the maximum packet size allowed. By default this is
- 2,147,483,647 bytes.
+ 2,147,483,647 bytes.
If a packet claiming to be larger than the maximum packet size is received,
the QPacketProtocol::invalidPacket() signal is emitted.
protocol.send() << "Hello world" << 123;
\endcode
- will send a packet containing "Hello world" and 123. To construct more
+ will send a packet containing "Hello world" and 123. To construct more
complex packets, explicitly construct a QPacket instance.
*/
QPacketAutoSend QPacketProtocol::send()
\endcode
Only packets returned from QPacketProtocol::read() may be read from. QPacket
- instances constructed by directly by applications are for transmission only
- and are considered "write only". Attempting to read data from them will
+ instances constructed by directly by applications are for transmission only
+ and are considered "write only". Attempting to read data from them will
result in undefined behavior.
\ingroup io
Constructs an empty write-only packet.
*/
QPacket::QPacket()
-: QDataStream(), buf(0)
+ : QDataStream(), buf(0)
{
buf = new QBuffer(&b);
buf->open(QIODevice::WriteOnly);
two packets are otherwise independent.
*/
QPacket::QPacket(const QPacket & other)
-: QDataStream(), b(other.b), buf(0)
+ : QDataStream(), b(other.b), buf(0)
{
buf = new QBuffer(&b);
buf->open(other.buf->openMode());
\internal
*/
QPacket::QPacket(const QByteArray & ba)
-: QDataStream(), b(ba), buf(0)
+ : QDataStream(), b(ba), buf(0)
{
buf = new QBuffer(&b);
buf->open(QIODevice::ReadOnly);
\internal
*/
QPacketAutoSend::QPacketAutoSend(QPacketProtocol * _p)
-: QPacket(), p(_p)
+ : QPacket(), p(_p)
{
}
class Q_DECLARATIVE_PRIVATE_EXPORT QPacketProtocol : public QObject
{
-Q_OBJECT
+ Q_OBJECT
public:
explicit QPacketProtocol(QIODevice * dev, QObject * parent = 0);
virtual ~QPacketProtocol();