aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickwidgets/qquickwidget_p.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-06-27 11:55:33 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2016-06-27 15:40:17 +0000
commit97212616d5a7fc68d9ee97015751326ec2908287 (patch)
treeada8f172265b097406489672cd29cda1029f4642 /src/quickwidgets/qquickwidget_p.h
parentc9d4c8ed97694defea78184a80874764ebedfda1 (diff)
Lazy create QmlEngine on accessing rootContext
A common usecase appears to be to set variables in the rootContext before loading a url in a QQuickWidget. We there need to ensure there is a QmlEngine to set variables on when this is attempted. Change-Id: I07aff2104313eeb3fab902ea3c6043c3c82c50f7 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/quickwidgets/qquickwidget_p.h')
-rw-r--r--src/quickwidgets/qquickwidget_p.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/quickwidgets/qquickwidget_p.h b/src/quickwidgets/qquickwidget_p.h
index f0e1f848e3..b01d634fcd 100644
--- a/src/quickwidgets/qquickwidget_p.h
+++ b/src/quickwidgets/qquickwidget_p.h
@@ -105,7 +105,7 @@ public:
QImage grabFramebuffer() Q_DECL_OVERRIDE;
void init(QQmlEngine* e = 0);
- void ensureEngine();
+ void ensureEngine() const;
void handleWindowChange();
void invalidateRenderControl();
@@ -115,7 +115,7 @@ public:
QUrl source;
- QPointer<QQmlEngine> engine;
+ mutable QPointer<QQmlEngine> engine;
QQmlComponent *component;
QBasicTimer resizetimer;
QQuickWindow *offscreenWindow;