From 0df606e2ab8f3b60e1ad57dba245acf2e7810612 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Samuel=20R=C3=B8dal?= Date: Thu, 8 Nov 2012 15:34:26 +0100 Subject: [PATCH] Expose "Qt.application.supportsMultipleWindows". Useful on platforms like kms and eglfs that only support a single QWindow. On those platforms the QML application can thus choose to use a Rectangle instead of a Window to show dialogs etc. Change-Id: Idc3f46d2cad6cf3f55c5c84df2c8511407bd4849 Reviewed-by: Shawn Rutledge Reviewed-by: Alan Alpert (RIM) --- src/quick/util/qquickapplication.cpp | 7 +++++++ src/quick/util/qquickapplication_p.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/quick/util/qquickapplication.cpp b/src/quick/util/qquickapplication.cpp index 27ee2f0..962fb52 100644 --- a/src/quick/util/qquickapplication.cpp +++ b/src/quick/util/qquickapplication.cpp @@ -42,6 +42,8 @@ #include "qquickapplication_p.h" #include +#include +#include #include #include @@ -91,6 +93,11 @@ Qt::LayoutDirection QQuickApplication::layoutDirection() const return d->direction; } +bool QQuickApplication::supportsMultipleWindows() const +{ + return QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::MultipleWindows); +} + bool QQuickApplication::eventFilter(QObject *, QEvent *event) { Q_D(QQuickApplication); diff --git a/src/quick/util/qquickapplication_p.h b/src/quick/util/qquickapplication_p.h index 5cf31ef..5519f22 100644 --- a/src/quick/util/qquickapplication_p.h +++ b/src/quick/util/qquickapplication_p.h @@ -57,12 +57,14 @@ class Q_AUTOTEST_EXPORT QQuickApplication : public QObject Q_OBJECT Q_PROPERTY(bool active READ active NOTIFY activeChanged) Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection NOTIFY layoutDirectionChanged) + Q_PROPERTY(bool supportsMultipleWindows READ supportsMultipleWindows CONSTANT) public: explicit QQuickApplication(QObject *parent = 0); virtual ~QQuickApplication(); bool active() const; Qt::LayoutDirection layoutDirection() const; + bool supportsMultipleWindows() const; Q_SIGNALS: void activeChanged(); -- 2.7.4