Go to file
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
bin syncqt: remove 'descend' parameter from findFiles() 2018-02-28 18:15:56 +00:00
config.tests Merge remote-tracking branch 'origin/5.9' into 5.11 2018-02-14 12:51:24 +01:00
dist Merge remote-tracking branch 'origin/5.9' into 5.11 2018-02-14 12:51:24 +01:00
doc Doc: Complete Dynamic Layouts Example 2018-03-14 12:44:20 +00:00
examples Update rasterwindow example to not render in resizeEvent 2018-03-20 16:00:31 +00:00
lib
mkspecs Merge remote-tracking branch 'origin/5.11' into dev 2018-03-21 08:59:26 +01:00
qmake XCode: Fix the output paths for extra compilers with fileFixify() 2018-03-17 23:14:23 +00:00
src Allow adaptive decimal stepping for QSpinBox and QDoubleSpinBox 2018-03-22 21:37:45 +00:00
tests Allow adaptive decimal stepping for QSpinBox and QDoubleSpinBox 2018-03-22 21:37:45 +00:00
util Add a note to the CLDR-munging scripts about updating the attribution 2018-02-17 22:22:33 +00:00
.gitattributes
.gitignore gitignore: don't ignore Info.plist templates for libraries 2017-11-23 07:07:48 +00:00
.qmake.conf Bump version 2018-02-20 19:53:08 +01:00
.tag
config_help.txt xcb: Use XCB instead of Xlib for XInput 2018-03-22 20:51:09 +00:00
configure Remove references to obsolete platforms 2017-11-05 06:33:53 +00:00
configure.bat configure: Prefer cl.exe over clang-cl.exe 2018-01-04 21:22:42 +00:00
configure.json Merge remote-tracking branch 'origin/5.11' into dev 2018-03-21 08:59:26 +01:00
configure.pri configure: introduce 'subarch' term to expression evaluator 2018-02-22 21:39:36 +00:00
header.BSD
header.COMM
header.FDL
header.GPL
header.GPL-EXCEPT
header.LGPL
header.LGPL3
header.LGPL3-COMM
header.LGPL-NOGPL2
header.LGPL-ONLY
INSTALL
LGPL_EXCEPTION.txt
LICENSE.FDL
LICENSE.GPL2
LICENSE.GPL3
LICENSE.GPL3-EXCEPT
LICENSE.GPLv3
LICENSE.LGPL3
LICENSE.LGPLv3
LICENSE.LGPLv21
LICENSE.PREVIEW.COMMERCIAL
qtbase.pro
sync.profile Add support for Windows UI Automation 2017-11-14 23:31:04 +00:00