Add QEvent::StyleAnimationUpdate: style animation target should update
authorJ-P Nurmi <jpnurmi@digia.com>
Thu, 4 Oct 2012 13:30:09 +0000 (15:30 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 8 Oct 2012 22:46:01 +0000 (00:46 +0200)
The event will be sent from the upcoming style animations. This change
merely introduces the new event type and makes both QWidget and
QGraphicsWidget call update() upon receiving the event.

Change-Id: I69bb4d05bacb22f7e3a2512cae68848801e4f4d7
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
src/corelib/kernel/qcoreevent.cpp
src/corelib/kernel/qcoreevent.h
src/widgets/graphicsview/qgraphicswidget.cpp
src/widgets/kernel/qwidget.cpp

index 231e7f3..71690ba 100644 (file)
@@ -262,6 +262,7 @@ QT_BEGIN_NAMESPACE
     \omitvalue ShowWindowRequest
     \omitvalue Speech
     \omitvalue Style
+    \omitvalue StyleAnimationUpdate
     \omitvalue ZeroTimerEvent
     \omitvalue ApplicationActivated
     \omitvalue ApplicationDeactivated
index 98dde37..d30f93f 100644 (file)
@@ -279,6 +279,8 @@ public:
 
         PlatformPanel = 212,
 
+        StyleAnimationUpdate = 213,             // style animation target should be updated
+
         // 512 reserved for Qt Jambi's MetaCall event
         // 513 reserved for Qt Jambi's DeleteOnMainThread event
 
index cc8ea47..05ae51c 100644 (file)
@@ -1408,6 +1408,7 @@ bool QGraphicsWidget::event(QEvent *event)
         break;
     case QEvent::WindowActivate:
     case QEvent::WindowDeactivate:
+    case QEvent::StyleAnimationUpdate:
         update();
         break;
         // Taken from QWidget::event
index ffcaa15..fa055bb 100644 (file)
@@ -8142,6 +8142,9 @@ bool QWidget::event(QEvent *event)
     case QEvent::UpdateLater:
         update(static_cast<QUpdateLaterEvent*>(event)->region());
         break;
+    case QEvent::StyleAnimationUpdate:
+        update();
+        break;
 
     case QEvent::WindowBlocked:
     case QEvent::WindowUnblocked: