Hello,

I'm trying to enable QT_ENABLE_HIGHDPI_SCALING=1  in a windows application.
It seems to work good in a multi-screen application even with different DPI
settings, but it only resizes the widgets.
The fonts always remain the same size (100% scaling).
Is there a way to use QT_ENABLE_HIGHDPI_SCALING and automatic font resize?
If I have to do manually, how to detect screen changes?

If I use QT_SCALE_FACTOR  it resizes correctly both the widgets and fonts,
but once the application is started it cannot be changed anymore.

I use something like:

 qputenv("QT_ENABLE_HIGHDPI_SCALING","1");

  QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);

QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);

QApplication a(argc, argv);

MainWindow w;

w.show();

thanks for any hint!

Thomas
_______________________________________________
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development

Reply via email to