From 08a7ae47c24c1378cb39d0c796fcc37cc0c62b32 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 7 Sep 2015 12:50:53 +0200 Subject: 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 --- src/quickwidgets/qquickwidget.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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; -- cgit v1.2.3