diff options
author | J-P Nurmi <jpnurmi@digia.com> | 2012-10-04 15:30:09 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-09 00:46:01 +0200 |
commit | 8f9346dd663d65f5030d4fb590564a8661a634d8 (patch) | |
tree | 89f1cccce671a868efa54bb6bbede804d4b97490 | |
parent | 0776746d47c9b0d575b6190b1882c571a76ee086 (diff) |
Add QEvent::StyleAnimationUpdate: style animation target should update
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>
-rw-r--r-- | src/corelib/kernel/qcoreevent.cpp | 1 | ||||
-rw-r--r-- | src/corelib/kernel/qcoreevent.h | 2 | ||||
-rw-r--r-- | src/widgets/graphicsview/qgraphicswidget.cpp | 1 | ||||
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 3 |
4 files changed, 7 insertions, 0 deletions
diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp index 231e7f34cd..71690ba90b 100644 --- a/src/corelib/kernel/qcoreevent.cpp +++ b/src/corelib/kernel/qcoreevent.cpp @@ -262,6 +262,7 @@ QT_BEGIN_NAMESPACE \omitvalue ShowWindowRequest \omitvalue Speech \omitvalue Style + \omitvalue StyleAnimationUpdate \omitvalue ZeroTimerEvent \omitvalue ApplicationActivated \omitvalue ApplicationDeactivated diff --git a/src/corelib/kernel/qcoreevent.h b/src/corelib/kernel/qcoreevent.h index 98dde37e3a..d30f93f9f3 100644 --- a/src/corelib/kernel/qcoreevent.h +++ b/src/corelib/kernel/qcoreevent.h @@ -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 diff --git a/src/widgets/graphicsview/qgraphicswidget.cpp b/src/widgets/graphicsview/qgraphicswidget.cpp index cc8ea47e7e..05ae51c630 100644 --- a/src/widgets/graphicsview/qgraphicswidget.cpp +++ b/src/widgets/graphicsview/qgraphicswidget.cpp @@ -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 diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index ffcaa15527..fa055bb210 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -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: |