summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qprogressbar.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-07-22 11:19:32 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-07-22 11:29:58 (GMT)
commit336954fb9b990c6d7c44ed3a8d676a6e21b2057f (patch)
tree3d29f3aae74abd76d24e19d98a1ac3f1d42638d3 /src/gui/widgets/qprogressbar.cpp
parent3a8968dd2aab9c4e40ed34222f557bec6a98349e (diff)
downloadQt-336954fb9b990c6d7c44ed3a8d676a6e21b2057f.zip
Qt-336954fb9b990c6d7c44ed3a8d676a6e21b2057f.tar.gz
Qt-336954fb9b990c6d7c44ed3a8d676a6e21b2057f.tar.bz2
Simplify the computation of the QProgressBar progress.
This is also a work around for a bug in gcc on powerpc (embedded-linux) Task-number: 258358 Reviewed-by: jbache
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 d168028..846f127 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();
- qint64 totalSteps = qint64(d->maximum) - qint64(d->minimum);
+ int totalSteps = 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 = (d->value - d->minimum) * 100 / totalSteps;
result.replace(QLatin1String("%p"), QString::number(progress));
return result;
}