Qt 4.8
Public Types | Signals | Public Functions | List of all members
QDeclarativeEngineDebug Class Reference

#include <qdeclarativeenginedebug_p.h>

Inheritance diagram for QDeclarativeEngineDebug:
QObject

Public Types

enum  Status { NotConnected, Unavailable, Enabled }
 

Signals

void newObjects ()
 
void statusChanged (Status status)
 
- Signals inherited from QObject
void destroyed (QObject *=0)
 This signal is emitted immediately before the object obj is destroyed, and can not be blocked. More...
 

Public Functions

QDeclarativeDebugPropertyWatchaddWatch (const QDeclarativeDebugPropertyReference &, QObject *parent=0)
 
QDeclarativeDebugWatchaddWatch (const QDeclarativeDebugContextReference &, const QString &, QObject *parent=0)
 
QDeclarativeDebugObjectExpressionWatchaddWatch (const QDeclarativeDebugObjectReference &, const QString &, QObject *parent=0)
 
QDeclarativeDebugWatchaddWatch (const QDeclarativeDebugObjectReference &, QObject *parent=0)
 
QDeclarativeDebugWatchaddWatch (const QDeclarativeDebugFileReference &, QObject *parent=0)
 
 QDeclarativeEngineDebug (QDeclarativeDebugConnection *, QObject *=0)
 
QDeclarativeDebugEnginesQueryqueryAvailableEngines (QObject *parent=0)
 
QDeclarativeDebugExpressionQueryqueryExpressionResult (int objectDebugId, const QString &expr, QObject *parent=0)
 
QDeclarativeDebugObjectQueryqueryObject (const QDeclarativeDebugObjectReference &, QObject *parent=0)
 
QDeclarativeDebugObjectQueryqueryObjectRecursive (const QDeclarativeDebugObjectReference &, QObject *parent=0)
 
QDeclarativeDebugRootContextQueryqueryRootContexts (const QDeclarativeDebugEngineReference &, QObject *parent=0)
 
void removeWatch (QDeclarativeDebugWatch *watch)
 
bool resetBindingForObject (int objectDebugId, const QString &propertyName)
 
bool setBindingForObject (int objectDebugId, const QString &propertyName, const QVariant &bindingExpression, bool isLiteralValue, QString source=QString(), int line=-1)
 
bool setMethodBody (int objectDebugId, const QString &methodName, const QString &methodBody)
 
Status status () const
 
- Public Functions inherited from QObject
bool blockSignals (bool b)
 If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). More...
 
const QObjectListchildren () const
 Returns a list of child objects. More...
 
bool connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
 
bool disconnect (const QObject *receiver, const char *member=0)
 
void dumpObjectInfo ()
 Dumps information about signal connections, etc. More...
 
void dumpObjectTree ()
 Dumps a tree of children to the debug output. More...
 
QList< QByteArraydynamicPropertyNames () const
 Returns the names of all properties that were dynamically added to the object using setProperty(). More...
 
virtual bool event (QEvent *)
 This virtual function receives events to an object and should return true if the event e was recognized and processed. More...
 
virtual bool eventFilter (QObject *, QEvent *)
 Filters events if this object has been installed as an event filter for the watched object. More...
 
template<typename T >
findChild (const QString &aName=QString()) const
 Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. More...
 
template<typename T >
QList< T > findChildren (const QString &aName=QString()) const
 Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. More...
 
template<typename T >
QList< T > findChildren (const QRegExp &re) const
 
bool inherits (const char *classname) const
 Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false. More...
 
void installEventFilter (QObject *)
 Installs an event filter filterObj on this object. More...
 
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false. More...
 
void killTimer (int id)
 Kills the timer with timer identifier, id. More...
 
virtual const QMetaObjectmetaObject () const
 Returns a pointer to the meta-object of this object. More...
 
void moveToThread (QThread *thread)
 Changes the thread affinity for this object and its children. More...
 
QString objectName () const
 
QObjectparent () const
 Returns a pointer to the parent object. More...
 
QVariant property (const char *name) const
 Returns the value of the object's name property. More...
 
Q_INVOKABLE QObject (QObject *parent=0)
 Constructs an object with parent object parent. More...
 
void removeEventFilter (QObject *)
 Removes an event filter object obj from this object. More...
 
void setObjectName (const QString &name)
 
void setParent (QObject *)
 Makes the object a child of parent. More...
 
bool setProperty (const char *name, const QVariant &value)
 Sets the value of the object's name property to value. More...
 
void setUserData (uint id, QObjectUserData *data)
 
bool signalsBlocked () const
 Returns true if signals are blocked; otherwise returns false. More...
 
int startTimer (int interval)
 Starts a timer and returns a timer identifier, or returns zero if it could not start a timer. More...
 
QThreadthread () const
 Returns the thread in which the object lives. More...
 
QObjectUserDatauserData (uint id) const
 
virtual ~QObject ()
 Destroys the object, deleting all its child objects. More...
 

Additional Inherited Members

- Public Slots inherited from QObject
void deleteLater ()
 Schedules this object for deletion. More...
 
- Static Public Functions inherited from QObject
static bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 Creates a connection of the given type from the signal in the sender object to the method in the receiver object. More...
 
static bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 Disconnects signal in object sender from method in object receiver. More...
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static uint registerUserData ()
 
static QString tr (const char *sourceText, const char *comment=0, int n=-1)
 
static QString trUtf8 (const char *sourceText, const char *comment=0, int n=-1)
 
- Static Public Variables inherited from QObject
static const QMetaObject staticMetaObject
 This variable stores the meta-object for the class. More...
 
- Protected Functions inherited from QObject
virtual void childEvent (QChildEvent *)
 This event handler can be reimplemented in a subclass to receive child events. More...
 
virtual void connectNotify (const char *signal)
 This virtual function is called when something has been connected to signal in this object. More...
 
virtual void customEvent (QEvent *)
 This event handler can be reimplemented in a subclass to receive custom events. More...
 
virtual void disconnectNotify (const char *signal)
 This virtual function is called when something has been disconnected from signal in this object. More...
 
 QObject (QObjectPrivate &dd, QObject *parent=0)
 
int receivers (const char *signal) const
 Returns the number of receivers connected to the signal. More...
 
QObjectsender () const
 Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns 0. More...
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *)
 This event handler can be reimplemented in a subclass to receive timer events for the object. More...
 
- Protected Variables inherited from QObject
QScopedPointer< QObjectDatad_ptr
 
- Static Protected Variables inherited from QObject
static const QMetaObject staticQtMetaObject
 

Detailed Description

Definition at line 70 of file qdeclarativeenginedebug_p.h.

Enumerations

◆ Status

Constructors and Destructors

◆ QDeclarativeEngineDebug()

QDeclarativeEngineDebug::QDeclarativeEngineDebug ( QDeclarativeDebugConnection client,
QObject parent = 0 
)
explicit

Definition at line 416 of file qdeclarativeenginedebug.cpp.

417 : QObject(*(new QDeclarativeEngineDebugPrivate(client)), parent)
418 {
419 }
Q_INVOKABLE QObject(QObject *parent=0)
Constructs an object with parent object parent.
Definition: qobject.cpp:753

Functions

◆ addWatch() [1/5]

QDeclarativeDebugPropertyWatch * QDeclarativeEngineDebug::addWatch ( const QDeclarativeDebugPropertyReference property,
QObject parent = 0 
)

Definition at line 428 of file qdeclarativeenginedebug.cpp.

429 {
431 
433  if (d->client->status() == QDeclarativeDebugClient::Enabled) {
434  int queryId = d->getId();
435  watch->m_queryId = queryId;
436  watch->m_client = this;
437  watch->m_objectDebugId = property.objectDebugId();
438  watch->m_name = property.name();
439  d->watched.insert(queryId, watch);
440 
441  QByteArray message;
442  QDataStream ds(&message, QIODevice::WriteOnly);
443  ds << QByteArray("WATCH_PROPERTY") << queryId << property.objectDebugId() << property.name().toUtf8();
444  d->client->sendMessage(message);
445  } else {
446  watch->m_state = QDeclarativeDebugWatch::Dead;
447  }
448 
449  return watch;
450 }
double d
Definition: qnumeric_p.h:62
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
#define Q_D(Class)
Definition: qglobal.h:2482
The QDataStream class provides serialization of binary data to a QIODevice.
Definition: qdatastream.h:71

◆ addWatch() [2/5]

QDeclarativeDebugWatch * QDeclarativeEngineDebug::addWatch ( const QDeclarativeDebugContextReference ,
const QString ,
QObject parent = 0 
)

Definition at line 452 of file qdeclarativeenginedebug.cpp.

453 {
454  qWarning("QDeclarativeEngineDebug::addWatch(): Not implemented");
455  return 0;
456 }
Q_CORE_EXPORT void qWarning(const char *,...)

◆ addWatch() [3/5]

QDeclarativeDebugObjectExpressionWatch * QDeclarativeEngineDebug::addWatch ( const QDeclarativeDebugObjectReference object,
const QString expr,
QObject parent = 0 
)

Definition at line 458 of file qdeclarativeenginedebug.cpp.

459 {
462  if (d->client->status() == QDeclarativeDebugClient::Enabled) {
463  int queryId = d->getId();
464  watch->m_queryId = queryId;
465  watch->m_client = this;
466  watch->m_objectDebugId = object.debugId();
467  watch->m_expr = expr;
468  d->watched.insert(queryId, watch);
469 
470  QByteArray message;
471  QDataStream ds(&message, QIODevice::WriteOnly);
472  ds << QByteArray("WATCH_EXPR_OBJECT") << queryId << object.debugId() << expr;
473  d->client->sendMessage(message);
474  } else {
475  watch->m_state = QDeclarativeDebugWatch::Dead;
476  }
477  return watch;
478 }
double d
Definition: qnumeric_p.h:62
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
#define Q_D(Class)
Definition: qglobal.h:2482
The QDataStream class provides serialization of binary data to a QIODevice.
Definition: qdatastream.h:71

◆ addWatch() [4/5]

QDeclarativeDebugWatch * QDeclarativeEngineDebug::addWatch ( const QDeclarativeDebugObjectReference object,
QObject parent = 0 
)

Definition at line 480 of file qdeclarativeenginedebug.cpp.

481 {
483 
484  QDeclarativeDebugWatch *watch = new QDeclarativeDebugWatch(parent);
485  if (d->client->status() == QDeclarativeDebugClient::Enabled) {
486  int queryId = d->getId();
487  watch->m_queryId = queryId;
488  watch->m_client = this;
489  watch->m_objectDebugId = object.debugId();
490  d->watched.insert(queryId, watch);
491 
492  QByteArray message;
493  QDataStream ds(&message, QIODevice::WriteOnly);
494  ds << QByteArray("WATCH_OBJECT") << queryId << object.debugId();
495  d->client->sendMessage(message);
496  } else {
498  }
499 
500  return watch;
501 }
double d
Definition: qnumeric_p.h:62
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
#define Q_D(Class)
Definition: qglobal.h:2482
QDeclarativeEngineDebug * m_client
The QDataStream class provides serialization of binary data to a QIODevice.
Definition: qdatastream.h:71

◆ addWatch() [5/5]

QDeclarativeDebugWatch * QDeclarativeEngineDebug::addWatch ( const QDeclarativeDebugFileReference ,
QObject parent = 0 
)

Definition at line 503 of file qdeclarativeenginedebug.cpp.

504 {
505  qWarning("QDeclarativeEngineDebug::addWatch(): Not implemented");
506  return 0;
507 }
Q_CORE_EXPORT void qWarning(const char *,...)

◆ newObjects

void QDeclarativeEngineDebug::newObjects ( )
signal

◆ queryAvailableEngines()

QDeclarativeDebugEnginesQuery * QDeclarativeEngineDebug::queryAvailableEngines ( QObject parent = 0)

Definition at line 529 of file qdeclarativeenginedebug.cpp.

530 {
532 
534  if (d->client->status() == QDeclarativeDebugClient::Enabled) {
535  query->m_client = this;
536  int queryId = d->getId();
537  query->m_queryId = queryId;
538  d->enginesQuery.insert(queryId, query);
539 
540  QByteArray message;
541  QDataStream ds(&message, QIODevice::WriteOnly);
542  ds << QByteArray("LIST_ENGINES") << queryId;
543  d->client->sendMessage(message);
544  } else {
545  query->m_state = QDeclarativeDebugQuery::Error;
546  }
547 
548  return query;
549 }
double d
Definition: qnumeric_p.h:62
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
#define Q_D(Class)
Definition: qglobal.h:2482
The QDataStream class provides serialization of binary data to a QIODevice.
Definition: qdatastream.h:71

◆ queryExpressionResult()

QDeclarativeDebugExpressionQuery * QDeclarativeEngineDebug::queryExpressionResult ( int  objectDebugId,
const QString expr,
QObject parent = 0 
)

Definition at line 619 of file qdeclarativeenginedebug.cpp.

620 {
622 
624  if (d->client->status() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) {
625  query->m_client = this;
626  query->m_expr = expr;
627  int queryId = d->getId();
628  query->m_queryId = queryId;
629  d->expressionQuery.insert(queryId, query);
630 
631  QByteArray message;
632  QDataStream ds(&message, QIODevice::WriteOnly);
633  ds << QByteArray("EVAL_EXPRESSION") << queryId << objectDebugId << expr;
634  d->client->sendMessage(message);
635  } else {
636  query->m_state = QDeclarativeDebugQuery::Error;
637  }
638 
639  return query;
640 }
double d
Definition: qnumeric_p.h:62
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
#define Q_D(Class)
Definition: qglobal.h:2482
The QDataStream class provides serialization of binary data to a QIODevice.
Definition: qdatastream.h:71

◆ queryObject()

QDeclarativeDebugObjectQuery * QDeclarativeEngineDebug::queryObject ( const QDeclarativeDebugObjectReference object,
QObject parent = 0 
)

Definition at line 573 of file qdeclarativeenginedebug.cpp.

574 {
576 
578  if (d->client->status() == QDeclarativeDebugClient::Enabled && object.debugId() != -1) {
579  query->m_client = this;
580  int queryId = d->getId();
581  query->m_queryId = queryId;
582  d->objectQuery.insert(queryId, query);
583 
584  QByteArray message;
585  QDataStream ds(&message, QIODevice::WriteOnly);
586  ds << QByteArray("FETCH_OBJECT") << queryId << object.debugId()
587  << false << true;
588  d->client->sendMessage(message);
589  } else {
590  query->m_state = QDeclarativeDebugQuery::Error;
591  }
592 
593  return query;
594 }
double d
Definition: qnumeric_p.h:62
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
#define Q_D(Class)
Definition: qglobal.h:2482
QDeclarativeEngineDebug * m_client
The QDataStream class provides serialization of binary data to a QIODevice.
Definition: qdatastream.h:71

◆ queryObjectRecursive()

QDeclarativeDebugObjectQuery * QDeclarativeEngineDebug::queryObjectRecursive ( const QDeclarativeDebugObjectReference object,
QObject parent = 0 
)

Definition at line 596 of file qdeclarativeenginedebug.cpp.

597 {
599 
601  if (d->client->status() == QDeclarativeDebugClient::Enabled && object.debugId() != -1) {
602  query->m_client = this;
603  int queryId = d->getId();
604  query->m_queryId = queryId;
605  d->objectQuery.insert(queryId, query);
606 
607  QByteArray message;
608  QDataStream ds(&message, QIODevice::WriteOnly);
609  ds << QByteArray("FETCH_OBJECT") << queryId << object.debugId()
610  << true << true;
611  d->client->sendMessage(message);
612  } else {
613  query->m_state = QDeclarativeDebugQuery::Error;
614  }
615 
616  return query;
617 }
double d
Definition: qnumeric_p.h:62
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
#define Q_D(Class)
Definition: qglobal.h:2482
QDeclarativeEngineDebug * m_client
The QDataStream class provides serialization of binary data to a QIODevice.
Definition: qdatastream.h:71

◆ queryRootContexts()

QDeclarativeDebugRootContextQuery * QDeclarativeEngineDebug::queryRootContexts ( const QDeclarativeDebugEngineReference engine,
QObject parent = 0 
)

Definition at line 551 of file qdeclarativeenginedebug.cpp.

552 {
554 
556  if (d->client->status() == QDeclarativeDebugClient::Enabled && engine.debugId() != -1) {
557  query->m_client = this;
558  int queryId = d->getId();
559  query->m_queryId = queryId;
560  d->rootContextQuery.insert(queryId, query);
561 
562  QByteArray message;
563  QDataStream ds(&message, QIODevice::WriteOnly);
564  ds << QByteArray("LIST_OBJECTS") << queryId << engine.debugId();
565  d->client->sendMessage(message);
566  } else {
567  query->m_state = QDeclarativeDebugQuery::Error;
568  }
569 
570  return query;
571 }
double d
Definition: qnumeric_p.h:62
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
#define Q_D(Class)
Definition: qglobal.h:2482
The QDataStream class provides serialization of binary data to a QIODevice.
Definition: qdatastream.h:71

◆ removeWatch()

void QDeclarativeEngineDebug::removeWatch ( QDeclarativeDebugWatch watch)

Definition at line 509 of file qdeclarativeenginedebug.cpp.

510 {
512 
513  if (!watch || !watch->m_client)
514  return;
515 
516  watch->m_client = 0;
518 
519  d->watched.remove(watch->queryId());
520 
521  if (d->client && d->client->status() == QDeclarativeDebugClient::Enabled) {
522  QByteArray message;
523  QDataStream ds(&message, QIODevice::WriteOnly);
524  ds << QByteArray("NO_WATCH") << watch->queryId();
525  d->client->sendMessage(message);
526  }
527 }
double d
Definition: qnumeric_p.h:62
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
#define Q_D(Class)
Definition: qglobal.h:2482
QDeclarativeEngineDebug * m_client
The QDataStream class provides serialization of binary data to a QIODevice.
Definition: qdatastream.h:71

◆ resetBindingForObject()

bool QDeclarativeEngineDebug::resetBindingForObject ( int  objectDebugId,
const QString propertyName 
)

Definition at line 661 of file qdeclarativeenginedebug.cpp.

662 {
664 
665  if (d->client->status() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) {
666  QByteArray message;
667  QDataStream ds(&message, QIODevice::WriteOnly);
668  ds << QByteArray("RESET_BINDING") << d->getId() << objectDebugId << propertyName;
669  d->client->sendMessage(message);
670  return true;
671  } else {
672  return false;
673  }
674 }
double d
Definition: qnumeric_p.h:62
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
#define Q_D(Class)
Definition: qglobal.h:2482
The QDataStream class provides serialization of binary data to a QIODevice.
Definition: qdatastream.h:71

◆ setBindingForObject()

bool QDeclarativeEngineDebug::setBindingForObject ( int  objectDebugId,
const QString propertyName,
const QVariant bindingExpression,
bool  isLiteralValue,
QString  source = QString(),
int  line = -1 
)

Definition at line 642 of file qdeclarativeenginedebug.cpp.

646 {
648 
649  if (d->client->status() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) {
650  QByteArray message;
651  QDataStream ds(&message, QIODevice::WriteOnly);
652  ds << QByteArray("SET_BINDING") << d->getId() << objectDebugId << propertyName <<
653  bindingExpression << isLiteralValue << source << line;
654  d->client->sendMessage(message);
655  return true;
656  } else {
657  return false;
658  }
659 }
double d
Definition: qnumeric_p.h:62
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
#define Q_D(Class)
Definition: qglobal.h:2482
The QDataStream class provides serialization of binary data to a QIODevice.
Definition: qdatastream.h:71

◆ setMethodBody()

bool QDeclarativeEngineDebug::setMethodBody ( int  objectDebugId,
const QString methodName,
const QString methodBody 
)

Definition at line 676 of file qdeclarativeenginedebug.cpp.

678 {
680 
681  if (d->client->status() == QDeclarativeDebugClient::Enabled && objectDebugId != -1) {
682  QByteArray message;
683  QDataStream ds(&message, QIODevice::WriteOnly);
684  ds << QByteArray("SET_METHOD_BODY") << d->getId() << objectDebugId << methodName
685  << methodBody;
686  d->client->sendMessage(message);
687  return true;
688  } else {
689  return false;
690  }
691 }
double d
Definition: qnumeric_p.h:62
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
#define Q_D(Class)
Definition: qglobal.h:2482
The QDataStream class provides serialization of binary data to a QIODevice.
Definition: qdatastream.h:71

◆ status()

QDeclarativeEngineDebug::Status QDeclarativeEngineDebug::status ( ) const

Definition at line 421 of file qdeclarativeenginedebug.cpp.

422 {
424 
425  return static_cast<QDeclarativeEngineDebug::Status>(d->client->status());
426 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482

◆ statusChanged

void QDeclarativeEngineDebug::statusChanged ( Status  status)
signal

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