Qt 4.8
Public Functions | Static Public Functions | Public Variables | List of all members
QDeclarativeEngineDebugPrivate Class Reference
Inheritance diagram for QDeclarativeEngineDebugPrivate:
QObjectPrivate QObjectData

Public Functions

void decode (QDataStream &, QDeclarativeDebugContextReference &)
 
void decode (QDataStream &, QDeclarativeDebugObjectReference &, bool simple)
 
int getId ()
 
void message (const QByteArray &)
 
 QDeclarativeEngineDebugPrivate (QDeclarativeDebugConnection *)
 
void statusChanged (QDeclarativeEngineDebug::Status status)
 
 ~QDeclarativeEngineDebugPrivate ()
 
- Public Functions inherited from QObjectPrivate
void _q_reregisterTimers (void *pointer)
 
void addConnection (int signal, Connection *c)
 
void cleanConnectionLists ()
 
void connectNotify (const char *signal)
 
void deleteChildren ()
 
void disconnectNotify (const char *signal)
 
bool isSender (const QObject *receiver, const char *signal) const
 
bool isSignalConnected (uint signalIdx) const
 Returns true if the signal with index signal_index from object sender is connected. More...
 
void moveToThread_helper ()
 
 QObjectPrivate (int version=QObjectPrivateVersion)
 
QObjectList receiverList (const char *signal) const
 
QObjectList senderList () const
 
void setParent_helper (QObject *)
 
void setThreadData_helper (QThreadData *currentData, QThreadData *targetData)
 
int signalIndex (const char *signalName) const
 Returns the signal index used in the internal connectionLists vector. More...
 
virtual ~QObjectPrivate ()
 
- Public Functions inherited from QObjectData
virtual ~QObjectData ()=0
 

Static Public Functions

static void remove (QDeclarativeEngineDebug *, QDeclarativeDebugEnginesQuery *)
 
static void remove (QDeclarativeEngineDebug *, QDeclarativeDebugRootContextQuery *)
 
static void remove (QDeclarativeEngineDebug *, QDeclarativeDebugObjectQuery *)
 
static void remove (QDeclarativeEngineDebug *, QDeclarativeDebugExpressionQuery *)
 
static void remove (QDeclarativeEngineDebug *, QDeclarativeDebugWatch *)
 
- Static Public Functions inherited from QObjectPrivate
static void clearGuards (QObject *)
 
static QObjectPrivateget (QObject *o)
 
static void resetCurrentSender (QObject *receiver, Sender *currentSender, Sender *previousSender)
 
static SendersetCurrentSender (QObject *receiver, Sender *sender)
 
static void signalSignature (const QMetaMethod &signal, QVarLengthArray< char > *result)
 

Public Variables

QDeclarativeEngineDebugClientclient
 
QHash< int, QDeclarativeDebugEnginesQuery * > enginesQuery
 
QHash< int, QDeclarativeDebugExpressionQuery * > expressionQuery
 
int nextId
 
QHash< int, QDeclarativeDebugObjectQuery * > objectQuery
 
QHash< int, QDeclarativeDebugRootContextQuery * > rootContextQuery
 
QHash< int, QDeclarativeDebugWatch * > watched
 
- Public Variables inherited from QObjectPrivate
union {
   QObject *   currentChildBeingDeleted
 
   QAbstractDeclarativeData *   declarativeData
 
}; 
 
quint32 connectedSignals [2]
 
QObjectConnectionListVectorconnectionLists
 
SendercurrentSender
 
QList< QPointer< QObject > > eventFilters
 
ExtraDataextraData
 
QString objectName
 
Connectionsenders
 
QAtomicPointer< QtSharedPointer::ExternalRefCountData > sharedRefcount
 
QThreadDatathreadData
 
void * unused
 
- Public Variables inherited from QObjectData
uint blockSig: 1
 
QObjectList children
 
uint hasGuards: 1
 
uint inEventHandler: 1
 
uint inThreadChangeEvent: 1
 
uint isWidget: 1
 
QMetaObjectmetaObject
 
uint ownObjectName: 1
 
QObjectparent
 
uint pendTimer: 1
 
int postedEvents
 
QObjectq_ptr
 
uint receiveChildEvents: 1
 
uint sendChildEvents: 1
 
uint unused: 22
 
uint wasDeleted: 1
 

Additional Inherited Members

- Public Types inherited from QObjectPrivate
typedef void(* StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **)
 

Detailed Description

Definition at line 66 of file qdeclarativeenginedebug.cpp.

Constructors and Destructors

◆ QDeclarativeEngineDebugPrivate()

QDeclarativeEngineDebugPrivate::QDeclarativeEngineDebugPrivate ( QDeclarativeDebugConnection c)

◆ ~QDeclarativeEngineDebugPrivate()

QDeclarativeEngineDebugPrivate::~QDeclarativeEngineDebugPrivate ( )

Definition at line 120 of file qdeclarativeenginedebug.cpp.

121 {
122  if (client)
123  client->priv = 0;
124  delete client;
125 
127  for (; enginesIter != enginesQuery.end(); ++enginesIter) {
128  enginesIter.value()->m_client = 0;
129  if (enginesIter.value()->state() == QDeclarativeDebugQuery::Waiting)
130  enginesIter.value()->setState(QDeclarativeDebugQuery::Error);
131  }
132 
134  for (; rootContextIter != rootContextQuery.end(); ++rootContextIter) {
135  rootContextIter.value()->m_client = 0;
136  if (rootContextIter.value()->state() == QDeclarativeDebugQuery::Waiting)
137  rootContextIter.value()->setState(QDeclarativeDebugQuery::Error);
138  }
139 
141  for (; objectIter != objectQuery.end(); ++objectIter) {
142  objectIter.value()->m_client = 0;
143  if (objectIter.value()->state() == QDeclarativeDebugQuery::Waiting)
144  objectIter.value()->setState(QDeclarativeDebugQuery::Error);
145  }
146 
148  for (; exprIter != expressionQuery.end(); ++exprIter) {
149  exprIter.value()->m_client = 0;
150  if (exprIter.value()->state() == QDeclarativeDebugQuery::Waiting)
151  exprIter.value()->setState(QDeclarativeDebugQuery::Error);
152  }
153 
155  for (; watchIter != watched.end(); ++watchIter) {
156  watchIter.value()->m_client = 0;
157  watchIter.value()->setState(QDeclarativeDebugWatch::Dead);
158  }
159 }
QHash< int, QDeclarativeDebugEnginesQuery * > enginesQuery
QHash< int, QDeclarativeDebugExpressionQuery * > expressionQuery
QHash< int, QDeclarativeDebugRootContextQuery * > rootContextQuery
T & value() const
Returns a modifiable reference to the current item&#39;s value.
Definition: qhash.h:348
QHash< int, QDeclarativeDebugWatch * > watched
QHash< int, QDeclarativeDebugObjectQuery * > objectQuery
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the hash...
Definition: qhash.h:467
The QHash::iterator class provides an STL-style non-const iterator for QHash and QMultiHash.
Definition: qhash.h:330
QDeclarativeEngineDebugClient * client
iterator begin()
Returns an STL-style iterator pointing to the first item in the hash.
Definition: qhash.h:464
QDeclarativeEngineDebugPrivate * priv

Functions

◆ decode() [1/2]

void QDeclarativeEngineDebugPrivate::decode ( QDataStream ds,
QDeclarativeDebugContextReference c 
)

Definition at line 270 of file qdeclarativeenginedebug.cpp.

Referenced by decode(), and message().

271 {
272  ds >> c.m_name >> c.m_debugId;
273 
274  int contextCount;
275  ds >> contextCount;
276 
277  for (int ii = 0; ii < contextCount; ++ii) {
279  decode(ds, c.m_contexts.last());
280  }
281 
282  int objectCount;
283  ds >> objectCount;
284 
285  for (int ii = 0; ii < objectCount; ++ii) {
287  decode(ds, obj, true);
288 
289  obj.m_contextDebugId = c.m_debugId;
290  c.m_objects << obj;
291  }
292 }
static QBasicAtomicInt objectCount
Definition: qobject.cpp:98
void decode(QDataStream &, QDeclarativeDebugContextReference &)
QList< QDeclarativeDebugContextReference > m_contexts
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
QList< QDeclarativeDebugObjectReference > m_objects
T & last()
Returns a reference to the last item in the list.
Definition: qlist.h:284

◆ decode() [2/2]

void QDeclarativeEngineDebugPrivate::decode ( QDataStream ds,
QDeclarativeDebugObjectReference o,
bool  simple 
)

Definition at line 207 of file qdeclarativeenginedebug.cpp.

209 {
211  ds >> data;
212  o.m_debugId = data.objectId;
213  o.m_class = data.objectType;
214  o.m_idString = data.idString;
215  o.m_name = data.objectName;
216  o.m_source.m_url = data.url;
217  o.m_source.m_lineNumber = data.lineNumber;
218  o.m_source.m_columnNumber = data.columnNumber;
219  o.m_contextDebugId = data.contextId;
220  o.m_parentId = data.parentId;
221  o.m_needsMoreData = simple;
222 
223  if (simple)
224  return;
225 
226  int childCount;
227  bool recur;
228  ds >> childCount >> recur;
229 
230  for (int ii = 0; ii < childCount; ++ii) {
232  decode(ds, o.m_children.last(), !recur);
233  }
234 
235  int propCount;
236  ds >> propCount;
237 
238  for (int ii = 0; ii < propCount; ++ii) {
240  ds >> data;
242  prop.m_objectDebugId = o.m_debugId;
243  prop.m_name = data.name;
244  prop.m_binding = data.binding;
245  prop.m_hasNotifySignal = data.hasNotifySignal;
246  prop.m_valueTypeName = data.valueTypeName;
247  switch (data.type) {
252  {
253  prop.m_value = data.value;
254  break;
255  }
257  {
259  obj.m_debugId = prop.m_value.toInt();
260  prop.m_value = QVariant::fromValue(obj);
261  break;
262  }
264  break;
265  }
266  o.m_properties << prop;
267  }
268 }
void decode(QDataStream &, QDeclarativeDebugContextReference &)
int toInt(bool *ok=0) const
Returns the variant as an int if the variant has type() Int , Bool , ByteArray , Char ...
Definition: qvariant.cpp:2625
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
static const char * data(const QByteArray &arr)
static QVariant fromValue(const T &value)
Returns a QVariant containing a copy of value.
Definition: qvariant.h:336
QDeclarativeDebugFileReference m_source
QList< QDeclarativeDebugObjectReference > m_children
T & last()
Returns a reference to the last item in the list.
Definition: qlist.h:284
QList< QDeclarativeDebugPropertyReference > m_properties
T value() const
Returns the stored value converted to the template type T.
Definition: qvariant.h:332

◆ getId()

int QDeclarativeEngineDebugPrivate::getId ( )

Definition at line 161 of file qdeclarativeenginedebug.cpp.

162 {
163  return nextId++;
164 }

◆ message()

void QDeclarativeEngineDebugPrivate::message ( const QByteArray data)

Definition at line 299 of file qdeclarativeenginedebug.cpp.

Referenced by QDeclarativeEngineDebugClient::messageReceived().

300 {
301  QDataStream ds(data);
302 
304  ds >> type;
305 
306  //qDebug() << "QDeclarativeEngineDebugPrivate::message()" << type;
307 
308  if (type == "LIST_ENGINES_R") {
309  int queryId;
310  ds >> queryId;
311 
313  if (!query)
314  return;
315  enginesQuery.remove(queryId);
316 
317  int count;
318  ds >> count;
319 
320  for (int ii = 0; ii < count; ++ii) {
322  ds >> ref.m_name;
323  ds >> ref.m_debugId;
324  query->m_engines << ref;
325  }
326 
327  query->m_client = 0;
328  query->setState(QDeclarativeDebugQuery::Completed);
329  } else if (type == "LIST_OBJECTS_R") {
330  int queryId;
331  ds >> queryId;
332 
334  if (!query)
335  return;
336  rootContextQuery.remove(queryId);
337 
338  if (!ds.atEnd())
339  decode(ds, query->m_context);
340 
341  query->m_client = 0;
342  query->setState(QDeclarativeDebugQuery::Completed);
343  } else if (type == "FETCH_OBJECT_R") {
344  int queryId;
345  ds >> queryId;
346 
348  if (!query)
349  return;
350  objectQuery.remove(queryId);
351 
352  if (!ds.atEnd())
353  decode(ds, query->m_object, false);
354 
355  query->m_client = 0;
356  query->setState(QDeclarativeDebugQuery::Completed);
357  } else if (type == "EVAL_EXPRESSION_R") {
358  int queryId;
359  QVariant result;
360  ds >> queryId >> result;
361 
363  if (!query)
364  return;
365  expressionQuery.remove(queryId);
366 
367  query->m_result = result;
368  query->m_client = 0;
369  query->setState(QDeclarativeDebugQuery::Completed);
370  } else if (type == "WATCH_PROPERTY_R") {
371  int queryId;
372  bool ok;
373  ds >> queryId >> ok;
374 
375  QDeclarativeDebugWatch *watch = watched.value(queryId);
376  if (!watch)
377  return;
378 
380  } else if (type == "WATCH_OBJECT_R") {
381  int queryId;
382  bool ok;
383  ds >> queryId >> ok;
384 
385  QDeclarativeDebugWatch *watch = watched.value(queryId);
386  if (!watch)
387  return;
388 
390  } else if (type == "WATCH_EXPR_OBJECT_R") {
391  int queryId;
392  bool ok;
393  ds >> queryId >> ok;
394 
395  QDeclarativeDebugWatch *watch = watched.value(queryId);
396  if (!watch)
397  return;
398 
400  } else if (type == "UPDATE_WATCH") {
401  int queryId;
402  int debugId;
404  QVariant value;
405  ds >> queryId >> debugId >> name >> value;
406 
407  QDeclarativeDebugWatch *watch = watched.value(queryId, 0);
408  if (!watch)
409  return;
410  emit watch->valueChanged(name, value);
411  } else if (type == "OBJECT_CREATED") {
412  emit q_func()->newObjects();
413  }
414 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
QHash< int, QDeclarativeDebugEnginesQuery * > enginesQuery
int type
Definition: qmetatype.cpp:239
QHash< int, QDeclarativeDebugExpressionQuery * > expressionQuery
QList< QDeclarativeDebugEngineReference > m_engines
int remove(const Key &key)
Removes all the items that have the key from the hash.
Definition: qhash.h:784
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
void decode(QDataStream &, QDeclarativeDebugContextReference &)
QHash< int, QDeclarativeDebugRootContextQuery * > rootContextQuery
QDeclarativeDebugObjectReference m_object
const T value(const Key &key) const
Returns the value associated with the key.
Definition: qhash.h:606
QHash< int, QDeclarativeDebugWatch * > watched
QHash< int, QDeclarativeDebugObjectQuery * > objectQuery
QDeclarativeDebugContextReference m_context
QDeclarativeEngineDebug * m_client
const char * name
#define emit
Definition: qobjectdefs.h:76
void valueChanged(const QByteArray &name, const QVariant &value)
The QDataStream class provides serialization of binary data to a QIODevice.
Definition: qdatastream.h:71

◆ remove() [1/5]

void QDeclarativeEngineDebugPrivate::remove ( QDeclarativeEngineDebug c,
QDeclarativeDebugEnginesQuery q 
)
static

◆ remove() [2/5]

void QDeclarativeEngineDebugPrivate::remove ( QDeclarativeEngineDebug c,
QDeclarativeDebugRootContextQuery q 
)
static

Definition at line 174 of file qdeclarativeenginedebug.cpp.

176 {
177  if (c && q) {
180  }
181 }
int remove(const Key &key)
Removes all the items that have the key from the hash.
Definition: qhash.h:784
QHash< int, QDeclarativeDebugRootContextQuery * > rootContextQuery
static QObjectPrivate * get(QObject *o)
Definition: qobject_p.h:177

◆ remove() [3/5]

void QDeclarativeEngineDebugPrivate::remove ( QDeclarativeEngineDebug c,
QDeclarativeDebugObjectQuery q 
)
static

Definition at line 183 of file qdeclarativeenginedebug.cpp.

184 {
185  if (c && q) {
188  }
189 }
int remove(const Key &key)
Removes all the items that have the key from the hash.
Definition: qhash.h:784
static QObjectPrivate * get(QObject *o)
Definition: qobject_p.h:177
QHash< int, QDeclarativeDebugObjectQuery * > objectQuery

◆ remove() [4/5]

void QDeclarativeEngineDebugPrivate::remove ( QDeclarativeEngineDebug c,
QDeclarativeDebugExpressionQuery q 
)
static

Definition at line 191 of file qdeclarativeenginedebug.cpp.

192 {
193  if (c && q) {
196  }
197 }
QHash< int, QDeclarativeDebugExpressionQuery * > expressionQuery
int remove(const Key &key)
Removes all the items that have the key from the hash.
Definition: qhash.h:784
static QObjectPrivate * get(QObject *o)
Definition: qobject_p.h:177

◆ remove() [5/5]

void QDeclarativeEngineDebugPrivate::remove ( QDeclarativeEngineDebug c,
QDeclarativeDebugWatch w 
)
static

Definition at line 199 of file qdeclarativeenginedebug.cpp.

200 {
201  if (c && w) {
203  p->watched.remove(w->m_queryId);
204  }
205 }
int remove(const Key &key)
Removes all the items that have the key from the hash.
Definition: qhash.h:784
static QObjectPrivate * get(QObject *o)
Definition: qobject_p.h:177
QHash< int, QDeclarativeDebugWatch * > watched

◆ statusChanged()

void QDeclarativeEngineDebugPrivate::statusChanged ( QDeclarativeEngineDebug::Status  status)

Definition at line 294 of file qdeclarativeenginedebug.cpp.

Referenced by QDeclarativeEngineDebugClient::statusChanged().

295 {
296  emit q_func()->statusChanged(status);
297 }
static LibLoadStatus status
Definition: qlocale_icu.cpp:69
#define emit
Definition: qobjectdefs.h:76

Properties

◆ client

QDeclarativeEngineDebugClient* QDeclarativeEngineDebugPrivate::client

Definition at line 76 of file qdeclarativeenginedebug.cpp.

Referenced by ~QDeclarativeEngineDebugPrivate().

◆ enginesQuery

QHash<int, QDeclarativeDebugEnginesQuery *> QDeclarativeEngineDebugPrivate::enginesQuery

Definition at line 89 of file qdeclarativeenginedebug.cpp.

Referenced by message(), remove(), and ~QDeclarativeEngineDebugPrivate().

◆ expressionQuery

QHash<int, QDeclarativeDebugExpressionQuery *> QDeclarativeEngineDebugPrivate::expressionQuery

Definition at line 92 of file qdeclarativeenginedebug.cpp.

Referenced by message(), remove(), and ~QDeclarativeEngineDebugPrivate().

◆ nextId

int QDeclarativeEngineDebugPrivate::nextId

Definition at line 77 of file qdeclarativeenginedebug.cpp.

Referenced by getId().

◆ objectQuery

QHash<int, QDeclarativeDebugObjectQuery *> QDeclarativeEngineDebugPrivate::objectQuery

Definition at line 91 of file qdeclarativeenginedebug.cpp.

Referenced by message(), remove(), and ~QDeclarativeEngineDebugPrivate().

◆ rootContextQuery

QHash<int, QDeclarativeDebugRootContextQuery *> QDeclarativeEngineDebugPrivate::rootContextQuery

Definition at line 90 of file qdeclarativeenginedebug.cpp.

Referenced by message(), remove(), and ~QDeclarativeEngineDebugPrivate().

◆ watched

QHash<int, QDeclarativeDebugWatch *> QDeclarativeEngineDebugPrivate::watched

Definition at line 94 of file qdeclarativeenginedebug.cpp.

Referenced by message(), remove(), and ~QDeclarativeEngineDebugPrivate().


The documentation for this class was generated from the following file: