tags:

views:

32

answers:

2

When the menu of a QTabWidget grows beyond its width, the default behaviour is to turn the tab menu into a horizontaly scrollable list. What I'd prefer is to wrap the menu round so you now have two rows of tabs. This style is used on some Windows dialogs. I can't find any way to do this though.

Is anyone aware of a trick or option to allow this kind of layout?

+1  A: 

This option is currently not available for QTabWidget. Perhaps you could simulate this behavior using a few QTabBars?

There is an outstanding request for this on Qt's bug tracker but no progress on it yet. Perhaps somebody knows of another component/solution.

Arnold Spence
It would be quite a bit of work. I'd need to re-construct the tab bars each time to make sure the currently selected tab is moved to the bottom-most bar (if it's not already there).
Simon Hibbs
Yes, it would be a bit of work, and probably wouldn't look quite right either unfortunately. I always found multiple tab bars to be a bit disorienting. Would a side-bar list view controlling a QStackedWidget be an alternative?
Arnold Spence
Not realy, but thanks for your time.
Simon Hibbs
Welcome. If I ever spot anything, I'll post it back here.
Arnold Spence
A: 

Flow layout does what you need, but then you will have to also make your own "tab widget" http://doc.trolltech.com/4.7/layouts-flowlayout.html

Kamil Klimek