diff options
author | Paul Olav Tvete <paul.tvete@digia.com> | 2014-06-03 14:19:14 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-06-03 14:46:59 +0200 |
commit | cca61d66e71c3d6948db1a881267385ff294eb4e (patch) | |
tree | e4ac8f3aa118c3ab382c6ea0004a018c5c251a5d /src/quick/items/qquickrendercontrol.cpp | |
parent | 6e9b406fefe7fe3147587d573f1763c906682f5e (diff) |
Make QQuickRenderControl usable (still private)
QQuickRenderControl needs a QQuickWindow in order to function. This
required the use of a private QQuickWindow constructor, meaning that
only friend classes of QQuickWindow could use QQuickRenderControl.
This change adds a factory function, QQuickRenderControl::createOffscreenWindow().
Task-number: QTBUG-38996
Change-Id: I92f6f1f60045934f3dd33c300352247852463c73
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Diffstat (limited to 'src/quick/items/qquickrendercontrol.cpp')
-rw-r--r-- | src/quick/items/qquickrendercontrol.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/quick/items/qquickrendercontrol.cpp b/src/quick/items/qquickrendercontrol.cpp index 87a60b5cce..2842d7e933 100644 --- a/src/quick/items/qquickrendercontrol.cpp +++ b/src/quick/items/qquickrendercontrol.cpp @@ -239,6 +239,10 @@ void QQuickRenderControl::setWindow(QQuickWindow *window) d->window = window; } +/*! + Returns the offscreen window. + */ + QQuickWindow *QQuickRenderControl::window() const { Q_D(const QQuickRenderControl); @@ -246,6 +250,21 @@ QQuickWindow *QQuickRenderControl::window() const } /*! + Create an offscreen QQuickWindow for this render control, + unless the render control already has a window(). + + Returns the offscreen window if one is created, otherwise returns null. + The caller takes ownership of the window, and is responsible for deleting it. + */ +QQuickWindow *QQuickRenderControl::createOffscreenWindow() +{ + Q_D(QQuickRenderControl); + if (!d->window) + return new QQuickWindow(this); + return 0; +} + +/*! \fn QWindow *QQuickRenderControl::renderWindow(QPoint *offset) Reimplemented in subclasses to return the real window this render control |