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. [Solved] Show/Hide sub-tab on QTabWidget
Forum Updated to NodeBB v4.3 + New Features

[Solved] Show/Hide sub-tab on QTabWidget

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 2.8k 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.
  • L Offline
    L Offline
    LeeMinh
    wrote on last edited by
    #1

    Assuming I have a QTabWidget that contains 5 sub-tabs. Now I want to show/hide a sub-tab in one of 5 sub-tabs by following code

    @ui->twListTabs->widget(0)->hide(); // Hide first sub-tab@

    But this didn't work for me. Do you have any solutions?

    Thanks!

    1 Reply Last reply
    0
    • B Offline
      B Offline
      butterface
      wrote on last edited by
      #2

      AFAIK you can only use

      @
      ui->twListTabs->removeTab(0);
      @

      1 Reply Last reply
      0
      • L Offline
        L Offline
        LeeMinh
        wrote on last edited by
        #3

        I tried to use removeTab() to hide tabs. So how can I restore that tab to show?

        1 Reply Last reply
        0
        • B Offline
          B Offline
          butterface
          wrote on last edited by
          #4

          How about addTab or insertTab?

          1 Reply Last reply
          0
          • L Offline
            L Offline
            LeeMinh
            wrote on last edited by
            #5

            Okay, I see. Thanks for your recommendation! :)

            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