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]Hide a tab widget from QTabWidget
Forum Updated to NodeBB v4.3 + New Features

[Solved]Hide a tab widget from QTabWidget

Scheduled Pinned Locked Moved General and Desktop
6 Posts 1 Posters 14.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.
  • S Offline
    S Offline
    Sorin
    wrote on last edited by
    #1

    I'm trying to hide a tab bar from QTabWidget :

    @
    QTabWidget* tabWidget = new QTabWidget;
    QWidget* hiddenTab = new QWidget;
    tabWidget->addTab( hiddenTab, "Hidden Tab" );
    hiddenTab->hide();
    tabWidget->addTab( new QWidget, "Start" );
    @

    but this solution doesn't work for me, I need that because I want my app to look like :

    "http://img690.imageshack.us/img690/2327/testhz.jpg":http://img690.imageshack.us/img690/2327/testhz.jpg

    How to do that? Thanks in advance !!!

    [edit: link added / Denis Kormalev]
    [edit: fixed @ tag / chetankjain]

    There are only 10 types of people in the world: Those who understand binary, and those who don't

    1 Reply Last reply
    0
    • ? This user is from outside of this forum
      ? This user is from outside of this forum
      Guest
      wrote on last edited by
      #2

      do you plan to show the hiddenTab later in your program? or is it just to provide spacing on the left?

      if its just to provide spacing to the left, you can set a stylesheet to it as follows:

      @
      QTabWidget::tab-bar {
      left: 50px; /* move to the right by 50px */
      }
      @

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Sorin
        wrote on last edited by
        #3

        I'm not going to use or show the hiddenTab, it's just about spacing

        There are only 10 types of people in the world: Those who understand binary, and those who don't

        1 Reply Last reply
        0
        • ? This user is from outside of this forum
          ? This user is from outside of this forum
          Guest
          wrote on last edited by
          #4

          then use the stylesheet as shown, it looks exactly like how you want it. you don't have to create a dummy tab which you won't use anyways

          1 Reply Last reply
          0
          • S Offline
            S Offline
            Sorin
            wrote on last edited by
            #5

            Yes, It's working, thanks for help :)

            There are only 10 types of people in the world: Those who understand binary, and those who don't

            1 Reply Last reply
            0
            • ? This user is from outside of this forum
              ? This user is from outside of this forum
              Guest
              wrote on last edited by
              #6

              cool :)

              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