I am wondering if I am missing something in setting up Qt high DPI scaling.
Right now I have a problem on two displays with 100% and 200% scaling. I am on Windows 10 using Qt 6.4.3 in C++, using Qt Creator.
I thought something is wrong with my application, but the same happens with a very simple Qt examples, like Group Box Example.
When I open the window on one screen and move it over, or open it on the other display it looks like only partially scaled:


For 100% the scaling looks good. In the 200% the squares and circles of the check boxes and radio buttons are rendered to small, while the font is scaled correctly.
I don't have the same problem, e.g with Qt Creator settings menu, which scales nicely.
Here is the basic of the code, the rest is repetition. It doesn't look any special to me, and from what I read in the Qt6 documentation here, High-DPI scaling should work out of the box in Qt6.
#include <QApplication>'
#include <QWidget>
class Window : public QWidget
{
Q_OBJECT
public:
Window(QWidget *parent = nullptr);
private:
QGroupBox *createFirstExclusiveGroup();
QGroupBox *createSecondExclusiveGroup();
QGroupBox *createNonExclusiveGroup();
QGroupBox *createPushButtonGroup();
};
Window::Window(QWidget *parent)
: QWidget(parent)
{
QGridLayout *grid = new QGridLayout;
grid->addWidget(createFirstExclusiveGroup(), 0, 0);
grid->addWidget(createSecondExclusiveGroup(), 1, 0);
grid->addWidget(createNonExclusiveGroup(), 0, 1);
grid->addWidget(createPushButtonGroup(), 1, 1);
setLayout(grid);
setWindowTitle(tr("Group Boxes"));
resize(480, 320);
}
QGroupBox *Window::createFirstExclusiveGroup()
{
QGroupBox *groupBox = new QGroupBox(tr("Exclusive Radio Buttons"));
QRadioButton *radio1 = new QRadioButton(tr("&Radio button 1"));
QRadioButton *radio2 = new QRadioButton(tr("R&adio button 2"));
QRadioButton *radio3 = new QRadioButton(tr("Ra&dio button 3"));
radio1->setChecked(true);
QVBoxLayout *vbox = new QVBoxLayout;
vbox->addWidget(radio1);
vbox->addWidget(radio2);
vbox->addWidget(radio3);
vbox->addStretch(1);
groupBox->setLayout(vbox);
return groupBox;
}
...
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Window window;
window.show();
return app.exec();
}
What else needs to be done?