1 #ifndef QTMVVM_QQMLSERVICEREGISTRY_H 2 #define QTMVVM_QQMLSERVICEREGISTRY_H 4 #include <QtCore/QObject> 6 #include <QtMvvmCore/ServiceRegistry> 8 #include <QtQml/QQmlEngine> 9 #include <QtQml/QQmlComponent> 25 class QQmlServiceRegistry :
public QObject 41 explicit QQmlServiceRegistry(
QQmlEngine *parent =
nullptr);
97 #endif // QTMVVM_QQMLSERVICEREGISTRY_H Destroy as soon as the QCoreApplication gets destroyed (typically end of main)
Q_INVOKABLE QObject * service(const QString &iid)
Returns the service for the given iid.
The QML import for the QtMvvmCore QML module.
Destroy when the QCoreApplication::aboutToQuit signal is emitted.
A QML singleton to access some QtMvvm::ServiceRegistry functionality.
DestructionScope
A singleton to prepare services for dependency injection and to access them.
Q_INVOKABLE void registerObject(QObject *service, QtMvvm::QQmlServiceRegistry::DestructionScope scope=DestroyOnAppQuit, bool weak=false)
Register a service via an already existing instance.
Destroy together with the service registry instance (static memory, unspecified order!) ...
Never destroy the instance.
Q_INVOKABLE bool isRegistered(const QString &iid) const
Checks if a given interface or service is already registered.
The primary namespace of the QtMvvm library.
Q_INVOKABLE void registerPlugin(const QString &iid, QString pluginType={}, QString pluginKey={}, DestructionScope scope=DestroyOnAppDestroy, bool weak=false)
Register a service by an iid via specifing a plugin to be loaded.