GammaRay API Documentation
2.9.0
|
Central entity of GammaRay: The probe is tracking the Qt application under test. More...
#include <probe.h>
Signals | |
void | aboutToDetach () |
void | nonQObjectSelected (void *object, const QString &typeName) |
void | objectCreated (QObject *obj) |
Emitted for newly created QObjects. More... | |
void | objectDestroyed (QObject *obj) |
Emitted for destroyed objects. More... | |
void | objectReparented (QObject *obj) |
void | objectSelected (QObject *object, const QPoint &pos) |
Emitted when the user selected object at position pos in the probed application. | |
Public Member Functions | |
void | discoverObject (QObject *object) override |
Notify the probe about QObjects your plug-in can discover by using information about the types it can handle. More... | |
bool | filterObject (QObject *obj) const override |
Determines if the specified QObject belongs to the GammaRay Probe or Window. More... | |
void | installGlobalEventFilter (QObject *filter) override |
Install a global event filter. More... | |
bool | isValidObject (QObject *obj) const |
Check whether obj is still valid. More... | |
MetaObjectRegistry * | metaObjectRegistry () const |
bool | needsObjectDiscovery () const override |
Returns true if we haven't been able to track all objects from startup, ie. More... | |
SourceLocation | objectCreationSourceLocation (QObject *object) const |
Returns the source code location object was created at. More... | |
Execution::Trace | objectCreationStackTrace (QObject *object) const |
Returns the entire stack trace for the creation of object . More... | |
QAbstractItemModel * | objectListModel () const override |
Returns the object list model. More... | |
QAbstractItemModel * | objectTreeModel () const override |
Returns the object tree model. More... | |
QObject * | probe () const override |
Returns the probe QObject for connecting signals. More... | |
void | registerModel (const QString &objectName, QAbstractItemModel *model) override |
Register a model for remote usage. More... | |
void | registerSignalSpyCallbackSet (const SignalSpyCallbackSet &callbacks) override |
Register a signal spy callback set. More... | |
void | selectObject (QObject *object, const QPoint &pos=QPoint()) override |
Notify the probe about the user selecting one of "your" objects via in-app interaction. More... | |
void | selectObject (QObject *object, const QString &toolId, const QPoint &pos=QPoint()) override |
void | selectObject (void *object, const QString &typeName) override |
Notify the probe about the user selecting one of "your" objects. More... | |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
bool | blockSignals (bool block) |
const QObjectList & | children () const |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const |
bool | disconnect (const QObject *receiver, const char *method) const |
void | dumpObjectInfo () |
void | dumpObjectInfo () const |
void | dumpObjectTree () |
void | dumpObjectTree () const |
QList< QByteArray > | dynamicPropertyNames () const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name, Qt::FindChildOptions options) const |
QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const |
QList< T > | findChildren (const QRegExp ®Exp, Qt::FindChildOptions options) const |
QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const |
bool | inherits (const char *className) const |
void | installEventFilter (QObject *filterObj) |
bool | isWidgetType () const |
bool | isWindowType () const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
QString | objectName () const |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const |
QVariant | property (const char *name) const |
void | removeEventFilter (QObject *obj) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (std::chrono::milliseconds time, Qt::TimerType timerType) |
int | startTimer (int interval, Qt::TimerType timerType) |
QThread * | thread () const |
Static Public Member Functions | |
static Probe * | instance () |
Returns the current instance of the probe. More... | |
static bool | isInitialized () |
Returns true if the probe is initialized, false otherwise. | |
static QMutex * | objectLock () |
Lock this to check the validity of a QObject and to access it safely afterwards. | |
Static Public Member Functions inherited from QObject | |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
bool | disconnect (const QMetaObject::Connection &connection) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
Additional Inherited Members | |
Protected Member Functions inherited from QObject | |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
bool | isSignalConnected (const QMetaMethod &signal) const |
int | receivers (const char *signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
Properties inherited from QObject | |
objectName | |
Central entity of GammaRay: The probe is tracking the Qt application under test.
To get a hold of the probe, call Probe::instance()
|
overridevirtual |
Notify the probe about QObjects your plug-in can discover by using information about the types it can handle.
Only use this if needsObjectDiscovery() returns true
to maximise performance.
Implements GammaRay::ProbeInterface.
|
overridevirtual |
Determines if the specified QObject belongs to the GammaRay Probe or Window.
These objects should not be tracked or shown to the user, hence must be explictly filtered.
object | is a pointer to a QObject instance. |
Implements GammaRay::ProbeInterface.
|
overridevirtual |
Install a global event filter.
Use this rather than installing the filter manually on QCoreApplication, this will filter out GammaRay-internal events and objects already for you.
Implements GammaRay::ProbeInterface.
|
static |
Returns the current instance of the probe.
bool GammaRay::Probe::isValidObject | ( | QObject * | obj | ) | const |
Check whether obj
is still valid.
|
overridevirtual |
Returns true
if we haven't been able to track all objects from startup, ie.
usually when attaching at runtime. If this is the case, we try to discover QObjects by walking the hierarchy, starting from known singletons, and by watching out for unknown receivers of events. This is far from complete obviously, and plug-ins can help finding more objects, using specific knowledge about the types they are responsible for.
Connect to the objectAdded(QObject*) signal on probe(), and call discoverObject(QObject*) for "your" objects.
Implements GammaRay::ProbeInterface.
|
signal |
Emitted for newly created QObjects.
Note:
obj
into a QWeakPointer, even if it's exclusively handled in the same thread as the Probe instance. Qt4 asserts if target code tries to put obj
into a QSharedPointer afterwards.SourceLocation GammaRay::Probe::objectCreationSourceLocation | ( | QObject * | object | ) | const |
Returns the source code location object
was created at.
Execution::Trace GammaRay::Probe::objectCreationStackTrace | ( | QObject * | object | ) | const |
Returns the entire stack trace for the creation of object
.
|
signal |
Emitted for destroyed objects.
Note:
obj
is no longer safe at this point.obj
has been destroyed, see isValidObject() for a way to check if the object is still valid before accessing it.
|
overridevirtual |
Returns the object list model.
Implements GammaRay::ProbeInterface.
|
overridevirtual |
Returns the object tree model.
Implements GammaRay::ProbeInterface.
|
overridevirtual |
Returns the probe QObject for connecting signals.
Implements GammaRay::ProbeInterface.
|
overridevirtual |
Register a model for remote usage.
objectName | Unique identifier for the model, typically in reverse domain notation. |
model | The model to register. |
Implements GammaRay::ProbeInterface.
|
overridevirtual |
Register a signal spy callback set.
Signal indexes provided as arguments are mapped to method indexes, ie. argument semantics are the same with Qt4 and Qt5.
Implements GammaRay::ProbeInterface.
|
overridevirtual |
Notify the probe about the user selecting one of "your" objects via in-app interaction.
If you know the exact position the user interacted with, pass that in as pos
.
Implements GammaRay::ProbeInterface.
|
overridevirtual |
Notify the probe about the user selecting one of "your" objects.
Implements GammaRay::ProbeInterface.