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. Styling a QTabWidget to have the Tab-button on left side and horizontal text
Forum Update on Monday, May 27th 2025

Styling a QTabWidget to have the Tab-button on left side and horizontal text

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 3.9k 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.
  • RobinQTR Offline
    RobinQTR Offline
    RobinQT
    wrote on last edited by
    #1

    Hello!

    I am trying to figure out how make my QTabWidget look like this:

    alt text

    P.S. I dont use Python but C++.

    I followed the example found in this code: https://forum.qt.io/topic/86186/horizontal-text-in-qtabwidget/2

    But as you can see my result below is a bit different. First of all the tab text is not known. It does not matter if I change its color:

    ui->setupUi(this);
    ui->tabWidget->tabBar()->setStyle(new CustomTabStyle);
    ui->tabWidget->tabBar()->setTabTextColor(0, Qt::red);
    

    alt text

    Also it seems for some reason I canot not change the width. I also wishes to make the content inside the tabs horizontal.

    Thanks for guidance!

    1 Reply Last reply
    1
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Did you use the example as is ?
      What version of Qt are you using ?
      On what version of Windows ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • RobinQTR Offline
        RobinQTR Offline
        RobinQT
        wrote on last edited by
        #3

        Hi @SGaist ! Yes I used the example at it is. Here is my information:

        Qt 5.11.2 (i386-little_endian-ilp32 shared (dynamic) release build; by MSVC 2015) on "windows" 
        OS: Windows 10 (10.0) [winnt version 10.0.17134]
        

        Thank you.

        mrjjM 1 Reply Last reply
        0
        • RobinQTR RobinQT

          Hi @SGaist ! Yes I used the example at it is. Here is my information:

          Qt 5.11.2 (i386-little_endian-ilp32 shared (dynamic) release build; by MSVC 2015) on "windows" 
          OS: Windows 10 (10.0) [winnt version 10.0.17134]
          

          Thank you.

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by mrjj
          #4

          @RobinQT
          Hi
          Its a little bit surprising as clean project with the Delegate gives me
          alt text

          Could you try test project ?
          https://www.dropbox.com/s/llv3hpufux5owyh/VertTab.zip?dl=0
          and see if that just works or have issues.

          1 Reply Last reply
          3
          • RobinQTR Offline
            RobinQTR Offline
            RobinQT
            wrote on last edited by
            #5

            That works great! Thank you. This topic can be set as solved.

            1 Reply Last reply
            1

            • Login

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