PDA

View Full Version : QFont::setPointSize() does not take effect



lovelypp
12th July 2008, 15:42
In the constructor of the main dialog (inherited from QDialog), I create a QPushButton, the I change its font size using QFont::setPointSize(). But when shown, the font size of QPushButton remains default. It seems that QFont::setPointSize does not take effect or the font size of QPushButton is overrided by something ?
So what' s the chance to change the font size of QPushButton ? How ?
My app is running on Windows Mobile 5, thanks!

jacek
12th July 2008, 16:34
How do you exactly use setPointSize()?

lovelypp
12th July 2008, 23:30
QFont font = pushButton->font();
font.setPointSize(9); // specificy the font size
pushButton->setFont(font);

jacek
12th July 2008, 23:36
Do you use a scalable font?

lovelypp
13th July 2008, 13:12
what's scalable font ?
I just create a QDialog inherited object and show it in main.

thanks!

jacek
14th July 2008, 19:44
what's scalable font ?
It's a font that you can scale as opposed to a fixed-size font which comes only in certain sizes.

What is the default font on your system?