QGraphicsObject: handle QEvent::StyleAnimationUpdate
authorJ-P Nurmi <jpnurmi@digia.com>
Mon, 15 Oct 2012 12:23:07 +0000 (14:23 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 17 Oct 2012 10:55:49 +0000 (12:55 +0200)
Change-Id: I8545d6f26e2c2398e750b0b85ba87892a2e376ae
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
src/widgets/graphicsview/qgraphicsitem.cpp
src/widgets/graphicsview/qgraphicsitem.h

index 02088db..375aa9b 100644 (file)
@@ -7575,6 +7575,18 @@ QGraphicsObject::QGraphicsObject(QGraphicsItemPrivate &dd, QGraphicsItem *parent
     QGraphicsItem::d_ptr->isObject = true;
 }
 
+/*!
+  \reimp
+*/
+bool QGraphicsObject::event(QEvent *ev)
+{
+    if (ev->type() == QEvent::StyleAnimationUpdate) {
+        update();
+        return true;
+    }
+    return QObject::event(ev);
+}
+
 #ifndef QT_NO_GESTURES
 /*!
     Subscribes the graphics object to the given \a gesture with specific \a flags.
index 93fddd3..ce7adfc 100644 (file)
@@ -594,6 +594,9 @@ Q_SIGNALS:
 
 protected:
     QGraphicsObject(QGraphicsItemPrivate &dd, QGraphicsItem *parent);
+
+    bool event(QEvent *ev);
+
 private:
     friend class QGraphicsItem;
     friend class QGraphicsItemPrivate;