qtquick: Inject the dock registry into the context
Useful to call from QML if needed
This commit is contained in:
@@ -227,7 +227,8 @@ void Config::setQmlEngine(QQmlEngine *qmlEngine)
|
||||
return;
|
||||
}
|
||||
|
||||
DockRegistry::self(); // make sure our QML types are registered
|
||||
auto dr = DockRegistry::self(); // make sure our QML types are registered
|
||||
qmlEngine->rootContext()->setContextProperty(QStringLiteral("_kddwDockRegistry"), dr);
|
||||
d->m_qmlEngine = qmlEngine;
|
||||
|
||||
QQmlContext *context = qmlEngine->rootContext();
|
||||
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
DockWidgetBase *focusedDockWidget() const;
|
||||
|
||||
bool containsDockWidget(const QString &uniqueName) const;
|
||||
DockWidgetBase *dockByName(const QString &) const;
|
||||
Q_INVOKABLE DockWidgetBase *dockByName(const QString &) const;
|
||||
MainWindowBase *mainWindowByName(const QString &) const;
|
||||
MainWindowMDI *mdiMainWindowByName(const QString &) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user