From: Samuel Rødal Date: Thu, 8 Nov 2012 14:34:26 +0000 (+0100) Subject: Expose "Qt.application.supportsMultipleWindows". X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0df606e2ab8f3b60e1ad57dba245acf2e7810612;p=profile%2Fivi%2Fqtdeclarative.git 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) --- 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();