PDA

View Full Version : QGroupBox title alignment



binaural
7th April 2010, 16:26
Hi,

I'm using QT 4.5.3 on linux. When I drop QGroupBox to form groupd box title is centered and not left aligned.
I try to align it to left but it doesn't help and it was still in the center. How can I align it to left?

Thanks,

Marek

toutarrive
8th April 2010, 12:13
Difficult to say without a piece of code. Do your mind showing us the relevant part?
Qt provides a function to set the alignment of a QGroupBox title, have look at http://qt.nokia.com/doc/4.6/qgroupbox.html#alignment-prop
It's good to know that you can do it as well through style sheet, http://doc.trolltech.com/4.3/stylesheet-examples.html#customizing-qgroupbox

TheJim01
9th April 2010, 22:56
It sounds like binaural is using Designer.

You should be able to modify the alignment of the group box title by changing the "Alignment" in the properties box. If you dive into the code, you can also use toutarrive's suggestions.

It is probably center-aligning because it is inheriting whatever linux theme is currently in use. You may need to over-ride inheriting the theme in order to left-align the title.