summaryrefslogtreecommitdiffstats
path: root/examples/qt3d/examples-common/qt3dquickwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/qt3d/examples-common/qt3dquickwindow.cpp')
-rw-r--r--examples/qt3d/examples-common/qt3dquickwindow.cpp6
1 files changed, 6 insertions, 0 deletions
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 <Qt3DRender/qrenderaspect.h>
#include <Qt3DInput/qinputaspect.h>
#include <Qt3DLogic/qlogicaspect.h>
+
+#include <QQmlContext>
+
#include <QtGui/qopenglcontext.h>
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