diff options
author | Craig Scott <craig.scott@crascit.com> | 2021-05-08 06:19:21 (GMT) |
---|---|---|
committer | Craig Scott <craig.scott@crascit.com> | 2021-05-08 06:19:21 (GMT) |
commit | 6c657173d806aa81d1508830c10a16236b5358b9 (patch) | |
tree | f9c9a834e840ee0678472ce7e12abaa9856d7153 /Source/QtDialog/CMakeSetup.cxx | |
parent | 8146fcddc013d7b395f9c4eb9ca48c7de4618e84 (diff) | |
download | CMake-6c657173d806aa81d1508830c10a16236b5358b9.zip CMake-6c657173d806aa81d1508830c10a16236b5358b9.tar.gz CMake-6c657173d806aa81d1508830c10a16236b5358b9.tar.bz2 |
cmake-gui: Address deprecation warnings with Qt6
Diffstat (limited to 'Source/QtDialog/CMakeSetup.cxx')
-rw-r--r-- | Source/QtDialog/CMakeSetup.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx index 5debdb8..8ffa3e7 100644 --- a/Source/QtDialog/CMakeSetup.cxx +++ b/Source/QtDialog/CMakeSetup.cxx @@ -112,7 +112,10 @@ int main(int argc, char** argv) cmAddPluginPath(); #endif -#if QT_VERSION >= 0x050600 +// HighDpiScaling is always enabled starting with Qt6, but will still issue a +// deprecation warning if you try to set the attribute for it +#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) && \ + QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); #endif @@ -132,9 +135,9 @@ int main(int argc, char** argv) translationsDir.cd(QString::fromLocal8Bit(".." CMAKE_DATA_DIR)); translationsDir.cd("i18n"); QTranslator translator; - QString transfile = QString("cmake_%1").arg(QLocale::system().name()); - translator.load(transfile, translationsDir.path()); - QApplication::installTranslator(&translator); + if (translator.load(QLocale(), "cmake", "_", translationsDir.path())) { + QApplication::installTranslator(&translator); + } // app setup QApplication::setApplicationName("CMakeSetup"); |