diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-10-24 21:04:43 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-10-25 13:03:27 +0000 |
commit | 459842c6d880c1a754829b258d4ca4d1a136cdb9 (patch) | |
tree | e4d218ea1df436a5a7791efbb28d9c8afd1a171e /src/quicktemplates2/qquickcontrol.cpp | |
parent | 90659c9bed2464d87602c3d25eed2db2c4004b9a (diff) |
Add QQuickSpinBox::displayText
Allows styles to create a simple binding to display the textual value
instead of calling the textFromValue() JS-function. Furthermore, this
allows us to do the text<->value conversion in C++ using QLocale by
default, unless custom textFromValue and/or valueFromText JS-functions
are provided.
Before:
running: qmlbench/benchmarks/auto/creation/quick.controls2/delegates_spinbox.qml
100 frames
100 frames
99 frames
Average: 99.6667 frames; using samples; MedianAll=100; StdDev=0.57735, CoV=0.00579281
After:
running: qmlbench/benchmarks/auto/creation/quick.controls2/delegates_spinbox.qml
152 frames
150 frames
151 frames
Average: 151 frames; using samples; MedianAll=151; StdDev=1, CoV=0.00662252
Change-Id: I66a5ebaf685d2c30613b58099724e6e7bbe00504
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickcontrol.cpp')
-rw-r--r-- | src/quicktemplates2/qquickcontrol.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quicktemplates2/qquickcontrol.cpp b/src/quicktemplates2/qquickcontrol.cpp index e72df944..e3b5c9ef 100644 --- a/src/quicktemplates2/qquickcontrol.cpp +++ b/src/quicktemplates2/qquickcontrol.cpp @@ -566,8 +566,8 @@ void QQuickControlPrivate::updateLocale(const QLocale &l, bool e) hasLocale = e; if (old != l) { bool wasMirrored = q->isMirrored(); - q->localeChange(l, old); locale = l; + q->localeChange(l, old); QQuickControlPrivate::updateLocaleRecur(q, l); emit q->localeChanged(); if (wasMirrored != q->isMirrored()) |