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?

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.6k 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.
  • Alexandre CameloA Offline
    Alexandre CameloA Offline
    Alexandre Camelo
    wrote on 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.

    Pablo J. RoginaP J.HilkJ 2 Replies Last reply
    0
    • Alexandre CameloA Alexandre Camelo

      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.

      Pablo J. RoginaP Offline
      Pablo J. RoginaP Offline
      Pablo J. Rogina
      wrote on 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

      Alexandre CameloA 1 Reply Last reply
      1
      • Pablo J. RoginaP Pablo J. Rogina

        @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

        Alexandre CameloA Offline
        Alexandre CameloA Offline
        Alexandre Camelo
        wrote on 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!

        Pablo J. RoginaP 1 Reply Last reply
        0
        • Alexandre CameloA Alexandre Camelo

          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.HilkJ Offline
          J.HilkJ Offline
          J.Hilk
          Moderators
          wrote on 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
          • Alexandre CameloA Alexandre Camelo

            @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!

            Pablo J. RoginaP Offline
            Pablo J. RoginaP Offline
            Pablo J. Rogina
            wrote on 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

            Alexandre CameloA 1 Reply Last reply
            2
            • Pablo J. RoginaP Pablo J. Rogina

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

              Alexandre CameloA Offline
              Alexandre CameloA Offline
              Alexandre Camelo
              wrote on 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 !!!!!

              Pablo J. RoginaP 1 Reply Last reply
              0
              • Alexandre CameloA Alexandre Camelo

                @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 !!!!!

                Pablo J. RoginaP Offline
                Pablo J. RoginaP Offline
                Pablo J. Rogina
                wrote on 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

                Alexandre CameloA 1 Reply Last reply
                0
                • Pablo J. RoginaP Pablo J. Rogina

                  @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...

                  Alexandre CameloA Offline
                  Alexandre CameloA Offline
                  Alexandre Camelo
                  wrote on last edited by J.Hilk
                  #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.HilkJ Offline
                    J.HilkJ Offline
                    J.Hilk
                    Moderators
                    wrote on last edited by J.Hilk
                    #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

                    • Login

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