summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2018-08-28 13:51:45 +0200
committerJohan Helsing <johan.helsing@qt.io>2019-01-17 06:23:38 +0000
commit640c04b8ba86223c5e13734b8bbc91cce91291a4 (patch)
tree24789239c8a80b67a04ffbf5d9077ccde2aa7652
parent017e1fa058d133ff4943907bd97822344183a619 (diff)
Compositor: Emit a signal when WaylandQuickItem.compositor changes
Fixes warnings like: QQmlExpression: Expression qrc:/Chrome.qml:13:5 depends on non-NOTIFYable properties: Chrome_QMLTYPE_28::compositor [ChangeLog][Compositor] Added a missing change signal for WaylandQuickItem.compositor. Change-Id: I9f372c46778d0851a82a8dcbb0751a0e12f825b1 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
-rw-r--r--src/compositor/compositor_api/qwaylandquickitem.cpp4
-rw-r--r--src/compositor/compositor_api/qwaylandquickitem.h3
2 files changed, 6 insertions, 1 deletions
diff --git a/src/compositor/compositor_api/qwaylandquickitem.cpp b/src/compositor/compositor_api/qwaylandquickitem.cpp
index f848a016..6e41c7c0 100644
--- a/src/compositor/compositor_api/qwaylandquickitem.cpp
+++ b/src/compositor/compositor_api/qwaylandquickitem.cpp
@@ -414,7 +414,11 @@ QWaylandSurface *QWaylandQuickItem::surface() const
void QWaylandQuickItem::setSurface(QWaylandSurface *surface)
{
Q_D(QWaylandQuickItem);
+ QWaylandCompositor *oldComp = d->view->surface() ? d->view->surface()->compositor() : nullptr;
d->view->setSurface(surface);
+ QWaylandCompositor *newComp = d->view->surface() ? d->view->surface()->compositor() : nullptr;
+ if (oldComp != newComp)
+ emit compositorChanged();
update();
}
diff --git a/src/compositor/compositor_api/qwaylandquickitem.h b/src/compositor/compositor_api/qwaylandquickitem.h
index 6f47c29a..269e5556 100644
--- a/src/compositor/compositor_api/qwaylandquickitem.h
+++ b/src/compositor/compositor_api/qwaylandquickitem.h
@@ -61,7 +61,7 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandQuickItem : public QQuickItem
{
Q_OBJECT
Q_DECLARE_PRIVATE(QWaylandQuickItem)
- Q_PROPERTY(QWaylandCompositor *compositor READ compositor)
+ Q_PROPERTY(QWaylandCompositor *compositor READ compositor NOTIFY compositorChanged)
Q_PROPERTY(QWaylandSurface *surface READ surface WRITE setSurface NOTIFY surfaceChanged)
Q_PROPERTY(bool paintEnabled READ paintEnabled WRITE setPaintEnabled)
Q_PROPERTY(bool touchEventsEnabled READ touchEventsEnabled WRITE setTouchEventsEnabled NOTIFY touchEventsEnabledChanged)
@@ -177,6 +177,7 @@ private Q_SLOTS:
Q_SIGNALS:
void surfaceChanged();
+ void compositorChanged();
void touchEventsEnabledChanged();
void originChanged();
void surfaceDestroyed();