summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qwindowsstyle_p.h
diff options
context:
space:
mode:
authorTero Ahola <tero.ahola@digia.com>2011-11-11 09:13:07 +0100
committerQt by Nokia <qt-info@nokia.com>2011-11-11 09:18:44 +0100
commitadcfc9f38b3d199452cfb128407006dc4cc02382 (patch)
treec0e752b3bb4ba41442924717a40f82c32812ccc7 /src/widgets/styles/qwindowsstyle_p.h
parentebfe3a4217c8b9c040faeb77906dfe9ccdfd5408 (diff)
Fix QProgressBar causing timer event spam
On Windows you will get a lot of timer events if you use QProgressBar widget. This is because QWindowsStyle uses a timer to animate a progress bar with unknown state (min and max values both zero). The issue was fixed by starting the timer only if needed. Task-number: QTBUG-10501 (cherry picked from commit 72e61b127470b044e370af7017fa8a5b0538244f) Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Change-Id: If9ff2ab99929d9b85a7ffa8f6fd47b045b982f67 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'src/widgets/styles/qwindowsstyle_p.h')
-rw-r--r--src/widgets/styles/qwindowsstyle_p.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/widgets/styles/qwindowsstyle_p.h b/src/widgets/styles/qwindowsstyle_p.h
index b9f39a0940..1e517e9e79 100644
--- a/src/widgets/styles/qwindowsstyle_p.h
+++ b/src/widgets/styles/qwindowsstyle_p.h
@@ -71,13 +71,15 @@ class QWindowsStylePrivate : public QCommonStylePrivate
Q_DECLARE_PUBLIC(QWindowsStyle)
public:
QWindowsStylePrivate();
+ void startAnimation(QObject *o, QProgressBar *bar);
+ void stopAnimation(QObject *o, QProgressBar *bar);
bool hasSeenAlt(const QWidget *widget) const;
bool altDown() const { return alt_down; }
bool alt_down;
QList<const QWidget *> seenAlt;
int menuBarTimer;
- QList<QProgressBar *> bars;
+ QList<QProgressBar *> animatedProgressBars;
int animationFps;
int animateTimer;
QElapsedTimer startTime;