GNOME Bugzilla – Bug 791671
Qt/HiDPI: scale apps by setting QT_SCREEN_SCALE_FACTORS
Last modified: 2017-12-28 17:35:27 UTC
To scale Qt apps in a Gnome session (X11) on a HiDPI screen, please do what KDE does and set QT_SCREEN_SCALE_FACTORS.
Sorry but no, that's an environment variable which means we can't change it at runtime when displays are attached/detached and besides, according to the documentation: " QT_SCREEN_SCALE_FACTORS [list] specifies scale factors for each screen. This will not change the size of point sized fonts. This environment variable is mainly useful for debugging, or to work around monitors with wrong EDID information(Extended Display Identification Data). The format can be either a semicolon-separated list of scale factors in the same order as QGuiApplication::screens(), or a semicolon-separated list of name=value pairs, where name is the same as QScreen::name(). " Which means we can't set it even if we wanted since we don't know neither the order nor the names. We do set the Xft/DPI xsetting taking into account the appropriate scale so Qt could use that if it doesn't already. And, of course, for wayland apps scaling is properly supported in the protocol.
I filed a bug for Qt: https://bugreports.qt.io/browse/QTBUG-65424