From: Shawn Rutledge Date: Mon, 29 Apr 2013 10:39:53 +0000 (+0200) Subject: QQuickScreen.name can change at runtime X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=3b0a9b27fec09cdab4cde7bfc41578c8c17a8832;p=konrad%2Fqtdeclarative.git 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 --- diff --git a/src/quick/items/qquickscreen.cpp b/src/quick/items/qquickscreen.cpp index 91638d4..80080d8 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 7ce035a..b35fd04 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();