From: Paul Olav Tvete Date: Wed, 21 May 2014 12:10:02 +0000 (+0200) Subject: Don't crash on Android X-Git-Tag: upstream/5.3.1~53 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a51822cbf87291de6ba327c38d43583671ee892b;p=platform%2Fupstream%2Fqtdeclarative.git 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 --- diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp index 7e31c27..687aeab 100644 --- a/src/quickwidgets/qquickwidget.cpp +++ b/src/quickwidgets/qquickwidget.cpp @@ -55,6 +55,8 @@ #include #include #include +#include +#include #ifdef Q_OS_WIN # include @@ -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())