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. Cannot set current tab
Qt 6.11 is out! See what's new in the release blog

Cannot set current tab

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 306 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
    Anonymous_Banned275
    wrote on last edited by
    #1

    Am I missing something ?

    Is there a way to actually debug the code in real time to see why this does not work ?

    I have "cascaded tabs" , even trying to set both in sequence - expecting the #6 tab to be selected - does not work.

               ui->tabWidget->setCurrentIndex(3);
                 ui->tabWidget->setCurrentIndex(6);
    
    Christian EhrlicherC 1 Reply Last reply
    0
    • A Anonymous_Banned275

      Am I missing something ?

      Is there a way to actually debug the code in real time to see why this does not work ?

      I have "cascaded tabs" , even trying to set both in sequence - expecting the #6 tab to be selected - does not work.

                 ui->tabWidget->setCurrentIndex(3);
                   ui->tabWidget->setCurrentIndex(6);
      
      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @AnneRanch said in Cannot set current tab:

      I have "cascaded tabs"

      What does this mean? A QTabWidget in another QTabWidget? If so - are you accessing the correct widget? Check also QTabWidget::count() and QTabWidget::currentIndex().

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Anonymous_Banned275
        wrote on last edited by
        #3

        SOLVED
        user error - I was not waiting for time consuming process to finish.

        A 1 Reply Last reply
        0
        • A Anonymous_Banned275

          SOLVED
          user error - I was not waiting for time consuming process to finish.

          A Offline
          A Offline
          Anonymous_Banned275
          wrote on last edited by
          #4

          @AnneRanch

          ADDENDUM

          It looks as having "main tab" with "sub tabs" - what I called "cascade" tabs is THE PROBLEM.

          To get from "main tab" ( tab index 0) to "subtab " ( tab index 8 ) the following hack works.

          So it is a two step process:

                  ui->tabWidget_2->setCurrentIndex(3);                main tab  selection 
                  ui->tabWidget_4->setCurrentIndex(8);               sub tab      selection 
          
          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