Request paint if scene changes for the canvas item
authorMarco Bubke <marco.bubke@digia.com>
Tue, 25 Jun 2013 11:37:30 +0000 (13:37 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 26 Jun 2013 14:53:11 +0000 (16:53 +0200)
Otherwise for every scene the canvas is simply not painted anymore in the
designer. For example if you change the parent.

Change-Id: I4883eab44d73a59381230755f7caa596f2b6569f
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>

src/quick/items/context2d/qquickcanvasitem.cpp

index 1b33680..8844eb9 100644 (file)
@@ -626,8 +626,11 @@ void QQuickCanvasItem::itemChange(QQuickItem::ItemChange change, const QQuickIte
         return;
 
     Q_D(QQuickCanvasItem);
-    if (d->available)
+    if (d->available) {
+        if (d->dirtyAttributes & QQuickItemPrivate::ContentUpdateMask)
+            requestPaint();
         return;
+    }
 
     if (value.window== 0)
         return;