From 8738f09b9fc1b35e3dc78211368d87069f3071f7 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Sat, 26 Jul 2014 17:29:54 +0200 Subject: 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 --- src/widgets/styles/qstyleanimation_p.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/widgets/styles/qstyleanimation_p.h') 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 -- cgit v1.2.3