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. Tab order
Qt 6.11 is out! See what's new in the release blog

Tab order

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 4 Posters 1.1k 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
    JacobNovitsky
    wrote on last edited by JacobNovitsky
    #1

    Open target ui in Qt Designer
    Edit / Edit Tab Order
    works for me
    There are lots of useful settings as well

    But how to adjust it using Qt Libs?
    Tried manipulate already created lineEdits, but could not

    it does the trick but it tabs with freshly created lineEdits

    Obj* obj =new Obj);

    ```
    obj->setWindowFlag(Qt::WindowStaysOnTopHint);
    obj->setGeometry(1393, 437, 500, 200); // Adjust the geometry as needed
    obj->setWindowTitle("obj");
    
    Create line edits
    QLineEdit *lineEdit2 = new QLineEdit(obj);
    QLineEdit *lineEdit3 = new QLineEdit(obj);
    QLineEdit *lineEdit4 = new QLineEdit(obj);
    QLineEdit *lineEdit5 = new QLineEdit(obj);
    QLineEdit *lineEdit2Again = new QLineEdit(obj)
    
    
    
    // Add widgets to the layout
    QVBoxLayout *layout = new QVBoxLayout(obj);
    layout->addWidget(lineEdit2);
    layout->addWidget(lineEdit3);
    layout->addWidget(lineEdit4);
    layout->addWidget(lineEdit5);
    layout->addWidget(lineEdit2Again);
    
    J JonBJ C 3 Replies Last reply
    0
    • J JacobNovitsky

      Open target ui in Qt Designer
      Edit / Edit Tab Order
      works for me
      There are lots of useful settings as well

      But how to adjust it using Qt Libs?
      Tried manipulate already created lineEdits, but could not

      it does the trick but it tabs with freshly created lineEdits

      Obj* obj =new Obj);

      ```
      obj->setWindowFlag(Qt::WindowStaysOnTopHint);
      obj->setGeometry(1393, 437, 500, 200); // Adjust the geometry as needed
      obj->setWindowTitle("obj");
      
      Create line edits
      QLineEdit *lineEdit2 = new QLineEdit(obj);
      QLineEdit *lineEdit3 = new QLineEdit(obj);
      QLineEdit *lineEdit4 = new QLineEdit(obj);
      QLineEdit *lineEdit5 = new QLineEdit(obj);
      QLineEdit *lineEdit2Again = new QLineEdit(obj)
      
      
      
      // Add widgets to the layout
      QVBoxLayout *layout = new QVBoxLayout(obj);
      layout->addWidget(lineEdit2);
      layout->addWidget(lineEdit3);
      layout->addWidget(lineEdit4);
      layout->addWidget(lineEdit5);
      layout->addWidget(lineEdit2Again);
      
      J Offline
      J Offline
      JacobNovitsky
      wrote on last edited by
      #2

      @JacobNovitsky
      is it possible to move between buttons and lineEdit using arrows?

      Axel SpoerlA 1 Reply Last reply
      0
      • J JacobNovitsky

        Open target ui in Qt Designer
        Edit / Edit Tab Order
        works for me
        There are lots of useful settings as well

        But how to adjust it using Qt Libs?
        Tried manipulate already created lineEdits, but could not

        it does the trick but it tabs with freshly created lineEdits

        Obj* obj =new Obj);

        ```
        obj->setWindowFlag(Qt::WindowStaysOnTopHint);
        obj->setGeometry(1393, 437, 500, 200); // Adjust the geometry as needed
        obj->setWindowTitle("obj");
        
        Create line edits
        QLineEdit *lineEdit2 = new QLineEdit(obj);
        QLineEdit *lineEdit3 = new QLineEdit(obj);
        QLineEdit *lineEdit4 = new QLineEdit(obj);
        QLineEdit *lineEdit5 = new QLineEdit(obj);
        QLineEdit *lineEdit2Again = new QLineEdit(obj)
        
        
        
        // Add widgets to the layout
        QVBoxLayout *layout = new QVBoxLayout(obj);
        layout->addWidget(lineEdit2);
        layout->addWidget(lineEdit3);
        layout->addWidget(lineEdit4);
        layout->addWidget(lineEdit5);
        layout->addWidget(lineEdit2Again);
        
        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by
        #3

        @JacobNovitsky
        Not sure what your question about tabbing is, you can do whatever whether you do it in Designer or in code.

        Don't forget: the only thing saved from Designer is the .ui file. So anything/everything you do there must be in that file. And then you run uic to read that and produce file named ui_....h. (This is put in the build output directory, not the source directory. If you are Python it's a .py file.) And these are included/imported into your code file, you can examine them in editor and see what code it produces for your .ui settings. That can be really useful for understanding how to do things in code which you did in Designer. The tab stuff would be in this.

        I don't know about your arrow keys. You would normally use Tab or Shift+Tab. In any case, the interface for moving around should follow the desktop window manager's way of doing things (which Qt will do), rather than inventing your own non-standard way, which would just confuse users.

        1 Reply Last reply
        0
        • J JacobNovitsky

          @JacobNovitsky
          is it possible to move between buttons and lineEdit using arrows?

          Axel SpoerlA Offline
          Axel SpoerlA Offline
          Axel Spoerl
          Moderators
          wrote on last edited by
          #4

          @JacobNovitsky said in Tab order:

          is it possible to move between buttons and lineEdit using arrows?

          In the case at hand:
          Arrows/No.
          Tabs/Yes.

          Arrows will navigate between widgets as long as they don't have input focus. Once the cursor is stuck in a line edit, only tab will move it. You can subclass QLineEditto implement arrow based focus changes.

          Software Engineer
          The Qt Company, Oslo

          1 Reply Last reply
          3
          • J JacobNovitsky

            Open target ui in Qt Designer
            Edit / Edit Tab Order
            works for me
            There are lots of useful settings as well

            But how to adjust it using Qt Libs?
            Tried manipulate already created lineEdits, but could not

            it does the trick but it tabs with freshly created lineEdits

            Obj* obj =new Obj);

            ```
            obj->setWindowFlag(Qt::WindowStaysOnTopHint);
            obj->setGeometry(1393, 437, 500, 200); // Adjust the geometry as needed
            obj->setWindowTitle("obj");
            
            Create line edits
            QLineEdit *lineEdit2 = new QLineEdit(obj);
            QLineEdit *lineEdit3 = new QLineEdit(obj);
            QLineEdit *lineEdit4 = new QLineEdit(obj);
            QLineEdit *lineEdit5 = new QLineEdit(obj);
            QLineEdit *lineEdit2Again = new QLineEdit(obj)
            
            
            
            // Add widgets to the layout
            QVBoxLayout *layout = new QVBoxLayout(obj);
            layout->addWidget(lineEdit2);
            layout->addWidget(lineEdit3);
            layout->addWidget(lineEdit4);
            layout->addWidget(lineEdit5);
            layout->addWidget(lineEdit2Again);
            
            C Offline
            C Offline
            ChrisW67
            wrote on last edited by
            #5

            @JacobNovitsky

            But how to adjust it using Qt Libs?

            Either version of QWidget::setTabOrder()

            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