Results 1 to 3 of 3

Thread: Focus problem with QLineEdit and InputMask

  1. #1
    Join Date
    Jan 2009
    Posts
    47
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Focus problem with QLineEdit and InputMask

    I'm using Qt 4.4.3. Ihave a QLineEidt and want to setup a validator using InputMask to "000" or "00D" or "999". When the QLineEdit widget gets the focus, it will only select the first character and not everything (e.g. selectAll())

    if the input field now contains "181" and you tab into it, it will select "1" and leave "81" unselected. If I remove any InputMask specifier, it will automatically select the whole content on inputfocus. Please help
    TNG

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Focus problem with QLineEdit and InputMask

    But what is the problem? You want everything to be selected? I think this is natural that with an input mask only one character at a time is selected. Do you need the input mask? For an input of "000" you don't need an input mask, a validator will suffice. Input masks are useful if you want some additional characters in the input that you don't want to type in manually (i.e. spaces in bank account numbers or phone numbers, dots in IP addresses, etc.).
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


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

    ttvo (26th May 2009)

  4. #3
    Join Date
    Jan 2009
    Posts
    47
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Focus problem with QLineEdit and InputMask

    Yes, I want everything to be selected. QIntValidator is what I need. Thanks.
    TNG

Similar Threads

  1. Replies: 10
    Last Post: 12th February 2009, 07:23

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.