GammaRay API Documentation 3.0.1
|
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. | |
void | objectDestroyed (QObject *obj) |
Emitted for destroyed objects. | |
void | objectFavorited (QObject *obj) |
void | objectReparented (QObject *obj) |
void | objectSelected (QObject *object, const QPoint &pos) |
Emitted when the user selected object at position pos in the probed application. | |
void | objectUnfavorited (QObject *obj) |
Public Member Functions | |
const QVector< QObject * > & | allQObjects () const |
Returns a list of all QObjects we know about. | |
void | discoverObject (QObject *object) |
Notify the probe about QObjects your plug-in can discover by using information about the types it can handle. | |
bool | filterObject (QObject *obj) const |
Determines if the specified QObject belongs to the GammaRay Probe or Window. | |
void | installGlobalEventFilter (QObject *filter) |
Install a global event filter. | |
bool | isValidObject (const QObject *obj) const |
Check whether obj is still valid. | |
void | markObjectAsFavorite (QObject *object) |
Mark an object as favorite. | |
MetaObjectRegistry * | metaObjectRegistry () const |
QAbstractItemModel * | objectListModel () const |
Returns the object list model. | |
QAbstractItemModel * | objectTreeModel () const |
Returns the object tree model. | |
ProblemCollector * | problemCollector () const |
void | registerSignalSpyCallbackSet (const SignalSpyCallbackSet &callbacks) |
Register a signal spy callback set. | |
void | removeObjectAsFavorite (QObject *object) |
Unmark an object as favorite. | |
void | selectObject (QObject *object, const QPoint &pos=QPoint()) |
Notify the probe about the user selecting one of "your" objects via in-app interaction. | |
void | selectObject (QObject *object, const QString &toolId, const QPoint &pos=QPoint()) |
void | selectObject (void *object, const QString &typeName) |
Notify the probe about the user selecting one of "your" objects. | |
![]() | |
QObject (QObject *parent) | |
bool | blockSignals (bool block) |
const QObjectList & | children () const const |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const const |
bool | disconnect (const QObject *receiver, const char *method) const const |
void | dumpObjectInfo () |
void | dumpObjectInfo () const const |
void | dumpObjectTree () |
void | dumpObjectTree () const const |
QList< QByteArray > | dynamicPropertyNames () const const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegExp ®Exp, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const const |
bool | inherits (const char *className) const const |
void | installEventFilter (QObject *filterObj) |
bool | isWidgetType () const const |
bool | isWindowType () const const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const const |
void | moveToThread (QThread *targetThread) |
QString | objectName () const const |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const const |
QVariant | property (const char *name) const const |
Q_CLASSINFO (Name, Value) | |
Q_DISABLE_COPY (Class) | |
Q_DISABLE_COPY_MOVE (Class) | |
Q_DISABLE_MOVE (Class) | |
Q_EMIT Q_EMIT | |
Q_ENUM (...) | |
Q_ENUM_NS (...) | |
Q_ENUMS (...) | |
Q_FLAG (...) | |
Q_FLAG_NS (...) | |
Q_FLAGS (...) | |
Q_GADGET Q_GADGET | |
Q_INTERFACES (...) | |
Q_INVOKABLE Q_INVOKABLE | |
Q_NAMESPACE Q_NAMESPACE | |
Q_NAMESPACE_EXPORT (EXPORT_MACRO) | |
Q_OBJECT Q_OBJECT | |
Q_PROPERTY (...) | |
Q_REVISION Q_REVISION | |
Q_SET_OBJECT_NAME (Object) | |
Q_SIGNAL Q_SIGNAL | |
Q_SIGNALS Q_SIGNALS | |
Q_SLOT Q_SLOT | |
Q_SLOTS Q_SLOTS | |
T | qFindChild (const QObject *obj, const QString &name) |
QList< T > | qFindChildren (const QObject *obj, const QRegExp ®Exp) |
QList< T > | qFindChildren (const QObject *obj, const QString &name) |
T | qobject_cast (const QObject *object) |
T | qobject_cast (QObject *object) |
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
void | removeEventFilter (QObject *obj) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const const |
int | startTimer (int interval, Qt::TimerType timerType) |
int | startTimer (std::chrono::milliseconds time, Qt::TimerType timerType) |
QThread * | thread () const const |
Static Public Member Functions | |
static Probe * | instance () |
Returns the current instance of the probe. | |
static bool | isInitialized () |
Returns true if the probe is initialized, false otherwise. | |
static bool | needsObjectDiscovery () |
Returns true if we haven't been able to track all objects from startup, ie. | |
static SourceLocation | objectCreationSourceLocation (QObject *object) |
Returns the source code location object was created at. | |
static Execution::Trace | objectCreationStackTrace (QObject *object) |
Returns the entire stack trace for the creation of object . | |
static QRecursiveMutex * | objectLock () |
Lock this to check the validity of a QObject and to access it safely afterwards. | |
static void | registerModel (const QString &objectName, QAbstractItemModel *model) |
Register a model for remote usage. | |
![]() | |
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 *context, Functor functor, 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) |
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, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
Additional Inherited Members | |
![]() | |
typedef | QObjectList |
![]() | |
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 const |
int | receivers (const char *signal) const const |
QObject * | sender () const const |
int | senderSignalIndex () const const |
virtual void | timerEvent (QTimerEvent *event) |
![]() | |
objectName | |
Central entity of GammaRay: The probe is tracking the Qt application under test.
To get a hold of the probe, call Probe::instance()
Returns a list of all QObjects we know about.
void GammaRay::Probe::discoverObject | ( | QObject * | object | ) |
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.
bool GammaRay::Probe::filterObject | ( | QObject * | obj | ) | const |
void GammaRay::Probe::installGlobalEventFilter | ( | QObject * | filter | ) |
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.
|
static |
Returns the current instance of the probe.
|
inline |
Check whether obj
is still valid.
void GammaRay::Probe::markObjectAsFavorite | ( | QObject * | object | ) |
Mark an object as favorite.
Favorite objects might be shown in a separate view Connect to the objectFavorited(QObject*) signal on probe() to know when an object gets marked as favorited
|
static |
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.
|
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.
|
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.QAbstractItemModel * GammaRay::Probe::objectListModel | ( | ) | const |
Returns the object list model.
QAbstractItemModel * GammaRay::Probe::objectTreeModel | ( | ) | const |
Returns the object tree model.
|
static |
Register a model for remote usage.
objectName | Unique identifier for the model, typically in reverse domain notation. |
model | The model to register. |
void GammaRay::Probe::registerSignalSpyCallbackSet | ( | const SignalSpyCallbackSet & | callbacks | ) |
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.
void GammaRay::Probe::removeObjectAsFavorite | ( | QObject * | object | ) |
Unmark an object as favorite.
Connect to the objectUnfavorited(QObject*) signal on probe() to know when an object gets removed as favorited
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
.
void GammaRay::Probe::selectObject | ( | void * | object, |
const QString & | typeName | ||
) |
Notify the probe about the user selecting one of "your" objects.