Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] Problem with the setfocus() method of QLineEdit object

[SOLVED] Problem with the setfocus() method of QLineEdit object

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rishardcarranza
    wrote on last edited by
    #1

    I have a problem with the setfocus() method of QLineEdit object. I send the focus to QLineEdit object after save data of the form, the focus come to the object, but this focus come to end of object... That is because I have a input mask in the QLineEdit object, but in other QLineEdit object that not is with setinputmask() method the focus is correct... attach image...

    "Check screenshot":https://www.dropbox.com/s/nx8vahqtr9w218k/problem_with_setfocus.png

    Thanks ... Regards

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Hi,

      Do you mean the cursor position is at the end ?
      If that's the case then try setting the "cursorPosition":http://qt-project.org/doc/qt-5/qlineedit.html#cursorPosition-prop to 0.

      157

      1 Reply Last reply
      0
      • R Offline
        R Offline
        rishardcarranza
        wrote on last edited by
        #3

        Hi "p3c0", it's the solution... is perfect !!! very thank's ... :-)

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved