Unsolved Validators in QML
-
I used conditional operator like this:
validator: val===0?RegExpValidator:DoubleValidator
But it is showing an error.
-
show me what are these RegExpValidator:DoubleValidator ?
-
@Shubham-Gupta
you'll have to read up on the Conditional OperatorIt reqiuers 2 expression after the ? your examply only has 1forget everything, it's to damn early in the morning.
-
What?
I din get your words. -
Please paste your code here. You need to use ternary operator. You may be doing in some mistake. Hence requested paste the code.
-
validator: val===0?DoubleValidator{ top: top_value bottom:bottom_value} : RegExpValidator{regExp: ""}
I am trying to make regular exp for accepting time(mm:ss).
But its showing an error. -
what is the error ?
-
Hi dheerendra
In qml there are three validators- IntValidator
- DoubleValidator
- RegExpValidator
If i want to store text like 2:30 (mm:ss). So which validator will work.
If RegExpValidor is used, so what will be the regular expression for this syntax (mm:ss). -
Use RegExpValidator. Did you check the google for regular expression for mm:ss ? It should help.
-
solved.
thanks -
Good. Move the case to "Solved" state. It helps others as well.