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>
#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>
// 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())