diff options
author | Paul Olav Tvete <paul.tvete@digia.com> | 2014-04-23 09:58:32 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-24 15:36:51 +0200 |
commit | a1eb1348ff8026a6c623981d06142769dc18ec78 (patch) | |
tree | 52f2c1924600a65c5fb828b00d7a3e2641ba0102 /src/quick/items/qquickrendercontrol.cpp | |
parent | 4f3a02c7cde6589ecbdbc4f0dcf20793d2d604db (diff) |
Getting the render window of an offscreen window
When using a QQuickWidget, the QQuickWindow is hidden and the contents
are displayed in another window. Some components need to query the actual
window, e.g. when positioning a popup.
Task-number: QTBUG-38116
Change-Id: I34452be2179ccc9e216e4d89264dc700e0cf42a0
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Diffstat (limited to 'src/quick/items/qquickrendercontrol.cpp')
-rw-r--r-- | src/quick/items/qquickrendercontrol.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/quick/items/qquickrendercontrol.cpp b/src/quick/items/qquickrendercontrol.cpp index d919ae9a0f..e2a26836cf 100644 --- a/src/quick/items/qquickrendercontrol.cpp +++ b/src/quick/items/qquickrendercontrol.cpp @@ -245,4 +245,34 @@ QQuickWindow *QQuickRenderControl::window() const return d->window; } +/*! + \fn QWindow *QQuickRenderControl::renderWindow(QPoint *offset) + + Reimplemented in subclasses to return the real window this render control + is rendering into. + + If \a offset in non-null, it is set to the offset of the control + inside the window. +*/ + +/*! + Returns the real window that \a win is being rendered to, if any. + + If \a offset in non-null, it is set to the offset of the rendering + inside its window. + + */ + +QWindow *QQuickRenderControl::renderWindowFor(QQuickWindow *win, QPoint *offset) +{ + if (!win) + return 0; + QQuickRenderControl *rc = QQuickWindowPrivate::get(win)->renderControl; + if (rc) + return rc->renderWindow(offset); + return 0; +} + + + QT_END_NAMESPACE |