binary001
8th March 2015, 10:33
Hi,
I add mylabels to form programmatically.
Now I set custom font to these labels as follow:
1.
QFont font("MyFont001 ", 30, QFont::Bold);
myLabel->setFont(font);
or
2.
myLabel->setStyleSheet(@"font: 9pt "MyFont001 ";");
Both can not change to myLabels' font to MyFont001
So I add a label at Qt Designer and change QLabel's font to my custom font. It's also same result.
How can I set custom font (ttf font) to qlabel programmatically?
Thanks.
I add mylabels to form programmatically.
Now I set custom font to these labels as follow:
1.
QFont font("MyFont001 ", 30, QFont::Bold);
myLabel->setFont(font);
or
2.
myLabel->setStyleSheet(@"font: 9pt "MyFont001 ";");
Both can not change to myLabels' font to MyFont001
So I add a label at Qt Designer and change QLabel's font to my custom font. It's also same result.
How can I set custom font (ttf font) to qlabel programmatically?
Thanks.