Hello! (This is mailing list is for discussing development _of_ Qt - [email protected] is the correct list for Qt usage questions)
The setting looks correct and fonts should be resized. There is no need to set QT_ENABLE_HIGHDPI_SCALING on the environment when setting the AA_EnableHighDpiScaling app attribute. It’s a bit hard to say what goes wrong. You could try running qtdiag or dprgadget from github.com/msorvig/qt-highdpi-manualtests/tree/master/dprgadget and check if the correct device pixel ratio is set. (1.5 for 150% etc.) - Morten > On 8 Feb 2021, at 10:17, Thomas Laguzzi <[email protected]> wrote: > > 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 > [email protected] > https://lists.qt-project.org/listinfo/development _______________________________________________ Development mailing list [email protected] https://lists.qt-project.org/listinfo/development
