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. Select an element on a QPushButton click

Select an element on a QPushButton click

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 232 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.
  • S Offline
    S Offline
    Sucharek
    wrote on last edited by
    #1

    Hi, I want to select a QLineEdit when I press a button.
    Is there a way to do this?

    JonBJ 1 Reply Last reply
    0
    • S Sucharek

      Hi, I want to select a QLineEdit when I press a button.
      Is there a way to do this?

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @Sucharek
      Untested, but isn't all you want to call QWidget::setFocus() on the desired QLineEdit from the slot for the QPushButton click? I think "selecting" just means setting the focus to that widget.

      S 1 Reply Last reply
      2
      • JonBJ JonB

        @Sucharek
        Untested, but isn't all you want to call QWidget::setFocus() on the desired QLineEdit from the slot for the QPushButton click? I think "selecting" just means setting the focus to that widget.

        S Offline
        S Offline
        Sucharek
        wrote on last edited by
        #3

        Hi @JonB, yes, that worked perfectly.
        Thanks for solving this :D

        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