Results 1 to 3 of 3

Thread: InputMask Problem

  1. #1
    Join Date
    Oct 2012
    Posts
    7
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded PyQt3 PyQt4
    Platforms
    MacOS X Unix/X11 Windows

    Default InputMask Problem

    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

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,734
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: InputMask Problem

    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:
    Qt Code:
    1. l->setInputMask("\\0\\x>HH");
    2.  
    3. // If you want to start with a value ready to type over
    4. l->setText("0x00");
    5. l->setCursorPosition(2);
    To copy to clipboard, switch view to plain text mode 

  3. The following user says thank you to ChrisW67 for this useful post:

    ehntun (23rd October 2012)

  4. #3
    Join Date
    Oct 2012
    Posts
    7
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded PyQt3 PyQt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: InputMask Problem

    Thanks for the reply Sir Chris.

    I have already fixed this problem.

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

Similar Threads

  1. QLineEdit inputMask and validator
    By vhptt in forum Newbie
    Replies: 3
    Last Post: 1st September 2012, 02:36
  2. set cursor position in qlineedit with an inputmask
    By guitar1 in forum Qt Programming
    Replies: 2
    Last Post: 11th March 2011, 17:13
  3. Replies: 2
    Last Post: 25th November 2010, 06:00
  4. Focus problem with QLineEdit and InputMask
    By ttvo in forum Qt Programming
    Replies: 2
    Last Post: 26th May 2009, 13:57
  5. Help on inputMask
    By vieraci in forum Newbie
    Replies: 6
    Last Post: 26th July 2007, 14:43

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.