hi,
im using
lbl->setFont(QFont("Trebuchet",12,QFont::Bold));
where lbl is QLabel
for font size and font bold.
How to set FontSize directly ? (without mentioning fontname as above)
like lbl.setFontSize
Thnks
Bala
hi,
im using
lbl->setFont(QFont("Trebuchet",12,QFont::Bold));
where lbl is QLabel
for font size and font bold.
How to set FontSize directly ? (without mentioning fontname as above)
like lbl.setFontSize
Thnks
Bala
Last edited by BalaQT; 18th September 2009 at 15:17.
QFont font = lbl->font ();
font.setPointSize(12);//set the font size here
lbl->setFont(font);
BalaQT (18th September 2009)
Hi,
I don't see any problem in first way with creating font inside method setPointSize() as post BalaQt.
Maybe problem could be if font "Trebuchet" doesn't exist (then Qt maybe use another font and don't respect set size).
But if you realy only want to change font size and keep font family, the second way is ok.
[edit]: sorry .. i don't read first message properly
thks babu
Bala
Bookmarks