summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qprogressbar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/qprogressbar.cpp')
-rw-r--r--src/gui/widgets/qprogressbar.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/gui/widgets/qprogressbar.cpp b/src/gui/widgets/qprogressbar.cpp
index 1b0a1a1..c583a78 100644
--- a/src/gui/widgets/qprogressbar.cpp
+++ b/src/gui/widgets/qprogressbar.cpp
@@ -341,11 +341,17 @@ int QProgressBar::value() const
void QProgressBar::setRange(int minimum, int maximum)
{
Q_D(QProgressBar);
- d->minimum = minimum;
- d->maximum = qMax(minimum, maximum);
- if ( d->value <(d->minimum-1) || d->value > d->maximum)
- reset();
+ if (minimum != d->minimum || maximum != d->maximum) {
+ d->minimum = minimum;
+ d->maximum = qMax(minimum, maximum);
+
+ if (d->value < (d->minimum - 1) || d->value > d->maximum)
+ reset();
+ else
+ update();
+ }
}
+
/*!
\property QProgressBar::textVisible
\brief whether the current completed percentage should be displayed