aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickwidgets
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-09-07 12:50:53 +0200
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-09-08 21:27:23 +0000
commit08a7ae47c24c1378cb39d0c796fcc37cc0c62b32 (patch)
tree0396fc457036090e3a0494ed7d57bcbab3a77b25 /src/quickwidgets
parent761f23acbedf66a02d91d9e4da232ee28b65aeee (diff)
QQuickWidget: do not render when there is no fbo due to no size
It is not invalid to have a widget with a 0,0 size. The FBO logic already handles this: no FBO is created in this case, it will be done on a subsequent resize. However, we can still get to render() which is not currently prepared to handle this case. Correct this. Task-number: QTBUG-47588 Task-number: QTBUG-48059 Change-Id: Idd674c536847e5f293fec5a40aa3038600473c27 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src/quickwidgets')
-rw-r--r--src/quickwidgets/qquickwidget.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp
index 70c9309ab0..47bcabc115 100644
--- a/src/quickwidgets/qquickwidget.cpp
+++ b/src/quickwidgets/qquickwidget.cpp
@@ -206,6 +206,11 @@ void QQuickWidgetPrivate::itemGeometryChanged(QQuickItem *resizeItem, const QRec
void QQuickWidgetPrivate::render(bool needsSync)
{
+ // createFramebufferObject() bails out when the size is empty. In this case
+ // we cannot render either.
+ if (!fbo)
+ return;
+
if (!context->makeCurrent(offscreenSurface)) {
qWarning("QQuickWidget: Cannot render due to failing makeCurrent()");
return;