Details
-
Bug
-
Resolution: Done
-
P2: Important
-
None
-
5.14.0
-
None
Description
When setting the attribute Qt::AA_EnableHighDpiScaling you can no longer disable Antialising the fonts via the QFont::NoAntialias style strategy.
This worked in 5.13.2
Minimal Example
#include <QApplication> #include <QBoxLayout> #include <QPlainTextEdit> #include <QPushButton> int main(int argc, char *argv[]) { // comment out this line to be able to switch antialising QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication a(argc, argv); auto layout = new QVBoxLayout; auto edit = new QPlainTextEdit; edit->setPlainText("this is a test\nfor turning on antialiasing\nof fonts\n"); auto button = new QPushButton("switch AA"); layout->addWidget(edit); layout->addWidget(button); QObject::connect(button, &QPushButton::pressed, [edit]() { QFont f = edit->font(); f.setStyleStrategy(f.styleStrategy() & QFont::NoAntialias ? QFont::PreferAntialias : QFont::NoAntialias); edit->setFont(f); }); QWidget w; w.setLayout(layout); w.show(); return a.exec(); }
Attachments
Issue Links
- duplicates
-
QTBUG-80967 Font hinting configuration pickup is broken in 5.14.0
- Closed
- resulted in
-
QTCREATORBUG-23367 Antialiasing is always on regardless of system/QtC settings
- Closed