diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2020-11-25 12:10:00 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-11-25 13:03:05 +0100 |
commit | d989b6096ab7b0713d615dd271ffe9a9191b1160 (patch) | |
tree | 4ce8d82aea2c3863174dc2fcaeda7f34abd66d6d /src/qml/qml/qqmlcontext.h | |
parent | 140a34afdd9ecbb7bc5f9db3f68dcd43a6c534e3 (diff) |
Allow retrieving an imported script from a QML context
This way you can access the properties or call functions provided by the
imported script from C++. Previously there was no way to get to them via
public API from outside of QML/JS.
Change-Id: Ia7813ef6fbec81898c302809118c31f9dcf0f95e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlcontext.h')
-rw-r--r-- | src/qml/qml/qqmlcontext.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlcontext.h b/src/qml/qml/qqmlcontext.h index bb0b85afee..5eda300b36 100644 --- a/src/qml/qml/qqmlcontext.h +++ b/src/qml/qml/qqmlcontext.h @@ -90,6 +90,8 @@ public: void setBaseUrl(const QUrl &); QUrl baseUrl() const; + QJSValue importedScript(const QString &name) const; + private: friend class QQmlEngine; friend class QQmlEnginePrivate; |