aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2023-06-27 15:20:18 +0200
committerEike Ziller <eike.ziller@qt.io>2023-06-27 15:20:18 +0200
commit3e65778d6632027a932e78a771ec877f72042cff (patch)
tree8ad63a32967e477e482c4199c2ddefb70cba7af4 /src/plugins
parenta8cab6f5a19f1355e9de1d95354cb25baf62515d (diff)
parent372e2ba6155a37c94d534d9176bb4c9a3b8024fe (diff)
Merge remote-tracking branch 'origin/11.0'
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/autotest/boost/boosttestsettings.cpp8
-rw-r--r--src/plugins/autotest/ctest/ctestsettings.cpp3
-rw-r--r--src/plugins/autotest/gtest/gtestsettings.cpp6
-rw-r--r--src/plugins/autotest/testresultmodel.cpp5
-rw-r--r--src/plugins/autotest/testresultspane.cpp2
-rw-r--r--src/plugins/clangformat/clangformatfile.cpp19
-rw-r--r--src/plugins/clangformat/clangformatutils.cpp6
-rw-r--r--src/plugins/clangtools/readexporteddiagnosticstest.cpp31
-rw-r--r--src/plugins/clangtools/readexporteddiagnosticstest.h3
-rw-r--r--src/plugins/projectexplorer/projectwizardpage.cpp11
-rw-r--r--src/plugins/qmldesigner/CMakeLists.txt14
-rw-r--r--src/plugins/qmldesignerbase/CMakeLists.txt14
-rw-r--r--src/plugins/qmlprojectmanager/CMakeLists.txt2
-rw-r--r--src/plugins/qtsupport/examplesparser.cpp24
14 files changed, 93 insertions, 55 deletions
diff --git a/src/plugins/autotest/boost/boosttestsettings.cpp b/src/plugins/autotest/boost/boosttestsettings.cpp
index ed0bad6bca..4cf9225173 100644
--- a/src/plugins/autotest/boost/boosttestsettings.cpp
+++ b/src/plugins/autotest/boost/boosttestsettings.cpp
@@ -66,22 +66,22 @@ BoostTestSettings::BoostTestSettings(Id settingsId)
seed.setEnabler(&randomize);
randomize.setSettingsKey("Randomize");
- randomize.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBox);
+ randomize.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel);
randomize.setLabelText(Tr::tr("Randomize"));
randomize.setToolTip(Tr::tr("Randomize execution order."));
systemErrors.setSettingsKey("SystemErrors");
- systemErrors.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBox);
+ systemErrors.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel);
systemErrors.setLabelText(Tr::tr("Catch system errors"));
systemErrors.setToolTip(Tr::tr("Catch or ignore system errors."));
fpExceptions.setSettingsKey("FPExceptions");
- fpExceptions.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBox);
+ fpExceptions.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel);
fpExceptions.setLabelText(Tr::tr("Floating point exceptions"));
fpExceptions.setToolTip(Tr::tr("Enable floating point exception traps."));
memLeaks.setSettingsKey("MemoryLeaks");
- memLeaks.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBox);
+ memLeaks.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel);
memLeaks.setDefaultValue(true);
memLeaks.setLabelText(Tr::tr("Detect memory leaks"));
memLeaks.setToolTip(Tr::tr("Enable memory leak detection."));
diff --git a/src/plugins/autotest/ctest/ctestsettings.cpp b/src/plugins/autotest/ctest/ctestsettings.cpp
index a2f3e90427..70016f7920 100644
--- a/src/plugins/autotest/ctest/ctestsettings.cpp
+++ b/src/plugins/autotest/ctest/ctestsettings.cpp
@@ -44,6 +44,7 @@ CTestSettings::CTestSettings(Id settingsId)
outputOnFail.setSettingsKey("OutputOnFail");
outputOnFail.setLabelText(Tr::tr("Output on failure"));
+ outputOnFail.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel);
outputOnFail.setDefaultValue(true);
outputMode.setSettingsKey("OutputMode");
@@ -70,9 +71,11 @@ CTestSettings::CTestSettings(Id settingsId)
scheduleRandom.setSettingsKey("ScheduleRandom");
scheduleRandom.setLabelText(Tr::tr("Schedule random"));
+ scheduleRandom.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel);
stopOnFailure.setSettingsKey("StopOnFail");
stopOnFailure.setLabelText(Tr::tr("Stop on failure"));
+ stopOnFailure.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel);
parallel.setSettingsKey("Parallel");
parallel.setToolTip(Tr::tr("Run tests in parallel mode using given number of jobs."));
diff --git a/src/plugins/autotest/gtest/gtestsettings.cpp b/src/plugins/autotest/gtest/gtestsettings.cpp
index ca31c99f12..7fa1e53479 100644
--- a/src/plugins/autotest/gtest/gtestsettings.cpp
+++ b/src/plugins/autotest/gtest/gtestsettings.cpp
@@ -26,6 +26,7 @@ GTestSettings::GTestSettings(Id settingsId)
setLayouter([this] {
return Row { Form {
runDisabled, br,
+ throwOnFailure, br,
breakOnFailure, br,
repeat, iterations, br,
shuffle, seed, br,
@@ -49,24 +50,29 @@ GTestSettings::GTestSettings(Id settingsId)
runDisabled.setSettingsKey("RunDisabled");
runDisabled.setLabelText(Tr::tr("Run disabled tests"));
+ runDisabled.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel);
runDisabled.setToolTip(Tr::tr("Executes disabled tests when performing a test run."));
shuffle.setSettingsKey("Shuffle");
shuffle.setLabelText(Tr::tr("Shuffle tests"));
+ shuffle.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel);
shuffle.setToolTip(Tr::tr("Shuffles tests automatically on every iteration by the given seed."));
repeat.setSettingsKey("Repeat");
repeat.setLabelText(Tr::tr("Repeat tests"));
+ repeat.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel);
repeat.setToolTip(Tr::tr("Repeats a test run (you might be required to increase the timeout to "
"avoid canceling the tests)."));
throwOnFailure.setSettingsKey("ThrowOnFailure");
throwOnFailure.setLabelText(Tr::tr("Throw on failure"));
+ throwOnFailure.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel);
throwOnFailure.setToolTip(Tr::tr("Turns assertion failures into C++ exceptions."));
breakOnFailure.setSettingsKey("BreakOnFailure");
breakOnFailure.setDefaultValue(true);
breakOnFailure.setLabelText(Tr::tr("Break on failure while debugging"));
+ breakOnFailure.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBoxWithoutDummyLabel);
breakOnFailure.setToolTip(Tr::tr("Turns failures into debugger breakpoints."));
groupMode.setSettingsKey("GroupMode");
diff --git a/src/plugins/autotest/testresultmodel.cpp b/src/plugins/autotest/testresultmodel.cpp
index f03cd8c685..fcb02ec595 100644
--- a/src/plugins/autotest/testresultmodel.cpp
+++ b/src/plugins/autotest/testresultmodel.cpp
@@ -296,9 +296,8 @@ void TestResultModel::addTestResult(const TestResult &testResult, bool autoExpan
if (parentItem) {
parentItem->appendChild(newItem);
if (autoExpand) {
- parentItem->expand();
- newItem->expand();
- newItem->forAllChildren([](TreeItem *it) { it->expand(); });
+ QMetaObject::invokeMethod(this, [parentItem]{ parentItem->expand(); },
+ Qt::QueuedConnection);
}
updateParent(newItem);
} else {
diff --git a/src/plugins/autotest/testresultspane.cpp b/src/plugins/autotest/testresultspane.cpp
index 3dbad31ea9..457b273a4a 100644
--- a/src/plugins/autotest/testresultspane.cpp
+++ b/src/plugins/autotest/testresultspane.cpp
@@ -142,7 +142,7 @@ TestResultsPane::TestResultsPane(QObject *parent) :
onCopyItemTriggered(getTestResult(m_treeView->currentIndex()));
});
connect(m_model, &TestResultModel::requestExpansion, this, [this](const QModelIndex &idx) {
- m_treeView->expand(m_filterModel->mapFromSource(idx));
+ m_treeView->expandRecursively(m_filterModel->mapFromSource(idx));
});
connect(TestRunner::instance(), &TestRunner::testRunStarted,
this, &TestResultsPane::onTestRunStarted);
diff --git a/src/plugins/clangformat/clangformatfile.cpp b/src/plugins/clangformat/clangformatfile.cpp
index 16209c3094..66eb58d6ea 100644
--- a/src/plugins/clangformat/clangformatfile.cpp
+++ b/src/plugins/clangformat/clangformatfile.cpp
@@ -152,14 +152,17 @@ CppEditor::CppCodeStyleSettings ClangFormatFile::toCppCodeStyleSettings(
// to be false
settings.indentAccessSpecifiers = (style.AccessModifierOffset != -1 * int(style.IndentWidth));
- settings.indentNamespaceBody = style.NamespaceIndentation
- == FormatStyle::NamespaceIndentationKind::NI_All;
- settings.indentNamespaceBraces = settings.indentNamespaceBody;
-
- settings.indentClassBraces = style.BreakBeforeBraces == FormatStyle::BS_Whitesmiths;
- settings.indentEnumBraces = settings.indentClassBraces;
- settings.indentBlockBraces = settings.indentClassBraces;
- settings.indentFunctionBraces = settings.indentClassBraces;
+ if (style.NamespaceIndentation == FormatStyle::NamespaceIndentationKind::NI_All) {
+ settings.indentNamespaceBody = true;
+ settings.indentNamespaceBraces = settings.indentNamespaceBody;
+ }
+
+ if (style.BreakBeforeBraces == FormatStyle::BS_Whitesmiths) {
+ settings.indentClassBraces = true;
+ settings.indentEnumBraces = settings.indentClassBraces;
+ settings.indentBlockBraces = settings.indentClassBraces;
+ settings.indentFunctionBraces = settings.indentClassBraces;
+ }
settings.indentSwitchLabels = style.IndentCaseLabels;
#if LLVM_VERSION_MAJOR >= 11
diff --git a/src/plugins/clangformat/clangformatutils.cpp b/src/plugins/clangformat/clangformatutils.cpp
index 949911fe5e..7b9a896fc1 100644
--- a/src/plugins/clangformat/clangformatutils.cpp
+++ b/src/plugins/clangformat/clangformatutils.cpp
@@ -207,13 +207,13 @@ void fromCppCodeStyleSettings(clang::format::FormatStyle &style,
else
style.AccessModifierOffset = -1 * style.IndentWidth;
- if (settings.indentNamespaceBody || settings.indentNamespaceBraces)
+ if (settings.indentNamespaceBody && settings.indentNamespaceBraces)
style.NamespaceIndentation = FormatStyle::NamespaceIndentationKind::NI_All;
else
style.NamespaceIndentation = FormatStyle::NamespaceIndentationKind::NI_None;
- if (settings.indentClassBraces || settings.indentEnumBraces || settings.indentBlockBraces
- || settings.indentFunctionBraces)
+ if (settings.indentClassBraces && settings.indentEnumBraces && settings.indentBlockBraces
+ && settings.indentFunctionBraces)
style.BreakBeforeBraces = FormatStyle::BS_Whitesmiths;
else
style.BreakBeforeBraces = FormatStyle::BS_Custom;
diff --git a/src/plugins/clangtools/readexporteddiagnosticstest.cpp b/src/plugins/clangtools/readexporteddiagnosticstest.cpp
index d839108451..f6bf5e1118 100644
--- a/src/plugins/clangtools/readexporteddiagnosticstest.cpp
+++ b/src/plugins/clangtools/readexporteddiagnosticstest.cpp
@@ -64,9 +64,8 @@ static QString appendYamlSuffix(const char *filePathFragment)
void ReadExportedDiagnosticsTest::testTidy()
{
const FilePath sourceFile = filePath("tidy.modernize-use-nullptr.cpp");
- const FilePath exportedFile = createFile(
- filePath(appendYamlSuffix("tidy.modernize-use-nullptr")).toString(),
- sourceFile.toString());
+ const FilePath exportedFile
+ = createFile(filePath(appendYamlSuffix("tidy.modernize-use-nullptr")), sourceFile);
Diagnostic expectedDiag;
expectedDiag.name = "modernize-use-nullptr";
expectedDiag.location = {sourceFile, 2, 25};
@@ -86,9 +85,9 @@ void ReadExportedDiagnosticsTest::testTidy()
void ReadExportedDiagnosticsTest::testAcceptDiagsFromFilePaths_None()
{
- const QString sourceFile = filePath("tidy.modernize-use-nullptr.cpp").toString();
- const FilePath exportedFile = createFile(filePath("tidy.modernize-use-nullptr.yaml").toString(),
- sourceFile);
+ const FilePath sourceFile = filePath("tidy.modernize-use-nullptr.cpp");
+ const FilePath exportedFile = createFile(filePath("tidy.modernize-use-nullptr.yaml"),
+ sourceFile);
const auto acceptNone = [](const FilePath &) { return false; };
const expected_str<Diagnostics> diags
= readExportedDiagnostics(exportedFile, acceptNone);
@@ -101,8 +100,7 @@ void ReadExportedDiagnosticsTest::testTidy_ClangAnalyzer()
{
const FilePath sourceFile = filePath("clang-analyzer.dividezero.cpp");
const FilePath exportedFile
- = createFile(filePath(appendYamlSuffix("clang-analyzer.dividezero")).toString(),
- sourceFile.toString());
+ = createFile(filePath(appendYamlSuffix("clang-analyzer.dividezero")), sourceFile);
Diagnostic expectedDiag;
expectedDiag.name = "clang-analyzer-core.DivideZero";
expectedDiag.location = {sourceFile, 4, 15};
@@ -134,8 +132,8 @@ void ReadExportedDiagnosticsTest::testTidy_ClangAnalyzer()
void ReadExportedDiagnosticsTest::testClazy()
{
const FilePath sourceFile = filePath("clazy.qgetenv.cpp");
- const FilePath exportedFile = createFile(filePath(appendYamlSuffix("clazy.qgetenv")).toString(),
- sourceFile.toString());
+ const FilePath exportedFile = createFile(filePath(appendYamlSuffix("clazy.qgetenv")),
+ sourceFile);
Diagnostic expectedDiag;
expectedDiag.name = "clazy-qgetenv";
expectedDiag.location = {sourceFile, 7, 5};
@@ -259,17 +257,16 @@ void ReadExportedDiagnosticsTest::testOffsetMultiByteCodePoint2()
}
// Replace FILE_PATH with a real absolute file path in the *.yaml files.
-FilePath ReadExportedDiagnosticsTest::createFile(const QString &yamlFilePath,
- const QString &filePathToInject) const
+FilePath ReadExportedDiagnosticsTest::createFile(const Utils::FilePath &yamlFilePath,
+ const Utils::FilePath &filePathToInject) const
{
- QTC_ASSERT(QDir::isAbsolutePath(filePathToInject), return {});
- const FilePath newFileName = m_baseDir->absolutePath(QFileInfo(yamlFilePath).fileName());
+ QTC_ASSERT(filePathToInject.isAbsolutePath(), return {});
+ const FilePath newFileName = m_baseDir->filePath().resolvePath(yamlFilePath);
FileReader reader;
- if (QTC_GUARD(reader.fetch(FilePath::fromString(yamlFilePath),
- QIODevice::ReadOnly | QIODevice::Text))) {
+ if (QTC_GUARD(reader.fetch(yamlFilePath, QIODevice::ReadOnly | QIODevice::Text))) {
QByteArray contents = reader.data();
- contents.replace("FILE_PATH", filePathToInject.toLocal8Bit());
+ contents.replace("FILE_PATH", filePathToInject.toString().toLocal8Bit());
FileSaver fileSaver(newFileName, QIODevice::WriteOnly | QIODevice::Text);
QTC_CHECK(fileSaver.write(contents));
diff --git a/src/plugins/clangtools/readexporteddiagnosticstest.h b/src/plugins/clangtools/readexporteddiagnosticstest.h
index 54bde6b75c..0cf9ef3737 100644
--- a/src/plugins/clangtools/readexporteddiagnosticstest.h
+++ b/src/plugins/clangtools/readexporteddiagnosticstest.h
@@ -44,7 +44,8 @@ private slots:
void testOffsetMultiByteCodePoint2();
private:
- Utils::FilePath createFile(const QString &yamlFilePath, const QString &filePathToInject) const;
+ Utils::FilePath createFile(const Utils::FilePath &yamlFilePath,
+ const Utils::FilePath &filePathToInject) const;
Utils::FilePath filePath(const QString &fileName) const;
CppEditor::Tests::TemporaryCopiedDir * const m_baseDir;
diff --git a/src/plugins/projectexplorer/projectwizardpage.cpp b/src/plugins/projectexplorer/projectwizardpage.cpp
index 83fd4d2cba..75f573430d 100644
--- a/src/plugins/projectexplorer/projectwizardpage.cpp
+++ b/src/plugins/projectexplorer/projectwizardpage.cpp
@@ -298,10 +298,6 @@ ProjectWizardPage::ProjectWizardPage(QWidget *parent)
scrollArea,
}.attachTo(this);
- connect(m_projectComboBox, &QComboBox::currentIndexChanged,
- this, &ProjectWizardPage::projectChanged);
- connect(m_addToVersionControlComboBox, &QComboBox::currentIndexChanged,
- this, &ProjectWizardPage::versionControlChanged);
connect(m_vcsManageButton, &QAbstractButton::clicked, this, &ProjectWizardPage::manageVcs);
setProperty(SHORT_TITLE_PROPERTY, Tr::tr("Summary"));
@@ -376,6 +372,7 @@ void ProjectWizardPage::initializeVersionControls()
// 2) Directory is managed and VCS does not support "Add" -> None available
// 3) Directory is not managed -> Offer all VCS that support "CreateRepository"
+ m_addToVersionControlComboBox->disconnect();
QList<IVersionControl *> versionControls = VcsManager::versionControls();
if (versionControls.isEmpty())
hideVersionControlUiElements();
@@ -419,6 +416,9 @@ void ProjectWizardPage::initializeVersionControls()
int newIdx = m_activeVersionControls.indexOf(currentSelection) + 1;
setVersionControlIndex(newIdx);
}
+
+ connect(m_addToVersionControlComboBox, &QComboBox::currentIndexChanged,
+ this, &ProjectWizardPage::versionControlChanged);
}
bool ProjectWizardPage::runVersionControl(const QList<GeneratedFile> &files, QString *errorMessage)
@@ -457,6 +457,7 @@ void ProjectWizardPage::initializeProjectTree(Node *context, const FilePaths &pa
IWizardFactory::WizardKind kind,
ProjectAction action)
{
+ m_projectComboBox->disconnect();
BestNodeSelector selector(m_commonDirectory, paths);
TreeItem *root = m_model.rootItem();
@@ -489,6 +490,8 @@ void ProjectWizardPage::initializeProjectTree(Node *context, const FilePaths &pa
setAddingSubProject(action == AddSubProject);
m_projectComboBox->setEnabled(m_model.rowCount(QModelIndex()) > 1);
+ connect(m_projectComboBox, &QComboBox::currentIndexChanged,
+ this, &ProjectWizardPage::projectChanged);
}
void ProjectWizardPage::setNoneLabel(const QString &label)
diff --git a/src/plugins/qmldesigner/CMakeLists.txt b/src/plugins/qmldesigner/CMakeLists.txt
index 5935933f64..feba07e446 100644
--- a/src/plugins/qmldesigner/CMakeLists.txt
+++ b/src/plugins/qmldesigner/CMakeLists.txt
@@ -31,7 +31,7 @@ add_qtc_library(QmlDesignerUtils STATIC
)
extend_qtc_library(QmlDesignerUtils
- CONDITION NOT DISABLE_COMPILE_WARNING_AS_ERROR
+ CONDITION ENABLE_COMPILE_WARNING_AS_ERROR
PROPERTIES COMPILE_WARNING_AS_ERROR ON
)
@@ -84,7 +84,7 @@ endif()
extend_qtc_library(QmlDesignerCore
- CONDITION NOT DISABLE_COMPILE_WARNING_AS_ERROR
+ CONDITION ENABLE_COMPILE_WARNING_AS_ERROR
PROPERTIES COMPILE_WARNING_AS_ERROR ON
)
@@ -481,7 +481,7 @@ add_qtc_plugin(QmlDesigner
)
extend_qtc_plugin(QmlDesigner
- CONDITION NOT DISABLE_COMPILE_WARNING_AS_ERROR
+ CONDITION ENABLE_COMPILE_WARNING_AS_ERROR
PROPERTIES COMPILE_WARNING_AS_ERROR ON
)
@@ -1088,7 +1088,7 @@ add_qtc_plugin(assetexporterplugin
)
extend_qtc_plugin(assetexporterplugin
- CONDITION NOT DISABLE_COMPILE_WARNING_AS_ERROR
+ CONDITION ENABLE_COMPILE_WARNING_AS_ERROR
PROPERTIES COMPILE_WARNING_AS_ERROR ON
)
@@ -1121,7 +1121,7 @@ add_qtc_plugin(componentsplugin
)
extend_qtc_plugin(componentsplugin
- CONDITION NOT DISABLE_COMPILE_WARNING_AS_ERROR
+ CONDITION ENABLE_COMPILE_WARNING_AS_ERROR
PROPERTIES COMPILE_WARNING_AS_ERROR ON
)
@@ -1141,7 +1141,7 @@ add_qtc_plugin(qmlpreviewplugin
)
extend_qtc_plugin(qmlpreviewplugin
- CONDITION NOT DISABLE_COMPILE_WARNING_AS_ERROR
+ CONDITION ENABLE_COMPILE_WARNING_AS_ERROR
PROPERTIES COMPILE_WARNING_AS_ERROR ON
)
@@ -1163,7 +1163,7 @@ add_qtc_plugin(qtquickplugin
)
extend_qtc_plugin(qtquickplugin
- CONDITION NOT DISABLE_COMPILE_WARNING_AS_ERROR
+ CONDITION ENABLE_COMPILE_WARNING_AS_ERROR
PROPERTIES COMPILE_WARNING_AS_ERROR ON
)
diff --git a/src/plugins/qmldesignerbase/CMakeLists.txt b/src/plugins/qmldesignerbase/CMakeLists.txt
index 628403874c..a191b6d43c 100644
--- a/src/plugins/qmldesignerbase/CMakeLists.txt
+++ b/src/plugins/qmldesignerbase/CMakeLists.txt
@@ -1,6 +1,12 @@
-env_with_default("QDS_DISABLE_COMPILE_WARNING_AS_ERROR" ENV_QDS_DISABLE_COMPILE_WARNING_AS_ERROR OFF)
-option(DISABLE_COMPILE_WARNING_AS_ERROR "Dont treat warnings as errors" ${ENV_QDS_DISABLE_COMPILE_WARNING_AS_ERROR})
-add_feature_info("Treat warnings as errors" ${DISABLE_COMPILE_WARNING_AS_ERROR} "")
+if(BUILD_DESIGNSTUDIO AND ($<CONFIG:Debug> OR WITH_TESTS))
+ set(ENABLE_COMPILE_WARNING_AS_ERROR_DEFAULT ON)
+else()
+ set(ENABLE_COMPILE_WARNING_AS_ERROR_DEFAULT OFF)
+endif()
+env_with_default("QDS_ENABLE_COMPILE_WARNING_AS_ERROR" ENV_ENABLE_COMPILE_WARNING_AS_ERROR
+ ${ENABLE_COMPILE_WARNING_AS_ERROR_DEFAULT})
+option(ENABLE_COMPILE_WARNING_AS_ERROR "Treat warnings as errors in QmlDesigner" ${ENV_ENABLE_COMPILE_WARNING_AS_ERROR})
+add_feature_info("Treat warnings as errors in QmlDesigner" ${ENABLE_COMPILE_WARNING_AS_ERROR} "")
add_qtc_plugin(QmlDesignerBase
CONDITION TARGET Qt::QuickWidgets
@@ -12,7 +18,7 @@ add_qtc_plugin(QmlDesignerBase
)
extend_qtc_plugin(QmlDesignerBase
- CONDITION NOT DISABLE_COMPILE_WARNING_AS_ERROR
+ CONDITION ENABLE_COMPILE_WARNING_AS_ERROR
PROPERTIES COMPILE_WARNING_AS_ERROR ON
)
diff --git a/src/plugins/qmlprojectmanager/CMakeLists.txt b/src/plugins/qmlprojectmanager/CMakeLists.txt
index ad71e3fbff..a1212e8bc1 100644
--- a/src/plugins/qmlprojectmanager/CMakeLists.txt
+++ b/src/plugins/qmlprojectmanager/CMakeLists.txt
@@ -25,7 +25,7 @@ add_qtc_plugin(QmlProjectManager
)
extend_qtc_plugin(QmlProjectManager
- CONDITION NOT DISABLE_COMPILE_WARNING_AS_ERROR
+ CONDITION ENABLE_COMPILE_WARNING_AS_ERROR
PROPERTIES COMPILE_WARNING_AS_ERROR ON
)
diff --git a/src/plugins/qtsupport/examplesparser.cpp b/src/plugins/qtsupport/examplesparser.cpp
index 84469ca2c4..d115dcf3fe 100644
--- a/src/plugins/qtsupport/examplesparser.cpp
+++ b/src/plugins/qtsupport/examplesparser.cpp
@@ -301,6 +301,21 @@ expected_str<QList<ExampleItem *>> parseExamples(const QByteArray &manifestData,
return items;
}
+// ordered list of "known" categories
+// TODO this should be defined in the manifest
+Q_GLOBAL_STATIC_WITH_ARGS(QList<QString>,
+ defaultOrder,
+ {QStringList() << "Application Examples"
+ << "Desktop"
+ << "Mobile"
+ << "Embedded"
+ << "Graphics"
+ << "Input/Output"
+ << "Connectivity"
+ << "Networking"
+ << "Positioning & Location"
+ << "Internationalization"});
+
static bool sortByHighlightedAndName(ExampleItem *first, ExampleItem *second)
{
if (first->isHighlighted && !second->isHighlighted)
@@ -350,15 +365,20 @@ QList<std::pair<Core::Section, QList<ExampleItem *>>> getCategories(const QList<
} else {
// All original items have been copied into a category or other, delete.
qDeleteAll(items);
+ static const int defaultOrderSize = defaultOrder->size();
int index = 0;
const auto end = categoryMap.constKeyValueEnd();
for (auto it = categoryMap.constKeyValueBegin(); it != end; ++it) {
- categories.append({{it->first, index, /*maxRows=*/index == 0 ? 2 : 1}, it->second});
+ // order "known" categories as wanted, others come afterwards
+ const int defaultIndex = defaultOrder->indexOf(it->first);
+ const int priority = defaultIndex >= 0 ? defaultIndex : (index + defaultOrderSize);
+ categories.append({{it->first, priority, /*maxRows=*/index == 0 ? 2 : 1}, it->second});
++index;
}
if (!other.isEmpty())
- categories.append({{otherDisplayName, index, /*maxRows=*/1}, other});
+ categories.append({{otherDisplayName, index + defaultOrderSize, /*maxRows=*/1}, other});
}
+
const auto end = categories.end();
for (auto it = categories.begin(); it != end; ++it)
sort(it->second, sortByHighlightedAndName);