summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qprogressbar.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-07-22 11:56:51 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-07-22 12:02:51 (GMT)
commit27e5a1f9542b03a6930f002e8d7dafd97cf88a1a (patch)
treeed5dbaaa9a0824ba1910f89db8bf38374b574b58 /src/gui/widgets/qprogressbar.cpp
parent336954fb9b990c6d7c44ed3a8d676a6e21b2057f (diff)
downloadQt-27e5a1f9542b03a6930f002e8d7dafd97cf88a1a.zip
Qt-27e5a1f9542b03a6930f002e8d7dafd97cf88a1a.tar.gz
Qt-27e5a1f9542b03a6930f002e8d7dafd97cf88a1a.tar.bz2
Support for very large range in QProgressBar
Regression since my last commit. Task-number: 152227
Diffstat (limited to 'src/gui/widgets/qprogressbar.cpp')
-rw-r--r--src/gui/widgets/qprogressbar.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/widgets/qprogressbar.cpp b/src/gui/widgets/qprogressbar.cpp
index 846f127..6b38e9f 100644
--- a/src/gui/widgets/qprogressbar.cpp
+++ b/src/gui/widgets/qprogressbar.cpp
@@ -447,7 +447,7 @@ QString QProgressBar::text() const
|| (d->value == INT_MIN && d->minimum == INT_MIN))
return QString();
- int totalSteps = d->maximum - 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 = (d->value - d->minimum) * 100 / totalSteps;
+ int progress = (qreal(d->value) - d->minimum) * 100.0 / totalSteps;
result.replace(QLatin1String("%p"), QString::number(progress));
return result;
}