Link to home
Start Free TrialLog in
Avatar of tmitch68
tmitch68

asked on

In a QT QLineEdit class - is it possible to have more than one input mask?

Hello,

I have a QT project which uses a QLineEdit class.

What I want to do, spedifically, is to have the user be able only to input a time value (ie:  "12:34:26") OR a singel "*" character to indicate a wildcard.

I can restrict the user to either by using the the setInputMask function.  However, I cannot do both at the same time.

Thanks in Advance,
Tim
Avatar of irfan_omair
irfan_omair
Flag of United States of America image

Hi
Did you try using QTimeEdit class, does this solve your problem? If not let me know I will work further to help you.
Avatar of tmitch68
tmitch68

ASKER

Thanks - that actually does help a lot to use a QTimeEdit class rather than a QLineEdit class with an input mask.  The formatting is much better/easier.

Is there any way to allow the user to type in a single "*" value, though - to signify a wildcard.

If not, I'll still give you credt.

Thanks,
Tim
ASKER CERTIFIED SOLUTION
Avatar of irfan_omair
irfan_omair
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Actually - I just found something that DOES allow the user to put in either a time value or a '*' value - just call the setSpecialValue("*") function on the QTimeEdit class when you create it - it then allows the user to type in whatever they've passed in as a parameter (a single '*' char in this case).

Thanks - I would not have figured this out if you had not suggested going with a QTimeEdit class.
Thats great I m glad you got it working.
I was looking directly in the code and I found it needs hell of the things to do.