align icon on a tab (QTabWidget) & tab widths
Defaut is left aligned. Cannot change this through style sheets – I want it center aligned. Is there any sample code for this?
Can each (individual) tab size be changed (width)?
I don’t have any text. Only icons which are definately left aligned (Qt4.6). I added the icons in QtCreator UI and in code, same thing. In style sheets there are no alignments.
Width: Individial tab (with an icon in it). If I set the width of the icon, every tab width changes to the same value. For instance: If there are 5 tabs – each 20px wide. If width of any tab is changed, all tabs reset to the same width.
To demonstrate I’ve created a new project with QTabWidget and one icon (no style sheets or aditional code)
If I understand correctly you are saying I should subclass QTabWidget so I have access to the tabBar, then create a custom widget (ie QLabel static casted to button) and add it through “setTabButton”?
Either way I’m quite new at Qt – could you help me out with a sample code maybe? I’d appriciate it.