diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2015-03-26 21:34:42 +0100 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2015-03-27 09:28:29 +0000 |
commit | 9cd486186e1e4e78f4f1b7e4a9142008a254c8cd (patch) | |
tree | 34bbe45bfe86d28851ec8e5c501a2499c3499954 /src/quickwidgets/qquickwidget.cpp | |
parent | 5ac1654715b3e268d86570c860460f24697f2267 (diff) |
QQuickWidget: expose the underlying QQuickWindow
There's a number of APIs (such as all the scenegraph-related
signals) that are currently missing from QQuickWidget.
Instead of duplicating every API in QQuickWidget, simply expose
the underlying offscreen QQuickWindow.
Task-number: QTBUG-45260
Change-Id: I1a89fe600ce675963ea24ee6dd56d6ca4fea9cd2
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'src/quickwidgets/qquickwidget.cpp')
-rw-r--r-- | src/quickwidgets/qquickwidget.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp index c4100551d0..b472664068 100644 --- a/src/quickwidgets/qquickwidget.cpp +++ b/src/quickwidgets/qquickwidget.cpp @@ -1218,4 +1218,23 @@ void QQuickWidget::setClearColor(const QColor &color) d->offscreenWindow->setColor(color); } +/*! + \since 5.5 + + Returns the offscreen QQuickWindow which is used by this widget to drive + the Qt Quick rendering. This is useful if you want to use QQuickWindow + APIs that are not currently exposed by QQuickWidget, for instance + connecting to the QQuickWindow::beforeRendering() signal in order + to draw native OpenGL content below Qt Quick's own rendering. + + \warning Use the return value of this function with caution. In + particular, do not ever attempt to show the QQuickWindow, and be + very careful when using other QWindow-only APIs. +*/ +QQuickWindow *QQuickWidget::quickWindow() const +{ + Q_D(const QQuickWidget); + return d->offscreenWindow; +} + QT_END_NAMESPACE |