Time Edit field in QML
-
@mostefa Thanks it almost works but backspace is not working.
For Example : If i enter12:12:12
and try to clear the value usingbackspace
then it's not working. My expectation is that it should become00:00:00
. Is there any way to achieve this ?wrote on 16 Sept 2017, 09:41 last edited by@Praveen_2017 said in Time Edit field in QML:
@mostefa Thanks it almost works but backspace is not working.
For Example : If i enter12:12:12
and try to clear the value usingbackspace
then it's not working. My expectation is that it should become00:00:00
. Is there any way to achieve this ?What if you match backspace for each digits in your expressions?
You have to change your regExp on your validator to something like this:
validator: RegExpValidator { regExp: /^([0-1\s]?[0-9\s]|2[0-3\s]):([0-5\s][0-9\s]):([0-5\s][0-9\s])$ / }
-
@Praveen_2017 said in Time Edit field in QML:
@mostefa Thanks it almost works but backspace is not working.
For Example : If i enter12:12:12
and try to clear the value usingbackspace
then it's not working. My expectation is that it should become00:00:00
. Is there any way to achieve this ?What if you match backspace for each digits in your expressions?
You have to change your regExp on your validator to something like this:
validator: RegExpValidator { regExp: /^([0-1\s]?[0-9\s]|2[0-3\s]):([0-5\s][0-9\s]):([0-5\s][0-9\s])$ / }
wrote on 16 Sept 2017, 10:03 last edited byThis post is deleted! -
@Praveen_2017 said in Time Edit field in QML:
@mostefa Thanks it almost works but backspace is not working.
For Example : If i enter12:12:12
and try to clear the value usingbackspace
then it's not working. My expectation is that it should become00:00:00
. Is there any way to achieve this ?What if you match backspace for each digits in your expressions?
You have to change your regExp on your validator to something like this:
validator: RegExpValidator { regExp: /^([0-1\s]?[0-9\s]|2[0-3\s]):([0-5\s][0-9\s]):([0-5\s][0-9\s])$ / }
-
wrote on 19 Sept 2017, 13:35 last edited by
@LeLev I didn't get ... Can you please explain ?
-
wrote on 19 Sept 2017, 14:18 last edited by
Im not regExp pro but this is working
TextField{
id:textEditTD
text : "00:00:00"
inputMask: "99:99:99"
inputMethodHints: Qt.ImhDigitsOnly
validator: RegExpValidator { regExp: /^([0-1\s]?[0-9\s]|2[0-3\s]):([0-5\s][0-9\s]):([0-5\s][0-9\s])$ / }width:100 height:50 }
LA
-
Im not regExp pro but this is working
TextField{
id:textEditTD
text : "00:00:00"
inputMask: "99:99:99"
inputMethodHints: Qt.ImhDigitsOnly
validator: RegExpValidator { regExp: /^([0-1\s]?[0-9\s]|2[0-3\s]):([0-5\s][0-9\s]):([0-5\s][0-9\s])$ / }width:100 height:50 }
LA
-
@LeLev Maybe @pra7 meant "Go SOLVED"... which means marking a topic as solved so that others can see the original problem was solved in the thread. It's under "Topic Tools" menu for the one who has started the thread.
-
wrote on 19 Sept 2017, 14:29 last edited by
@LeLev That's why I directed the rest of my comment to pra7 :)
13/13