Results 1 to 3 of 3

Thread: set cursor position in qlineedit with an inputmask

  1. #1
    Join Date
    Mar 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default set cursor position in qlineedit with an inputmask

    Hi,

    i have a qlineedit with an inputmask, now i want to set the cursor position via setCursorPos, but that doesn't work -.-

    Qt Code:
    1. qle.setInputMask("D9,99 EUR;0");
    2. qle.setCursorPosition(1);
    To copy to clipboard, switch view to plain text mode 

    i only call this part of code if the actual cursor position is 2, in the "validate" function of a subclassed qvalidator.

    hope someone could help ;-)

  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: set cursor position in qlineedit with an inputmask

    Validate allows you to manipulate the "pos" argument you receive to change the cursor position.
    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. #3
    Join Date
    Mar 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: set cursor position in qlineedit with an inputmask

    ouh .. that's right! well i'm not very familary with the c++ syntax ;-)

    thank you very much!!

Similar Threads

  1. Cursor Position in scene
    By rogerholmes in forum Newbie
    Replies: 2
    Last Post: 12th March 2010, 16:31
  2. Focus problem with QLineEdit and InputMask
    By ttvo in forum Qt Programming
    Replies: 2
    Last Post: 26th May 2009, 14:57
  3. Replies: 10
    Last Post: 12th February 2009, 08:23
  4. Replies: 6
    Last Post: 30th May 2007, 10:25
  5. Cursor scene position
    By xgoan in forum Qt Programming
    Replies: 1
    Last Post: 26th December 2006, 14:51

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.