diff options
author | Shawn Rutledge <shawn.rutledge@digia.com> | 2013-04-29 12:39:53 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-04-30 10:49:47 +0200 |
commit | 3b0a9b27fec09cdab4cde7bfc41578c8c17a8832 (patch) | |
tree | d5bd455ebbe4f2dfcfc0789ad1cdebbaf0b8a252 /src/quick | |
parent | f56d268690ddfbf20da7e5ad3d4eacda85a3c317 (diff) |
QQuickScreen.name can change at runtime
It's generally a constant but the attached property doesn't always
have its QScreen at startup, so in practice every property needs a
notifier. (Followup to Id777caf6cef1df5bc01757605e3085151170760b )
Change-Id: Ia3a321f98dc49b7e75f6eceb8f16b153c73a3134
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Diffstat (limited to 'src/quick')
-rw-r--r-- | src/quick/items/qquickscreen.cpp | 2 | ||||
-rw-r--r-- | src/quick/items/qquickscreen_p.h | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/quick/items/qquickscreen.cpp b/src/quick/items/qquickscreen.cpp index 91638d448e..80080d8b88 100644 --- a/src/quick/items/qquickscreen.cpp +++ b/src/quick/items/qquickscreen.cpp @@ -281,6 +281,8 @@ void QQuickScreenAttached::screenChanged(QScreen *screen) emit widthChanged(); emit heightChanged(); } + if (!oldScreen || screen->name() != oldScreen->name()) + emit nameChanged(); if (!oldScreen || screen->orientation() != oldScreen->orientation()) emit orientationChanged(); if (!oldScreen || screen->primaryOrientation() != oldScreen->primaryOrientation()) diff --git a/src/quick/items/qquickscreen_p.h b/src/quick/items/qquickscreen_p.h index 7ce035a93d..b35fd04e58 100644 --- a/src/quick/items/qquickscreen_p.h +++ b/src/quick/items/qquickscreen_p.h @@ -58,7 +58,7 @@ class Q_AUTOTEST_EXPORT QQuickScreenAttached : public QObject { Q_OBJECT - Q_PROPERTY(QString name READ name CONSTANT REVISION 1); + Q_PROPERTY(QString name READ name NOTIFY nameChanged REVISION 1); Q_PROPERTY(int width READ width NOTIFY widthChanged) Q_PROPERTY(int height READ height NOTIFY heightChanged) Q_PROPERTY(int desktopAvailableWidth READ desktopAvailableWidth NOTIFY desktopGeometryChanged REVISION 1) @@ -85,6 +85,7 @@ public: void windowChanged(QQuickWindow*); Q_SIGNALS: + Q_REVISION(1) void nameChanged(); void widthChanged(); void heightChanged(); Q_REVISION(1) void desktopGeometryChanged(); |