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. How can i set QLineEdit as current widget?
Forum Updated to NodeBB v4.3 + New Features

How can i set QLineEdit as current widget?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 4.9k Views 1 Watching
  • 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
    Ruzik
    wrote on last edited by
    #1

    Hello!
    I have some QLineEdit, how can i set it as current widget to user can input text immediately after this.
    I try it:
    @lineEdit->setFocus();
    lineEdit->setCursorPosition(0);@
    But it does not worke.

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      What "does not work" about it? You'll need to provide more information because line 1 is exactly what you should do.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Sam
        wrote on last edited by
        #3

        May be you are setting some other values as well / changing focus. As per the above comment lineEdit->setFocus() does the work. You can create just a sample app and cross check.

        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