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. In a dialog, how can i determine which widget I want to make the active one upon load?
Forum Update on Tuesday, May 27th 2025

In a dialog, how can i determine which widget I want to make the active one upon load?

Scheduled Pinned Locked Moved Unsolved General and Desktop
dialogfocus issue
4 Posts 2 Posters 401 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.
  • J Offline
    J Offline
    jdent
    wrote on last edited by
    #1

    I have a dialog box with 4 line edit widgets and I want the first one to have the focus everytime I display the dialog.
    What do I need to set?
    I thought putting the tab order would do it but it doesn't.

    M 1 Reply Last reply
    0
    • J jdent

      I have a dialog box with 4 line edit widgets and I want the first one to have the focus everytime I display the dialog.
      What do I need to set?
      I thought putting the tab order would do it but it doesn't.

      M Offline
      M Offline
      mpergand
      wrote on last edited by
      #2

      @jdent

      use setFocus() for this line edit.
      https://doc.qt.io/qt-6/qwidget.html#setFocus

      J 1 Reply Last reply
      2
      • M mpergand

        @jdent

        use setFocus() for this line edit.
        https://doc.qt.io/qt-6/qwidget.html#setFocus

        J Offline
        J Offline
        jdent
        wrote on last edited by
        #3

        @mpergand is there no equivalent in Qt Designer?

        M 1 Reply Last reply
        0
        • J jdent

          @mpergand is there no equivalent in Qt Designer?

          M Offline
          M Offline
          mpergand
          wrote on last edited by
          #4

          @jdent said in In a dialog, how can i determine which widget I want to make the active one upon load?:

          is there no equivalent in Qt Designer?

          See https://doc.qt.io/qt-6/designer-tab-order.html

          1 Reply Last reply
          2

          • Login

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