My QLabels look quite ugly, it seems that there's no anti-aliasing. How can I enable this feature (assuming it's available)?
QLabel * l = new QLabel();
QFont f=l->font();
f.setStyleStrategy(QFont::PreferAntialias);
l->setFont(f);
you may also alter application font settings, to be applied to all widgets you use...
QFont f=QApplication::font();
f.setStyleStrategy(QFont::PreferAntialias);
QApplication::setFont(f);
You can set the Antialisasing attribute in the label's font to PreferAntialias. You can do it in QtCreator or by code like this :
QFont f("Times", 50);
f.setStyleStrategy(QFont::PreferAntialias);
ui->label->setFont(f);
Hope this helps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With