qt5base-lts/tests/auto
Harald Nordgren 97e40a5409 Allow adaptive decimal stepping for QSpinBox and QDoubleSpinBox
Adds the feature of adaptive decimal step sizes for the QSpinBox and
QDoubleSpinBox. By performing a calculation in
QAbstractSpinBox::stepBy() we continuously set the step size one power
of ten below the current value.

So when the value is 1100, the step is set to 100, so stepping up once
increases it to 1200. For 1200 stepping up takes it to 1300. For
negative values stepping down from -1100 goes to -1200.

It also works for all decimal values. 0.041 is increased to 0.042 by
stepping once, and so on.

The step direction is taken into account to handle edges cases, so that
stepping down from 100 takes the value to 99 instead of 90. Thus, a
step up followed by a step down -- or vice versa -- lands on the
starting value; 99 -> 100 -> 99.

Setting this property effectively disregards singleStep, but preserves
its value so that it takes effect again when adaptive decimal step is
disabled.

Adaptive decimal step allows values to be easily set to reasonable
levels. If the spin box value is 12000, changing to 13000 often makes
more sense than to 12001. The feature is turned off be default, when
single stepping is desired.

The accelerated property allows values to be changed quickly, as well,
but it is imprecise. Holding down the button makes it hard to land on
an even thousand, like 12000 or 13000. Often you end up somewhere
nearby and would need a second adjustment to get to an even hundred or
thousand.

[ChangeLog][QtWidgets] Add option of adaptive decimal step size for
QSpinBox and QDoubleSpinBox.

Change-Id: I9f286479b821e240c8ea05c238932fc128c582bb
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-03-22 21:37:45 +00:00
..
android Updated license headers 2016-01-21 18:55:18 +00:00
bic/data Add binary compatibility files for QtBase for 5.10 2018-01-04 16:26:32 +00:00
cmake CMake: Set SKIP_AUTOMOC/AUTOUIC where needed 2017-11-22 13:51:30 +00:00
compilerwarnings/data Updated license headers 2016-01-21 18:55:18 +00:00
concurrent Merge remote-tracking branch 'origin/5.11' into dev 2018-02-16 08:54:58 +01:00
corelib Merge remote-tracking branch 'origin/5.11' into dev 2018-03-21 08:59:26 +01:00
dbus Merge remote-tracking branch 'origin/5.9' into 5.11 2018-02-14 12:51:24 +01:00
gui Merge remote-tracking branch 'origin/5.11' into dev 2018-03-21 08:59:26 +01:00
guiapplauncher Fix path to examples part of tst_GuiAppLauncher 2015-02-13 07:28:15 +00:00
installed_cmake Add a unit test for testing Qt in its install location. 2013-07-02 23:08:54 +02:00
network QNetworkReply: fix isFinished() for disabled replies 2018-03-17 08:38:29 +00:00
opengl Remove tst_QGLThreads::textureUploadInThread 2018-03-02 07:20:32 +00:00
other Merge remote-tracking branch 'origin/5.11' into dev 2018-03-21 08:59:26 +01:00
printsupport Fix tst_QAbstractPrintDialog::setMinMax 2018-03-19 10:21:14 +00:00
shared Remove workaround for potentially unavailable pasteboard in macOS 2017-03-07 01:04:46 +00:00
sql MySQL: Fix tests 2018-03-17 23:14:34 +00:00
testlib Merge remote-tracking branch 'origin/5.11' into dev 2018-03-18 01:00:11 +01:00
tools uic: Add the include for QIcon conditionally 2018-03-06 06:49:00 +00:00
widgets Allow adaptive decimal stepping for QSpinBox and QDoubleSpinBox 2018-03-22 21:37:45 +00:00
xml Don't indefinitely wait for data if it was able to read some data 2018-01-24 05:54:31 +00:00
auto.pro tests/auto/auto.pro: Use correct null device for DBUS check 2017-12-01 09:53:07 +00:00
network-settings.h Merge remote-tracking branch 'origin/5.6' into 5.7 2016-05-06 15:36:44 +02:00