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. QMainWindow - always show QTabBar
Forum Update on Monday, May 27th 2025

QMainWindow - always show QTabBar

Scheduled Pinned Locked Moved Unsolved General and Desktop
qmainwindow
3 Posts 2 Posters 1.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.
  • K Offline
    K Offline
    KrabQT
    wrote on last edited by
    #1

    You can enable stacking QDockWidgets when set QMainWindow::AllowTabbedDocks flag.

    That QTabBar will appear only when there is two widgets stacked in that docking area.

    I need that QTabBar to be shown always, even if there is just one widget, because i want to implement that when you click on the tab, the appropriate widget will hide/show.

    It looks that it is not possible, right?

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

      Hi,

      Indeed it's not, unless you modify Qt. But before doing that. What is your use case ? It seems you are going against most GUI guidelines.

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

      K 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Indeed it's not, unless you modify Qt. But before doing that. What is your use case ? It seems you are going against most GUI guidelines.

        K Offline
        K Offline
        KrabQT
        wrote on last edited by
        #3

        @SGaist Hi. Currently the default QDockWidget title bar shows label and close and float buttons. When you have 2 QDockWidgets tabbed, than the QTabBar appears abowe the title bar (if set to show QTabBar on North). I don't like this behaviour when you have title bar with label and abowe that tab with same label. It looks weird. It is not needed to have 2 labels. I know i can have custom title bar widget, but that means i will need somehow to handle when the QTabBar is visible and when not (to show/hide title bar so there are not redundant informations like label).

        It could be best if i can hide the QTabBar, but still have that tabbify behaviour and some signal that is sended when QDockWidget is tabbed, so i can show everything in my custom title bar (like all tabs in that area, close/float buttons and other things i need).

        I will probably need to copy all the files from Qt and do it by myself (qmainwindow, qmainwindowlayout, qdockarealayout, qdockwidget), but this will take lot of times as i saw it is around 10k lines of code.

        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