aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickwidgets/qquickwidget.cpp
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@digia.com>2014-05-21 14:10:02 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-21 16:20:35 +0200
commita51822cbf87291de6ba327c38d43583671ee892b (patch)
tree7b1e969da41b8c13128de935ab2ffe421e2dab3d /src/quickwidgets/qquickwidget.cpp
parentf6e751f8d7644ccad6afdbe931611030c3b5cc6d (diff)
Don't crash on Android
If the platform plugin does not support the features needed for QQuickWidget, then don't try to use it. This is a minimal change to stop applications from crashing: it does not give the application a way to find out if QQuickWidget is supported, since that would mean new API, which we can't do in a patch release. Task-number: QTBUG-38268 Change-Id: I975a03b105b1d5c21a1d8ae440a5802ce8c1967b Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src/quickwidgets/qquickwidget.cpp')
-rw-r--r--src/quickwidgets/qquickwidget.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp
index 7e31c271f4..687aeabfe5 100644
--- a/src/quickwidgets/qquickwidget.cpp
+++ b/src/quickwidgets/qquickwidget.cpp
@@ -55,6 +55,8 @@
#include <private/qqmlengine_p.h>
#include <QtCore/qbasictimer.h>
#include <QtGui/QOffscreenSurface>
+#include <QtGui/private/qguiapplication_p.h>
+#include <QtGui/qpa/qplatformintegration.h>
#ifdef Q_OS_WIN
# include <QtWidgets/QMessageBox>
@@ -89,7 +91,11 @@ void QQuickWidgetPrivate::init(QQmlEngine* e)
// Do not call create() on offscreenWindow.
createOffscreenSurface();
- setRenderToTexture();
+ if (QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::RasterGLSurface))
+ setRenderToTexture();
+ else
+ qWarning("QQuickWidget is not supported on this platform.");
+
engine = e;
if (engine.isNull())