Question

By default, the text is always on the right-side of the tab icon...
What should I do to move the text to the bottom of it ?
And is there an option to do icon/text alignment ??

(I'm designing the GUI base on Qt Creator Designer.
I'm trying with Qt stylesheet but I can't. I have not yet modify the code that generated by Qt Designer.)

Thank you very much!

Pas de solution correcte

Autres conseils

A tricky way:

Since we can set QToolButton to be icon above text, just create a group of QToolButtons, listed horizontally or vertically, each button needs to be checkable. Add them to a QButtonGroup.

Then hide the TabBar of QTabWidget(out of parent widget or under ToolButtons), place the TabWidget under the listed ToolButtons.

Finally, connect the QButtonGroup buttonClicked signal to the TabWidget's setCurrentIndex signal.

Notice, when you add a button to QButtonGroup, you will have to assign the ID from 0 manually.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top