diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2017-01-05 08:10:53 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2017-01-07 10:48:45 +0000 |
commit | 1d1b60dee40de3b8d67be46399b58d4b1ecddab1 (patch) | |
tree | 76a13a6a21c703c096af46666b60fd9fe987a469 /src/gui/doc/src/dnd.qdoc | |
parent | 555a0f3c511368eff51cd0f8e52f0abc7a0ff28c (diff) |
QStylesheetStyle: don't lose precision when drawing a progress bar
When qreal is float, it cannot represent all values an int can take,
so we may lose precision in the expression
qreal(a) / b
as opposed to the double result
double(a) / b
For lack of trying, I do not know of a value where this would change
the resulting 'fillWidth' value, but better be safe than sorry, and
use double instead of qreal arithmetic.
Also, when calculating fillRatio, we were converting values back and
forth between qreal and double. Using double everywhere avoids that.
Found while reviewing integer arithmetic in QProgressBar as part of
the fix for QTBUG-57857.
Change-Id: I054cb11d35e3ecf5bf79b5c8ee39029bd23bcf49
Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/gui/doc/src/dnd.qdoc')
0 files changed, 0 insertions, 0 deletions