Howto: align text within a label
Posted: Sat Feb 23, 2013 10:25 pm
By default, text in labels is centered vertically. Turns out you can fix that!
If you look at http://qt-project.org/doc/qt-4.8/qlabel.html, you'll notice near the top that the label has 'Properties'. You can adjust those properties via stylesheets by prefixing qproperty- at the start - so qproperty-alignment will allow you to adjust the alignment of text in a label.
For a list of possible alignment values, see the documentation here.
To set one value, you would use the following in your stylesheet:
If you look at http://qt-project.org/doc/qt-4.8/qlabel.html, you'll notice near the top that the label has 'Properties'. You can adjust those properties via stylesheets by prefixing qproperty- at the start - so qproperty-alignment will allow you to adjust the alignment of text in a label.
For a list of possible alignment values, see the documentation here.
To set one value, you would use the following in your stylesheet:
To set multiple values, separate them with a pipe | sign:
See Geyser page for practical examples using Geyser.