GammaRay API Documentation
3.2.0
|
Retrieve/expose objects independent of whether using in-process or out-of-process UI. More...
Functions | |
void | clear () |
Clear all registered objects. More... | |
bool | hasObject (const QString &name) |
Checks whether an object with the given name is registered already. | |
bool | hasSelectionModel (QAbstractItemModel *model) |
Checks whether a selection model for the given model is registered already. | |
QAbstractItemModel * | model (const QString &name) |
Retrieve a model by name. | |
template<class T > | |
T | object (const QString &name, T=nullptr) |
Retrieve an object by name implementing interface T . More... | |
template<class T > | |
T | object (T=nullptr) |
Retrieve object implementing interface T . More... | |
QObject * | objectInternal (const QString &name, const QByteArray &type=QByteArray()) |
Retrieve object by name. | |
template<class T > | |
void | registerClientObjectFactoryCallback (ClientObjectFactoryCallback callback, T=nullptr) |
Register a callback for a factory of a given interface to create remote object stubs for the given type. More... | |
void | registerClientObjectFactoryCallbackInternal (const QByteArray &type, ClientObjectFactoryCallback callback) |
Register a callback for a factory to create remote object stubs for the given type. | |
void | registerModelInternal (const QString &name, QAbstractItemModel *model) |
Register a newly created model with the given name. More... | |
void | registerObject (const QString &name, QObject *object) |
Register a newly created QObject under the given name. | |
template<class T > | |
void | registerObject (QObject *object) |
void | registerSelectionModel (QItemSelectionModel *selectionModel) |
Register a newly created selection model. | |
QItemSelectionModel * | selectionModel (QAbstractItemModel *model) |
Retrieve the selection model for model . | |
void | setModelFactoryCallback (ModelFactoryCallback callback) |
Set a callback for the case that a model was requested but had not been registered before. | |
void | setSelectionModelFactoryCallback (selectionModelFactoryCallback callback) |
Set a callback for the case that a selection model was requested but had not been registered before. | |
void | unregisterSelectionModel (QItemSelectionModel *selectionModel) |
Unregisters a selection model. More... | |
Retrieve/expose objects independent of whether using in-process or out-of-process UI.
void GammaRay::ObjectBroker::clear | ( | ) |
Clear all registered objects.
This also destroys all objects created by factory methods registered here, but not externally created objects that have just been registered here. Useful when the probe is deleted, or the client lost the connection.
T GammaRay::ObjectBroker::object | ( | const QString & | name, |
T | = nullptr |
||
) |
Retrieve an object by name implementing interface T
.
Use this if multiple objects of the given type have been registered. Otherwise the function below is simpler and more failsafe.
T GammaRay::ObjectBroker::object | ( | T | = nullptr | ) |
Retrieve object implementing interface T
.
This only works if a single type was registered implementing this interface using qobject_interface_iid as object name.
In most cases this is the simplest way for tools to get an object.
void GammaRay::ObjectBroker::registerClientObjectFactoryCallback | ( | ClientObjectFactoryCallback | callback, |
T | = nullptr |
||
) |
Register a callback for a factory of a given interface to create remote object stubs for the given type.
void GammaRay::ObjectBroker::registerModelInternal | ( | const QString & | name, |
QAbstractItemModel * | model | ||
) |
Register a newly created model with the given name.
void GammaRay::ObjectBroker::unregisterSelectionModel | ( | QItemSelectionModel * | selectionModel | ) |
Unregisters a selection model.
You have to take care of deletion yourself.