diff options
author | Frederik Gladhorn <frederik.gladhorn@qt.io> | 2018-07-31 18:21:00 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@qt.io> | 2018-07-31 19:16:00 +0000 |
commit | f294fda40c19c0ecc3c99efb3aabe1b14933cc84 (patch) | |
tree | 1d79ca471d9a0cadd475df370759b8489b25b26c /src/qml/qml/qqmlcomponent.cpp | |
parent | 4caedd14c7926e65378836262808bda6e928936c (diff) |
Add QQmlEngine getter to QQmlComponent
Change-Id: I1c9979fbd5ca81700ec7ad60e6d991e70c6d5fb5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlcomponent.cpp')
-rw-r--r-- | src/qml/qml/qqmlcomponent.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp index 9b43ea0531..6a6e5e8d68 100644 --- a/src/qml/qml/qqmlcomponent.cpp +++ b/src/qml/qml/qqmlcomponent.cpp @@ -592,8 +592,8 @@ void QQmlComponent::setData(const QByteArray &data, const QUrl &url) } /*! -Returns the QQmlContext the component was created in. This is only -valid for components created directly from QML. + Returns the QQmlContext the component was created in. This is only + valid for components created directly from QML. */ QQmlContext *QQmlComponent::creationContext() const { @@ -605,6 +605,17 @@ QQmlContext *QQmlComponent::creationContext() const } /*! + Returns the QQmlEngine of this component. + + \since 5.12 +*/ +QQmlEngine *QQmlComponent::engine() const +{ + Q_D(const QQmlComponent); + return d->engine; +} + +/*! Load the QQmlComponent from the provided \a url. \include qqmlcomponent.qdoc url-note |