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. QLineEdit selected when QDialog open
Forum Updated to NodeBB v4.3 + New Features

QLineEdit selected when QDialog open

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 1.6k 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.
  • S Offline
    S Offline
    samuelpdrouin
    wrote on last edited by
    #1

    I use Qt Designer to create a dialog for my application. The dialog consist in a few line edit, label and button.

    When the dialog open the 4th line edit is automatically selected. However I want the 1st line edit to be selected. How can I achieve that?

    I thought of a slot that setFocus when the dialog open signal is triggered or a QLineEdit property but I haven't found the information in the ressource database.

    Thank you

    1 Reply Last reply
    0
    • R Offline
      R Offline
      Rondog
      wrote on last edited by
      #2

      Setting the tab order in the dialog so that the desired QLineEdit is the first item set should work.

      This also allows you to define the order so that when you tab through the different controls they progress in a logical order.

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

        I already did it. I still have the same problem

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

          Still, that is how it works. If you still get the same issue, then I guess your changes were not applied correctly.

          Note that you can of course force the focus.

          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