Android: avoid crash with toplevel QGLWidget

Task-number: QTBUG-37096

Change-Id: I14db37a78314782d7b5897db946283bd0063e348
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
bb10
Paul Olav Tvete 2014-02-27 14:08:06 +01:00 committed by The Qt Project
parent e2d21a0483
commit d307785381
1 changed files with 4 additions and 1 deletions

View File

@ -51,7 +51,10 @@ QAndroidPlatformBackingStore::QAndroidPlatformBackingStore(QWindow *window)
: QPlatformBackingStore(window)
{
Q_ASSERT(window->handle());
(static_cast<QAndroidPlatformRasterWindow *>(window->handle()))->setBackingStore(this);
if (window->surfaceType() == QSurface::RasterSurface)
(static_cast<QAndroidPlatformRasterWindow *>(window->handle()))->setBackingStore(this);
else
qWarning("QAndroidPlatformBackingStore does not support GL windows.");
}
QPaintDevice *QAndroidPlatformBackingStore::paintDevice()