summaryrefslogtreecommitdiff
path: root/Source/QtDialog
diff options
context:
space:
mode:
Diffstat (limited to 'Source/QtDialog')
-rw-r--r--Source/QtDialog/CMakeSetup.cxx11
-rw-r--r--Source/QtDialog/CMakeSetupDialog.cxx4
-rw-r--r--Source/QtDialog/QCMake.cxx16
3 files changed, 22 insertions, 9 deletions
diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx
index 5debdb89b..8ffa3e728 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");
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index 031308891..178557168 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -178,7 +178,11 @@ CMakeSetupDialog::CMakeSetupDialog()
&CMakeSetupDialog::doOutputErrorNext);
a->setShortcut(QKeySequence(Qt::Key_F8));
auto* s = new QShortcut(this);
+#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
s->setKey(QKeySequence(Qt::CTRL + Qt::Key_Period));
+#else
+ s->setKey(QKeySequence(Qt::CTRL | Qt::Key_Period));
+#endif
QObject::connect(s, &QShortcut::activated, this,
&CMakeSetupDialog::doOutputErrorNext); // in Eclipse
diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx
index f593f8358..e6faef470 100644
--- a/Source/QtDialog/QCMake.cxx
+++ b/Source/QtDialog/QCMake.cxx
@@ -13,6 +13,7 @@
#include "cmExternalMakefileProjectGenerator.h"
#include "cmGlobalGenerator.h"
+#include "cmMessageMetadata.h"
#include "cmState.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
@@ -37,8 +38,8 @@ QCMake::QCMake(QObject* p)
cmSystemTools::SetRunCommandHideConsole(true);
cmSystemTools::SetMessageCallback(
- [this](std::string const& msg, const char* title) {
- this->messageCallback(msg, title);
+ [this](std::string const& msg, const cmMessageMetadata& md) {
+ this->messageCallback(msg, md.title);
});
cmSystemTools::SetStdoutCallback(
[this](std::string const& msg) { this->stdoutCallback(msg); });
@@ -160,7 +161,7 @@ void QCMake::setPreset(const QString& name, bool setBinary)
auto const& expandedPreset =
this->CMakePresetsFile.ConfigurePresets[presetName].Expanded;
if (expandedPreset) {
- if (setBinary) {
+ if (setBinary && !expandedPreset->BinaryDir.empty()) {
QString binaryDir =
QString::fromLocal8Bit(expandedPreset->BinaryDir.data());
this->setBinaryDirectory(binaryDir);
@@ -334,7 +335,12 @@ void QCMake::setProperties(const QCMakePropertyList& newProps)
toremove.append(QString::fromLocal8Bit(key.c_str()));
} else {
prop = props[idx];
- if (prop.Value.type() == QVariant::Bool) {
+#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
+ const bool isBool = prop.Value.type() == QVariant::Bool;
+#else
+ const bool isBool = prop.Value.metaType() == QMetaType::fromType<bool>();
+#endif
+ if (isBool) {
state->SetCacheEntryValue(key, prop.Value.toBool() ? "ON" : "OFF");
} else {
state->SetCacheEntryValue(key,
@@ -557,7 +563,7 @@ void QCMake::loadPresets()
preset.toolset = std::move(QString::fromLocal8Bit(p.Toolset.data()));
preset.setToolset = !p.ToolsetStrategy ||
p.ToolsetStrategy == cmCMakePresetsFile::ArchToolsetStrategy::Set;
- preset.enabled = it.Expanded &&
+ preset.enabled = it.Expanded && it.Expanded->ConditionResult &&
std::find_if(this->AvailableGenerators.begin(),
this->AvailableGenerators.end(),
[&p](const cmake::GeneratorInfo& g) {