How to enable anti-aliasing in Qlabel?

My QLabels look pretty ugly, there seems to be no smoothing. How to enable this feature (if available)?

+8
qt antialiasing qlabel
source share
2 answers
QLabel * l = new QLabel(); QFont f=l->font(); f.setStyleStrategy(QFont::PreferAntialias); l->setFont(f); 

You can also change the font settings of the application, which will be applied to all widgets that you use ...

 QFont f=QApplication::font(); f.setStyleStrategy(QFont::PreferAntialias); QApplication::setFont(f); 
+10
source share

You can set the Antialisasing attribute in the label font in PreferAntialias. You can do this in QtCreator or using code as follows:

 QFont f("Times", 50); f.setStyleStrategy(QFont::PreferAntialias); ui->label->setFont(f); 

Hope this helps

+2
source share

All Articles