Hi all!
I'd like to customize QToolBox. By default, the tab header text is aligned to left. It is necessary to align it to center horizontally. I can't find a way to do it. Is it possible?
Hi all!
I'd like to customize QToolBox. By default, the tab header text is aligned to left. It is necessary to align it to center horizontally. I can't find a way to do it. Is it possible?
I guess using style sheets is the easiest way.
http://doc.trolltech.com/4.5/stylesheet.html
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
I would try something like:
Qt Code:
text-align: center; }To copy to clipboard, switch view to plain text mode
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
text-align only works with QPushButton and QProgressBar anyways, so that's not going to work. Since ::tab is a sub-control, have you looked at using the subcontrol-origin and subcontrol-position properties? This may just align the tab within the tool box though. The brute force way, though, may have to be manually padding the text and looking at the results unless someone has specifically encountered your problem before.
Bookmarks