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?

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 395 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.
  • J Offline
    J Offline
    jdent
    wrote on 18 Mar 2024, 00:17 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 18 Mar 2024, 00:27
    0
    • J jdent
      18 Mar 2024, 00:17

      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 18 Mar 2024, 00:27 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 18 Mar 2024, 01:12
      2
      • M mpergand
        18 Mar 2024, 00:27

        @jdent

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

        J Offline
        J Offline
        jdent
        wrote on 18 Mar 2024, 01:12 last edited by
        #3

        @mpergand is there no equivalent in Qt Designer?

        M 1 Reply Last reply 18 Mar 2024, 01:40
        0
        • J jdent
          18 Mar 2024, 01:12

          @mpergand is there no equivalent in Qt Designer?

          M Offline
          M Offline
          mpergand
          wrote on 18 Mar 2024, 01:40 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

          2/4

          18 Mar 2024, 00:27

          • Login

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