Do not attempt to open multiple windows in hellowindow on embedded

Platforms like eglfs will not allow opening more than one OpenGL-based
window. To prevent aborting the hellowindow example when invoked without
--single, enhance the capability check to include also WindowManagement
in addition to ThreadedOpenGL.

Change-Id: I147d90b31d9fd94912c36339d36af3f311aaa874
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
This commit is contained in:
Laszlo Agocs 2014-03-06 12:01:54 +01:00 committed by The Qt Project
parent cd652500af
commit 7b1058ac92

View File

@ -51,8 +51,9 @@ int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
const bool multipleWindows =
QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ThreadedOpenGL)
QPlatformIntegration *integ = QGuiApplicationPrivate::platformIntegration();
const bool multipleWindows = integ->hasCapability(QPlatformIntegration::ThreadedOpenGL)
&& integ->hasCapability(QPlatformIntegration::WindowManagement)
&& !QGuiApplication::arguments().contains(QStringLiteral("--single"));
QScreen *screen = QGuiApplication::primaryScreen();