qt5base-lts/src
Marc Mutz a3d0983f59 QProgressBar: don't lose precision in text()
When qreal is float, it cannot represent all values an int can take,
so we may lose precision in the expression

  qreal(d->value) - d->minimum

as opposed to the exact result

  qint64(d->value) - d->minimum'

For lack of trying, I do not know of a value where this would change
the resulting 'progress' value, but better be safe than sorry, and use
the 64-bit integer expression instead.

Found while reviewing integer arithmetic in QProgressBar as part of
the fix for QTBUG-57857.

While touching the line, make the (intended) double → int truncation
explicit, by using a static_cast.

Change-Id: I03dbfce24c709310c3bbad9487a2bf0d1d78137a
Reviewed-by: David Faure <david.faure@kdab.com>
2017-01-07 08:19:31 +00:00
..
3rdparty List ANGLE contributions after another 2016-11-23 09:35:53 +00:00
android Optimize QtActivity's onCreate a little bit 2016-12-25 04:14:58 +00:00
angle use helper libs via QMAKE_USE 2016-10-15 18:45:10 +00:00
concurrent QtConcurrent: Add missing override 2016-11-29 20:37:54 +00:00
corelib revert to building qmake with qconfig.cpp 2017-01-06 20:09:08 +00:00
dbus Partially revert "Windows: stop using _beginthreadex on regular builds" 2017-01-03 13:28:24 +00:00
gui Fix deleting of QOpenGLVersionFunctionsBackend 2017-01-06 12:42:29 +00:00
network configure: make library sources fail more verbosely 2016-12-30 10:25:38 +00:00
opengl Add missing override into Qt modules 2016-12-01 12:07:13 +00:00
openglextensions Also release winmain, qopenglextensions under commercial licenses 2016-11-18 16:19:56 +00:00
platformheaders Silence platformheaders syncqt warning about qt_egl_p.h 2016-12-16 04:07:22 +00:00
platformsupport Merge remote-tracking branch 'origin/5.8.0' into 5.8 2016-12-16 09:45:16 +01:00
plugins Accessibility macOS: check for valid interfaces 2017-01-05 19:45:21 +00:00
printsupport Add missing override into Qt modules 2016-12-01 12:07:13 +00:00
sql configure: make library sources fail more verbosely 2016-12-30 10:25:38 +00:00
testlib QTestLib: Add timestamp to mouse click events 2016-12-16 19:18:07 +00:00
tools Silence implicit-fallthough warnings 2016-12-19 09:35:57 +00:00
widgets QProgressBar: don't lose precision in text() 2017-01-07 08:19:31 +00:00
winmain Also release winmain, qopenglextensions under commercial licenses 2016-11-18 16:19:56 +00:00
xml QXmlAttributes: mark as shared-come-qt6 2016-10-04 06:25:54 +00:00
src.pro Add a feature for Qt Xml 2017-01-06 17:19:13 +00:00