Added MultipleWindows platform capability.

Several platform plugins, like eglfs, kms, etc don't support multiple
windows as there's no system compositor, they're rendering directly to
a single back buffer. By adding a platform capability we'll be able to
provide better error reporting when an application tries to create
multiple QWindows on a single-window platform. Also, QML apps can use
this capability to figure out whether they should create a QWindow for
dialogs / popups / menus, or whether to just create items in the same
scene, that are shown on top of the rest of the content.

Change-Id: I15b8d21ee2bc4568e9d705dbf32f872c2c25742b
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
This commit is contained in:
Samuel Rødal 2012-10-31 12:32:31 +01:00 committed by The Qt Project
parent 6be78c0712
commit 300534fc21
6 changed files with 15 additions and 5 deletions

View File

@ -195,6 +195,10 @@ QPlatformServices *QPlatformIntegration::services() const
\value BufferQueueingOpenGL The OpenGL implementation on the platform will queue
up buffers when swapBuffers() is called and block only when its buffer pipeline
is full, rather than block immediately.
\value MultipleWindows The platform supports multiple QWindows, i.e. does some kind
of compositing either client or server side. Some platforms might only support a
single fullscreen window.
*/

View File

@ -83,11 +83,12 @@ class Q_GUI_EXPORT QPlatformIntegration
public:
enum Capability {
ThreadedPixmaps = 1,
OpenGL = 2,
ThreadedOpenGL = 3,
SharedGraphicsCache = 4,
BufferQueueingOpenGL = 5,
WindowMasks = 6
OpenGL,
ThreadedOpenGL,
SharedGraphicsCache,
BufferQueueingOpenGL,
WindowMasks,
MultipleWindows
};
virtual ~QPlatformIntegration() { }

View File

@ -309,6 +309,7 @@ bool QCocoaIntegration::hasCapability(QPlatformIntegration::Capability cap) cons
case ThreadedOpenGL:
case BufferQueueingOpenGL:
case WindowMasks:
case MultipleWindows:
return true;
default:
return QPlatformIntegration::hasCapability(cap);

View File

@ -74,6 +74,7 @@ bool QMinimalIntegration::hasCapability(QPlatformIntegration::Capability cap) co
{
switch (cap) {
case ThreadedPixmaps: return true;
case MultipleWindows: return true;
default: return QPlatformIntegration::hasCapability(cap);
}
}

View File

@ -338,6 +338,8 @@ bool QWindowsIntegration::hasCapability(QPlatformIntegration::Capability cap) co
#endif // !QT_NO_OPENGL
case WindowMasks:
return true;
case MultipleWindows:
return true;
default:
return QPlatformIntegration::hasCapability(cap);
}

View File

@ -216,6 +216,7 @@ bool QXcbIntegration::hasCapability(QPlatformIntegration::Capability cap) const
#endif
case ThreadedOpenGL: return false;
case WindowMasks: return true;
case MultipleWindows: return true;
default: return QPlatformIntegration::hasCapability(cap);
}
}