From 0964f2a9aff8b7bcc4ae81b8a21507cfbee04cee Mon Sep 17 00:00:00 2001 From: Pavel Geiger Date: Wed, 7 Jun 2017 07:53:04 +0200 Subject: QWinTaskBarButton: Fix evaluation of progress bar for large values Change order of evaluation so the division is done first Change-Id: I1ce5ae28e1dafa065bf6b6854477cef9ec5b5b25 Reviewed-by: Friedemann Kleint --- src/winextras/qwintaskbarbutton.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/winextras') diff --git a/src/winextras/qwintaskbarbutton.cpp b/src/winextras/qwintaskbarbutton.cpp index f687f68..cedca35 100644 --- a/src/winextras/qwintaskbarbutton.cpp +++ b/src/winextras/qwintaskbarbutton.cpp @@ -166,7 +166,7 @@ void QWinTaskbarButtonPrivate::_q_updateProgress() const int max = progressBar->maximum(); const int range = max - min; if (range > 0) { - const int value = 100 * (progressBar->value() - min) / range; + const int value = qRound(double(100) * (double(progressBar->value() - min)) / double(range)); pTbList->SetProgressValue(handle(), ULONGLONG(value), 100); } } -- cgit v1.2.3