Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.7.0, 5.8.0 Alpha
-
Desktop Linux
-
25a3f25ce98c0a88582e97cfcdede970e7cc4a6d
Description
- run this code
import QtQuick 2.7 import QtQuick.Controls 2.0 import QtQuick.Layouts 1.0 ApplicationWindow { visible: true width: 640 height: 480 title: qsTr("Spinbox Test") ColumnLayout{ Button { id:but1 text: "Button 1" } SpinBox { focus: true from: 10 to: 1000 value: 100 editable : false KeyNavigation.backtab: but1 KeyNavigation.tab: but2 KeyNavigation.left: but1 KeyNavigation.right: but2 textFromValue : function(value, locale) { console.log("textFromValue called") return Number(value).toLocaleString(locale, 'f', 0); } valueFromText : function(text, locale) { console.log("valueFromText called") return Number.fromLocaleString(locale, text); } } Button { id:but2 text: "Button 2" } } }
- change the focus with tab
Current Result : The logs show, that valueFromText was called.
Expected Result : The logs doesn't show any valueFromText called.
The problem is if there are custom values like 00:00:00 for time and valueFromText is not implemented changing the tab sets it to 0, because the default implementation can not evaluate it.
Attachments
For Gerrit Dashboard: QTBUG-56215 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
172142,2 | SpinBox: don't call valueFromText when non-editable | 5.7 | qt/qtquickcontrols2 | Status: MERGED | +2 | 0 |