Index: qt4/style/qtcurve.h =================================================================== --- qt4/style/qtcurve.h +++ qt4/style/qtcurve.h @@ -437,6 +437,7 @@ mutable QLabel *m_clickedLabel; QSet m_progressBars; int m_progressBarAnimateTimer, + m_progressBarAnimateFps, m_animateStep; QTime m_timer; mutable QMap m_titleBarButtonsCols; Index: qt4/style/qtcurve.cpp =================================================================== --- qt4/style/qtcurve.cpp +++ qt4/style/qtcurve.cpp @@ -576,6 +576,7 @@ static const int constWindowMargin = 2; static const int constProgressBarFps = 20; +static const int constProgressIdleFps = 2; static const int constTabPad = 6; static const QLatin1String constDwtClose("qt_dockwidget_closebutton"); @@ -2694,10 +2695,15 @@ if(bar) { m_progressBars.insert(bar); - if (1==m_progressBars.size()) + if (!m_progressBarAnimateTimer) { m_timer.start(); - m_progressBarAnimateTimer = startTimer(1000 / constProgressBarFps); + // set the short interval when required, otherwise a less expensive "idling" interval + // that still maintains a reasonable reaction time when a progress bar is toggled + // into "busy" (animated) mode. + m_progressBarAnimateFps = (opts.animatedProgress || (0 == bar->minimum() && 0 == bar->maximum())) ? + constProgressBarFps : constProgressIdleFps; + m_progressBarAnimateTimer = startTimer(1000/m_progressBarAnimateFps); } } else if(!POPUP_MENUS_SQUARE(opts) && object->inherits("QComboBoxPrivateContainer")) { @@ -2828,6 +2834,14 @@ bar->value() != bar->maximum()) || (0 == bar->minimum() && 0 == bar->maximum())) { bar->update(); + if (m_progressBarAnimateFps == constProgressIdleFps) { + // go into "high frequency" mode because we're no longer firing + // idly. This mode will remain in effect until the timer can be + // stopped. + killTimer(m_progressBarAnimateTimer); + m_progressBarAnimateFps = constProgressBarFps; + m_progressBarAnimateTimer = startTimer(1000/m_progressBarAnimateFps); + } } } } Index: qt5/style/qtcurve.h =================================================================== --- qt5/style/qtcurve.h +++ qt5/style/qtcurve.h @@ -557,6 +557,7 @@ mutable QLabel *m_clickedLabel; QSet m_progressBars; int m_progressBarAnimateTimer, + m_progressBarAnimateFps, m_animateStep; QTime m_timer; mutable QMap m_titleBarButtonsCols; Index: qt5/style/qtcurve_api.cpp =================================================================== --- qt5/style/qtcurve_api.cpp +++ qt5/style/qtcurve_api.cpp @@ -1313,10 +1313,15 @@ if(bar) { m_progressBars.insert(bar); - if (1==m_progressBars.size()) + if (!m_progressBarAnimateTimer) { m_timer.start(); - m_progressBarAnimateTimer = startTimer(1000 / constProgressBarFps); + // set the short interval when required, otherwise a less expensive "idling" interval + // that still maintains a reasonable reaction time when a progress bar is toggled + // into "busy" (animated) mode. + m_progressBarAnimateFps = (opts.animatedProgress || (0 == bar->minimum() && 0 == bar->maximum())) ? + constProgressBarFps : constProgressIdleFps; + m_progressBarAnimateTimer = startTimer(1000/m_progressBarAnimateFps); } } else if (!(opts.square & SQUARE_POPUP_MENUS) && object->inherits("QComboBoxPrivateContainer")) { @@ -1427,6 +1432,14 @@ bar->value() != bar->maximum()) || (0 == bar->minimum() && 0 == bar->maximum())) { bar->update(); + if (m_progressBarAnimateFps == constProgressIdleFps) { + // go into "high frequency" mode because we're no longer firing + // idly. This mode will remain in effect until the timer can be + // stopped. + killTimer(m_progressBarAnimateTimer); + m_progressBarAnimateFps = constProgressBarFps; + m_progressBarAnimateTimer = startTimer(1000/m_progressBarAnimateFps); + } } } } Index: qt5/style/qtcurve_p.h =================================================================== --- qt5/style/qtcurve_p.h +++ qt5/style/qtcurve_p.h @@ -44,6 +44,7 @@ static const int constMenuPixmapWidth = 22; static const int constWindowMargin = 2; static const int constProgressBarFps = 20; +static const int constProgressIdleFps = 2; static const int constTabPad = 6; static const QLatin1String constDwtClose("qt_dockwidget_closebutton");