PDA

View Full Version : QStyleSheet font-size as percentage?



dhalbert
25th June 2010, 23:06
I'd like to set a font-size value in a QStyleSheet, e.g.:

QLineEdit { font-size: 80%; }

But this does not seem to work at all. I can set the size absolutely using "pt", "px", etc. Should I expect using percentages to work?

(My actual goal is sizing a QComboBox in a QTreeView where most of the other item widgets are just text. I want to make the QComboBox smaller so it doesn't stand out so much and increase the row height. But I wanted to do this in a platform-independent way.)

Thanks,
Dan

tbscope
26th June 2010, 06:00
Quoting the documentation:



The font size. In this version of Qt, only pt and px metrics are supported.