diff options
| author | Soheil Armin <soheil.armin@qt.io> | 2024-02-09 15:42:31 +0200 |
|---|---|---|
| committer | Soheil Armin <soheil.armin@qt.io> | 2024-02-26 20:21:17 +0200 |
| commit | 04b061b8b1a2028d9a2fc8910ba48d84082106af (patch) | |
| tree | 42b94ac8fb295b0160de25713da768e5ad6fc562 /src/quick/platform/android/qandroidquickviewembedding.cpp | |
| parent | 88c644e8ce4682133e6ef680829084f8e392ba26 (diff) | |
Android: Add QQuickView status handling API to QtQuickView
QQuickView has status() and statusChanged() to report its
status. Calling getProperty(), setProperty() and
addSignalHandler() is effective only if the QML object is
loaded and ready. We are adding an API and an interface
that reports this status to the user from the QtQuickView.
Pick-to: 6.7
Task-number: QTBUG-122744
Change-Id: I8e64ba554f2c4f18308ab1411532c75d7b1110b7
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Diffstat (limited to 'src/quick/platform/android/qandroidquickviewembedding.cpp')
| -rw-r--r-- | src/quick/platform/android/qandroidquickviewembedding.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/quick/platform/android/qandroidquickviewembedding.cpp b/src/quick/platform/android/qandroidquickviewembedding.cpp index ed7829f1f3..57cbb45a38 100644 --- a/src/quick/platform/android/qandroidquickviewembedding.cpp +++ b/src/quick/platform/android/qandroidquickviewembedding.cpp @@ -51,17 +51,23 @@ namespace QtAndroidQuickViewEmbedding QQuickView *view = new QQuickView(parentWindow); QQmlEngine *engine = view->engine(); new SignalHelper(view); - view->setSource(qmlUrl); + QObject::connect(view, &QQuickView::statusChanged, + [qtViewObject](QQuickView::Status status) { + qtViewObject.callMethod<void>("handleStatusChange", status); + }); + view->setColor(QColor(Qt::transparent)); view->setWidth(width); view->setHeight(height); for (const QString &path : importPaths) engine->addImportPath(path); + const QtJniTypes::QtWindow window = reinterpret_cast<jobject>(view->winId()); qtViewObject.callMethod<void>("addQtWindow", window, reinterpret_cast<jlong>(view), parentWindowReference); + view->setSource(qmlUrl); }); } |
