From 4b4a407512fdd4cc0a2f7caa463b7b03520b3f62 Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Mon, 18 Jan 2016 10:08:41 +0000 Subject: Temporarily expose window to QML context Allows to restore most of the QML examples using this approach until a more permanent solution can be developed (I have an idea on how to do this and will try it today). Change-Id: I9b9bb86a5323140be3ed2456cdfa91b1f93187b1 Reviewed-by: Paul Lemire --- examples/qt3d/examples-common/qt3dquickwindow.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'examples/qt3d/examples-common/qt3dquickwindow.cpp') diff --git a/examples/qt3d/examples-common/qt3dquickwindow.cpp b/examples/qt3d/examples-common/qt3dquickwindow.cpp index 27f2ee5ef..5aa5a6e85 100644 --- a/examples/qt3d/examples-common/qt3dquickwindow.cpp +++ b/examples/qt3d/examples-common/qt3dquickwindow.cpp @@ -39,6 +39,9 @@ #include #include #include + +#include + #include QT_BEGIN_NAMESPACE @@ -107,6 +110,9 @@ void Qt3DQuickWindow::showEvent(QShowEvent *e) data.insert(QStringLiteral("eventSource"), QVariant::fromValue(this)); m_engine->aspectEngine()->setData(data); + // TODO: Remove this hack once we can automagically set the window on the framegraph + m_engine->qmlEngine()->rootContext()->setContextProperty("_q_window", this); + m_engine->setSource(m_source); // Set the QQmlIncubationController on the window -- cgit v1.2.3