diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2016-07-14 12:43:46 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2016-07-15 09:30:31 +0000 |
commit | c2414e16aba2ad499a49d3661a2961795c9a9dc9 (patch) | |
tree | 08c8d0a06bc4c9bb218f45739daf3b48540cd2d0 /src/quickwidgets | |
parent | 12de7bbc1ee2959f4e31a345b4573242d34474cf (diff) |
Fix rendercontrol grabs with the software backend
Calling grabWindow recurses (since that is implemented via
QQuickRenderControl::grab...) so it's not an option. Instead,
call directly in the software renderer implementation.
Fix also the size of the offscreen QQuickWindow when using QQuickWidget
in combination with the software backend.
Change-Id: I857a2cc0aebbbaa5d52d809aeaec37c15b0787b9
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/quickwidgets')
-rw-r--r-- | src/quickwidgets/qquickwidget.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp index 2a014546e1..b25e2d348d 100644 --- a/src/quickwidgets/qquickwidget.cpp +++ b/src/quickwidgets/qquickwidget.cpp @@ -894,6 +894,12 @@ void QQuickWidget::createFramebufferObject() if (size().isEmpty()) return; + // Even though this is just an offscreen window we should set the position on it, as it might be + // useful for an item to know the actual position of the scene. + // Note: The position will be update when we get a move event (see: updatePosition()). + const QPoint &globalPos = mapToGlobal(QPoint(0, 0)); + d->offscreenWindow->setGeometry(globalPos.x(), globalPos.y(), width(), height()); + if (d->useSoftwareRenderer) { const QSize imageSize = size() * devicePixelRatio(); d->softwareImage = QImage(imageSize, QImage::Format_ARGB32_Premultiplied); @@ -961,11 +967,6 @@ void QQuickWidget::createFramebufferObject() } #endif - // Even though this is just an offscreen window we should set the position on it, as it might be - // useful for an item to know the actual position of the scene. - // Note: The position will be update when we get a move event (see: updatePosition()). - const QPoint &globalPos = mapToGlobal(QPoint(0, 0)); - d->offscreenWindow->setGeometry(globalPos.x(), globalPos.y(), width(), height()); d->offscreenWindow->setRenderTarget(d->fbo); if (samples > 0) |