how to select the text on double click in qml spin box
Unsolved
General and Desktop
-
I have a QML spin box which is editable and on double click it has to select the text, in the latest module of qt5.7 they have removed select by mouse property how can i do this?
THis is my QML code.
SpinBox { id: spinbox from: 0 value: 0 to: 358 * 10000 editable: true stepSize: 2.8125 * 10000 anchors.centerIn: parent property int decimals: 4 property real realValue: value / 10000 validator: DoubleValidator { bottom: Math.min(spinbox.from, spinbox.to) top: Math.max(spinbox.from, spinbox.to) } textFromValue: function(value, locale) { return Number(value / 10000).toLocaleString(locale, 'f', spinbox.decimals) } valueFromText: function(text, locale) { return Number.fromLocaleString(locale, text) * 10000 } }
-
@vinaygopal you could customise your Spinbox and set your own TextInput, that one still has the selectByMouse, even if 5.15.8
https://doc.qt.io/qt-5/qtquickcontrols2-customize.html#customizing-spinbox
https://doc.qt.io/qt-5/qml-qtquick-textinput.html#selectByMouse-prop