GammaRay API Documentaion
2.5.0
|
Signals | |
void | nonQObjectSelected (void *object, const QString &typeName) |
void | objectCreated (QObject *obj) |
void | objectDestroyed (QObject *obj) |
void | objectReparented (QObject *obj) |
void | objectSelected (QObject *object, const QPoint &pos) |
Public Member Functions | |
void | discoverObject (QObject *object) override |
bool | filterObject (QObject *obj) const override |
void | installGlobalEventFilter (QObject *filter) override |
bool | isValidObject (QObject *obj) const |
QAbstractItemModel * | metaObjectModel () const |
bool | needsObjectDiscovery () const override |
QAbstractItemModel * | objectListModel () const override |
QAbstractItemModel * | objectTreeModel () const override |
QObject * | probe () const override |
void | registerModel (const QString &objectName, QAbstractItemModel *model) override |
void | registerSignalSpyCallbackSet (const SignalSpyCallbackSet &callbacks) override |
void | selectObject (QObject *object, const QPoint &pos=QPoint()) override |
void | selectObject (QObject *object, const QString &toolId, const QPoint &pos=QPoint()) override |
void | selectObject (void *object, const QString &typeName) override |
void | setWindow (QObject *window) |
ToolModel * | toolModel () const |
QObject * | window () const |
Static Public Member Functions | |
template<typename Func > | |
static void | executeSignalCallback (const Func &func) |
static Probe * | instance () |
static bool | isInitialized () |
static void | objectAdded (QObject *obj, bool fromCtor=false) |
static QMutex * | objectLock () |
static void | objectRemoved (QObject *obj) |
static void | startupHookReceived () |
internal | |
Protected Member Functions | |
bool | eventFilter (QObject *receiver, QEvent *event) override |
|
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 |
NOTE: You must hold the object lock when operating on the instance!
|
static |
Returns true if the probe is initialized, false otherwise.
bool GammaRay::Probe::isValidObject | ( | QObject * | obj | ) | const |
check whether obj
is still valid
NOTE: the objectLock must be locked when this is called!
|
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.
|
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.
|
static |
Lock this to check the validity of a QObject and to access it safely afterwards.
|
signal |
Emitted when the user selected object
at position pos
in the probed application.
|
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. |
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.