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. How can I control the focus of tabs on a tab widget through code?
Forum Updated to NodeBB v4.3 + New Features

How can I control the focus of tabs on a tab widget through code?

Scheduled Pinned Locked Moved Solved General and Desktop
9 Posts 3 Posters 1.9k 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.
  • A Offline
    A Offline
    Alexandre Camelo
    wrote on 5 Dec 2019, 00:20 last edited by
    #1

    How can I control the focus of tabs on a tab widget through code? I mean, so that the focus of the tabs follows the tabulation sequence of the fields. I've tried everything and can't.

    P J 2 Replies Last reply 5 Dec 2019, 00:49
    0
    • A Alexandre Camelo
      5 Dec 2019, 00:20

      How can I control the focus of tabs on a tab widget through code? I mean, so that the focus of the tabs follows the tabulation sequence of the fields. I've tried everything and can't.

      P Offline
      P Offline
      Pablo J. Rogina
      wrote on 5 Dec 2019, 00:49 last edited by
      #2

      @Alexandre-Camelo said in How can I control the focus of tabs on a tab widget through code?:

      I've tried everything and can't.

      that's too generic... please show what you've tried

      Upvote the answer(s) that helped you solve the issue
      Use "Topic Tools" button to mark your post as Solved
      Add screenshots via postimage.org
      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

      A 1 Reply Last reply 5 Dec 2019, 13:58
      1
      • P Pablo J. Rogina
        5 Dec 2019, 00:49

        @Alexandre-Camelo said in How can I control the focus of tabs on a tab widget through code?:

        I've tried everything and can't.

        that's too generic... please show what you've tried

        A Offline
        A Offline
        Alexandre Camelo
        wrote on 5 Dec 2019, 13:58 last edited by
        #3

        @Pablo-J-Rogina said in How can I control the focus of tabs on a tab widget through code?:

        that's too generic... please show what you've tried

        Ok, Pablo.

        I will try to explain further:

        (detail: I am Brazilian and this text was translated by google translator. So forgive me if some passages get a little incomprehensible).
        .
        .
        Since my form has many fields, I split them into a four-tabbed widget and arranged the tab order of all these fields.

        But...

        For example, when I finish filling the last field of the first tab, the focus goes to the next field (which is on the second tab), but the second tab is not activated. That way, I need to click the second tab with my mouse to continue filling in the remaining fields.

        I already tried to use:
        ui-> tabwidget-> setFocus;
        ui-> tab-> setFocus;
         ui-> tabwidget-> setFocus;
        ui-> tabwidget-> activateWindow ();
        ui-> tabwidget-> activateWindow ();

        I tried to place these commands in the "returnPressed" slot of the last field of the first tab. Since I don't know if this is the correct slot, I also tried placing the commands on a Push Button. But none of the trial combinations worked.

        I hope I could be clear.

        Can you help me?

        Thank you!

        P 1 Reply Last reply 5 Dec 2019, 14:16
        0
        • A Alexandre Camelo
          5 Dec 2019, 00:20

          How can I control the focus of tabs on a tab widget through code? I mean, so that the focus of the tabs follows the tabulation sequence of the fields. I've tried everything and can't.

          J Offline
          J Offline
          J.Hilk
          Moderators
          wrote on 5 Dec 2019, 14:09 last edited by
          #4

          @Alexandre-Camelo what you're looking for is probably
          https://doc.qt.io/qt-5/qwidget.html#setTabOrder


          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          1 Reply Last reply
          0
          • A Alexandre Camelo
            5 Dec 2019, 13:58

            @Pablo-J-Rogina said in How can I control the focus of tabs on a tab widget through code?:

            that's too generic... please show what you've tried

            Ok, Pablo.

            I will try to explain further:

            (detail: I am Brazilian and this text was translated by google translator. So forgive me if some passages get a little incomprehensible).
            .
            .
            Since my form has many fields, I split them into a four-tabbed widget and arranged the tab order of all these fields.

            But...

            For example, when I finish filling the last field of the first tab, the focus goes to the next field (which is on the second tab), but the second tab is not activated. That way, I need to click the second tab with my mouse to continue filling in the remaining fields.

            I already tried to use:
            ui-> tabwidget-> setFocus;
            ui-> tab-> setFocus;
             ui-> tabwidget-> setFocus;
            ui-> tabwidget-> activateWindow ();
            ui-> tabwidget-> activateWindow ();

            I tried to place these commands in the "returnPressed" slot of the last field of the first tab. Since I don't know if this is the correct slot, I also tried placing the commands on a Push Button. But none of the trial combinations worked.

            I hope I could be clear.

            Can you help me?

            Thank you!

            P Offline
            P Offline
            Pablo J. Rogina
            wrote on 5 Dec 2019, 14:16 last edited by
            #5

            @Alexandre-Camelo it looks to me that you need to use QTabWidget::setCurrentIndex()

            Upvote the answer(s) that helped you solve the issue
            Use "Topic Tools" button to mark your post as Solved
            Add screenshots via postimage.org
            Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

            A 1 Reply Last reply 5 Dec 2019, 14:26
            2
            • P Pablo J. Rogina
              5 Dec 2019, 14:16

              @Alexandre-Camelo it looks to me that you need to use QTabWidget::setCurrentIndex()

              A Offline
              A Offline
              Alexandre Camelo
              wrote on 5 Dec 2019, 14:26 last edited by
              #6

              @Pablo-J-Rogina said in How can I control the focus of tabs on a tab widget through code?:

              it looks to me that you need to use

              WOOOOOOOOOOOOWWWWWW !!!!!

              GOT SURE !!!!!!!!!!

              VERY VERY VERY VERY THANK YOU, PABLOOOOOO !!!!!

              :-D :-D :-D :-D :-D :-D

              As I realize that you know QT well, I will send another horrible problem that has taken my time, too.

              I will send in the next post.

              Thank youuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu !!!!!

              P 1 Reply Last reply 5 Dec 2019, 14:32
              0
              • A Alexandre Camelo
                5 Dec 2019, 14:26

                @Pablo-J-Rogina said in How can I control the focus of tabs on a tab widget through code?:

                it looks to me that you need to use

                WOOOOOOOOOOOOWWWWWW !!!!!

                GOT SURE !!!!!!!!!!

                VERY VERY VERY VERY THANK YOU, PABLOOOOOO !!!!!

                :-D :-D :-D :-D :-D :-D

                As I realize that you know QT well, I will send another horrible problem that has taken my time, too.

                I will send in the next post.

                Thank youuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu !!!!!

                P Offline
                P Offline
                Pablo J. Rogina
                wrote on 5 Dec 2019, 14:32 last edited by
                #7

                @Alexandre-Camelo said in How can I control the focus of tabs on a tab widget through code?:

                I will send in the next post.

                Before rushing into that :-) please read the signature of my posts and proceed as stated there...

                Upvote the answer(s) that helped you solve the issue
                Use "Topic Tools" button to mark your post as Solved
                Add screenshots via postimage.org
                Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                A 1 Reply Last reply 5 Dec 2019, 14:43
                0
                • P Pablo J. Rogina
                  5 Dec 2019, 14:32

                  @Alexandre-Camelo said in How can I control the focus of tabs on a tab widget through code?:

                  I will send in the next post.

                  Before rushing into that :-) please read the signature of my posts and proceed as stated there...

                  A Offline
                  A Offline
                  Alexandre Camelo
                  wrote on 5 Dec 2019, 14:43 last edited by J.Hilk 12 May 2019, 14:48
                  #8

                  @Pablo-J-Rogina

                  Ok, Pablo.

                  I tagged the topic as SOLVED and posted the image on postimage.org.

                  Did I follow the instructions correctly?


                  .Hilk] Removed user E-Mail for security reasons

                  1 Reply Last reply
                  1
                  • J Offline
                    J Offline
                    J.Hilk
                    Moderators
                    wrote on 5 Dec 2019, 14:49 last edited by J.Hilk 12 May 2019, 15:21
                    #9

                    I took the liberty and removed your E-Mail address, don't post such a thing openly please.


                    Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                    Q: What's that?
                    A: It's blue light.
                    Q: What does it do?
                    A: It turns blue.

                    1 Reply Last reply
                    2

                    1/9

                    5 Dec 2019, 00:20

                    • Login

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