diff options
author | Shawn Rutledge <shawn.rutledge@digia.com> | 2013-05-31 15:33:45 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-06-04 10:52:15 +0200 |
commit | cf737d265f0d507ae8e5a909a7b7d43a4aae7de3 (patch) | |
tree | 0943bcf9e34ac068cb4bb3f81d00c38f9a2bd1e6 /tools/qmlscene | |
parent | 7020cba94a3a8c280681ad0053a514b30c806925 (diff) |
qmlscene: if top-level is a QQuickWindow, set incubation controller
The necessity for this is documented in the
QQuickWindow::incubationController() accessor. Bug 31203 is about
writing a custom main() with a QQmlApplicationEngine, not about
qmlscene, but the same workaround is necessary for both. Hopefully
soon we find a way to make it unnecessary, but for now it is.
This fix also doesn't take care of the QtObject { Window { } }
use case.
Task-number: QTBUG-31203
Change-Id: Ic9a5e4a23ac918593138dc9cab3de6cd36453eaf
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Diffstat (limited to 'tools/qmlscene')
-rw-r--r-- | tools/qmlscene/main.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/qmlscene/main.cpp b/tools/qmlscene/main.cpp index d572487218..8a48445d63 100644 --- a/tools/qmlscene/main.cpp +++ b/tools/qmlscene/main.cpp @@ -483,7 +483,9 @@ int main(int argc, char ** argv) QObject *topLevel = component->create(); QQuickWindow *window = qobject_cast<QQuickWindow *>(topLevel); QQuickView* qxView = 0; - if (!window) { + if (window) { + engine.setIncubationController(window->incubationController()); + } else { QQuickItem *contentItem = qobject_cast<QQuickItem *>(topLevel); if (contentItem) { qxView = new QQuickView(&engine, NULL); |