summaryrefslogtreecommitdiffstats
path: root/src/gui/styles/qgtkstyle.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/styles/qgtkstyle.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/styles/qgtkstyle.cpp')
-rw-r--r--src/gui/styles/qgtkstyle.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp
index b6ef4c9..2ba151e 100644
--- a/src/gui/styles/qgtkstyle.cpp
+++ b/src/gui/styles/qgtkstyle.cpp
@@ -2075,8 +2075,8 @@ void QGtkStyle::drawControl(ControlElement element,
}
if (vertical)
rect = QRect(rect.left(), rect.top(), rect.height(), rect.width()); // flip width and height
- const int progressIndicatorPos = static_cast<int>((bar->progress - qint64(bar->minimum)) /
- qMax(double(1.0), double(qint64(bar->maximum) - qint64(bar->minimum))) * rect.width());
+ const int progressIndicatorPos = (bar->progress - bar->minimum) * rect.width() /
+ qMax(1, bar->maximum - bar->minimum);
if (progressIndicatorPos >= 0 && progressIndicatorPos <= rect.width())
leftRect = QRect(rect.left(), rect.top(), progressIndicatorPos, rect.height());
if (vertical)