Align icon on a tab (QTabWidget) & tab widths
-
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.
edit:
To demonstrate I've created a new project with QTabWidget and one icon (no style sheets or aditional code)
"http://i38.tinypic.com/zj8pll.jpg":http://i38.tinypic.com/zj8pll.jpg
-
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.
-
I put up something quickly "here":http://developer.qt.nokia.com/wiki/CustomTabBar, with just one tab button, but something you can extend upon.. is this what you wanted?