diff options
author | Luis Caro <luis.carocampos@fuel-3d.com> | 2017-09-15 14:28:38 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-09-15 14:54:36 (GMT) |
commit | 6fb36572dcae748b81435602d0dc0a7968e28039 (patch) | |
tree | 90abd445a235ce5454379df8127fe65567f44633 /Source/QtDialog | |
parent | c0c5f924fe46fcf83603117689b372cb8520c4bb (diff) | |
download | CMake-6fb36572dcae748b81435602d0dc0a7968e28039.zip CMake-6fb36572dcae748b81435602d0dc0a7968e28039.tar.gz CMake-6fb36572dcae748b81435602d0dc0a7968e28039.tar.bz2 |
cmake-gui: Enable High DPI scaling
This Qt flag enables UI scaling based on scale factor provided by the
operating system. Only supported on versions of Qt >= 5.6.
The flag has no effect on macOS, where high DPI support is already
enabled as a setting in the bundle's info.plist.
Fixes: #17026
Diffstat (limited to 'Source/QtDialog')
-rw-r--r-- | Source/QtDialog/CMakeSetup.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx index 9f881e2..ca0b015 100644 --- a/Source/QtDialog/CMakeSetup.cxx +++ b/Source/QtDialog/CMakeSetup.cxx @@ -92,6 +92,10 @@ int main(int argc, char** argv) cmAddPluginPath(); #endif +#if QT_VERSION >= 0x050600 + QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); +#endif + QApplication app(argc, argv); setlocale(LC_NUMERIC, "C"); |