PDA

View Full Version : InputMask Problem



ehntun
22nd October 2012, 08:13
Hi!

I have here problem about the InputMask.

I am using a LineEdit and edited its properties in designer:
InputMask "\0\x>HH;0"

When i run the application, it displays:

"0x00"

It's working but when i use to debug the application and use the "text()" function and pass it to another qstring. It only passes "0x" not "0x00". I need to pass the "0x00" to another Qstring, not the "0x".

Can someone help me about this. Thanks in advance

ChrisW67
22nd October 2012, 22:58
With the ";0" You have told Qt that the character '0' is a blank and should be removed from the string... so it does.
Try:


l->setInputMask("\\0\\x>HH");

// If you want to start with a value ready to type over
l->setText("0x00");
l->setCursorPosition(2);

ehntun
23rd October 2012, 03:51
Thanks for the reply Sir Chris.

I have already fixed this problem.

I used "displayText()" instead of "text()".