diff options
author | J-P Nurmi <jpnurmi@digia.com> | 2014-07-26 17:29:54 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@digia.com> | 2014-07-30 10:18:08 +0200 |
commit | 8738f09b9fc1b35e3dc78211368d87069f3071f7 (patch) | |
tree | a52ef7c94e374743fd9da997e898b69fb3fe2542 /src/widgets/styles/qstyleanimation_p.h | |
parent | 0240110c58f0d6b694445f6685f0f77b14b769d8 (diff) |
Reduce the default frame rate of style animations
Halves the amount of paint events triggered by transient scrollbars.
Task-number: QTBUG-30316
Change-Id: Ifdf968d5c45013332758a6b751ce11d1ef2a2ca8
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src/widgets/styles/qstyleanimation_p.h')
-rw-r--r-- | src/widgets/styles/qstyleanimation_p.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/widgets/styles/qstyleanimation_p.h b/src/widgets/styles/qstyleanimation_p.h index c344858812..19e629cb25 100644 --- a/src/widgets/styles/qstyleanimation_p.h +++ b/src/widgets/styles/qstyleanimation_p.h @@ -78,8 +78,21 @@ public: QTime startTime() const; void setStartTime(const QTime &time); + enum FrameRate { + DefaultFps, + SixtyFps, + ThirtyFps, + TwentyFps + }; + + FrameRate frameRate() const; + void setFrameRate(FrameRate fps); + void updateTarget(); +public Q_SLOTS: + void start(); + protected: virtual bool isUpdateNeeded() const; virtual void updateCurrentTime(int time); @@ -88,6 +101,8 @@ private: int _delay; int _duration; QTime _startTime; + FrameRate _fps; + int _skip; }; class QProgressStyleAnimation : public QStyleAnimation |