diff options
Diffstat (limited to 'src/gui/widgets/qprogressbar.cpp')
-rw-r--r-- | src/gui/widgets/qprogressbar.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/widgets/qprogressbar.cpp b/src/gui/widgets/qprogressbar.cpp index ac3338b..6593cd6 100644 --- a/src/gui/widgets/qprogressbar.cpp +++ b/src/gui/widgets/qprogressbar.cpp @@ -204,7 +204,7 @@ bool QProgressBarPrivate::repaintRequired() const \o A progress bar shown in the Plastique widget style. \endtable - \sa QTimeLine, QProgressDialog, {fowler}{GUI Design Handbook: Progress Indicator} + \sa QProgressDialog, {fowler}{GUI Design Handbook: Progress Indicator} */ /*! @@ -443,11 +443,11 @@ QSize QProgressBar::minimumSizeHint() const QString QProgressBar::text() const { Q_D(const QProgressBar); - if (d->maximum == 0 || d->value < d->minimum + if ((d->maximum == 0 && d->minimum == 0) || d->value < d->minimum || (d->value == INT_MIN && d->minimum == INT_MIN)) return QString(); - qint64 totalSteps = qint64(d->maximum) - qint64(d->minimum); + qint64 totalSteps = qint64(d->maximum) - d->minimum; QString result = d->format; result.replace(QLatin1String("%m"), QString::number(totalSteps)); @@ -461,7 +461,7 @@ QString QProgressBar::text() const return result; } - int progress = int(((qreal(d->value) - qreal(d->minimum)) * 100.0) / totalSteps); + int progress = (qreal(d->value) - d->minimum) * 100.0 / totalSteps; result.replace(QLatin1String("%p"), QString::number(progress)); return result; } |