Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QTabBar: Drop-down menu instead of left/right-cursors



  • Hi, this is something I wish the QTabBar could do:
    When there are too many tabs to display on the available space, the QTabBar displays little "left" and "right" cursors on the right side of the TabBar pane. This concept is terrible when it comes to handling a lot of tabs.

    I would like to have it display a little drop-down arrow instead, that opens a QMenu with a list of all the tabs to scroll through.
    Unfortunately, I have no idea where to start with this. The QMenu itself is not an issue, but these cursor arrows are inaccessible to me when I inherit from QTabBar. There is a style hint "QStyle::SH_TabBar_PreferNoArrows", but that only disables the arrows altogether, from what I understand (I'm not at all experienced in QStyle).

    Does anyone have an idea or experience with something similar and can guide me in a direction?


  • Lifetime Qt Champion

    Hi,

    Do you have in mind something like what QTabWidget::cornerWidget proposes ?


  • Lifetime Qt Champion

    Hi,

    Do you have in mind something like what QTabWidget::cornerWidget proposes ?



  • @SGaist Oh, wait. I have to check this real quick...

    So, this seems, in principle, the thing I was looking for. But I can't get it to show up, yet. That might be on my part though. I'll mark your post as the answer, thank you very much.


Log in to reply