qt5base-lts/tests/auto/corelib/thread/qpromise
Ivan Solovev 1d8dd9a02c Track progress range in QFutureInterface::setProgressValue
Previously QFutureInterface::setProgressValue was silently ignoring
the progress range and allowed to set any progress value.
Also no checks were performed in QFutureInterface::setProgressRange,
which allowed the user to set minimum > maximum.

Add checking of the current progress range, when settings the
progress value.
Add checks for minimum and maximum values while setting the progress
range.
The implementation of the checks is mostly based on the logic
that is used in QProgressBar.
- If maximum is smaller than minimum, minimum becomes the only legal
value.
- If the current progress value falls outside the new range, the
progress value is set to be minimum.
- If both progressMinimum() and progressMaximum() return 0, the
current progress range is considered to be unused, and any progress
value can be set.
- When setting the value using setProgressValue(), if the value falls
out of the progress range, the method has no effect.

Task-number: QTBUG-84729
Change-Id: I29cf4f94b8e98e1af30dd46fbdba39c421cf66bf
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-11-17 16:16:31 +01:00
..
CMakeLists.txt CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qpromise.pro Add QPromise implementation 2020-06-09 17:21:38 +03:00
snippet_qpromise.cpp Conditionally disable code snippets that depend on cxx11_future 2020-11-13 20:31:22 +01:00
tst_qpromise.cpp Track progress range in QFutureInterface::setProgressValue 2020-11-17 16:16:31 +01:00