From 3c41665b809dce6cf5b0d469ba41c40e58b67475 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Mon, 20 Sep 2021 12:52:32 +0200 Subject: [PATCH 01/10] GitHub Actions: Do not build with tests on release tags This should match the official releases. Change-Id: I075e977121ffcaa32de37a9505be6c6296d7258d Reviewed-by: Eike Ziller --- .github/workflows/build_cmake.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index 4e9f6f8e146..d9408a98258 100644 --- a/.github/workflows/build_cmake.yml +++ b/.github/workflows/build_cmake.yml @@ -455,6 +455,11 @@ jobs: find_package(Python3 REQUIRED COMPONENTS Interpreter) string(REPLACE "x86" "x64" Python3_EXECUTABLE "${Python3_EXECUTABLE}") + set(WITH_TESTS "--with-tests") + if (${{github.ref}} MATCHES "tags/v") + unset(WITH_TESTS) + endif() + execute_process( COMMAND python -u @@ -465,7 +470,7 @@ jobs: --qt-path "${{ steps.qt.outputs.qt_dir }}" --llvm-path "${{ steps.libclang.outputs.libclang_dir }}" --python3 "${Python3_EXECUTABLE}" - --with-tests + ${WITH_TESTS} ${CDB_OPTION} ${ELFUTILS_OPTION} --add-config=-DCMAKE_C_COMPILER_LAUNCHER=ccache From b7ad67ccdf077d5890715a9c52883accaf786a17 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Mon, 20 Sep 2021 12:19:01 +0200 Subject: [PATCH 02/10] GitHub Actions: Fix tag release upload of artifacts runner.os for uploading of artifacts is always ubuntu, and therefore the runner.os comparisons were not working as expected. Change-Id: I9e2bb418d4fee47aaf57a096a23cbd554051d1df Reviewed-by: Eike Ziller --- .github/workflows/build_cmake.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index d9408a98258..ca71ec446fe 100644 --- a/.github/workflows/build_cmake.yml +++ b/.github/workflows/build_cmake.yml @@ -602,12 +602,10 @@ jobs: config: - { name: "Windows Latest MSVC", artifact: "Windows-MSVC", - is_msvc: true, os: ubuntu-latest } - { name: "Windows Latest MinGW", artifact: "Windows-MinGW", - is_msvc: false, os: ubuntu-latest } - { @@ -634,21 +632,21 @@ jobs: path: ./ - name: Download wininterrupt artifact - if: runner.os == 'Windows' + if: contains(matrix.config.artifact, 'Windows') uses: actions/download-artifact@v1 with: name: wininterrupt-${{ matrix.config.artifact }}-${{ github.run_id }}.7z path: ./ - name: Download qtcreatorcdbext artifact - if: runner.os == 'Windows' && matrix.config.is_msvc + if: matrix.config.artifact == 'Windows-MSVC' uses: actions/upload-artifact@v1 with: name: qtcreatorcdbext-${{ matrix.config.artifact }}-${{ github.run_id }}.7z path: ./ - name: Download disk image artifact - if: runner.os == 'macOS' + if: matrix.config.artifact == 'macOS' uses: actions/upload-artifact@v1 with: name: qt-creator-${{ matrix.config.artifact }}-${{ github.run_id }}.dmg @@ -685,7 +683,7 @@ jobs: asset_content_type: application/x-gtar - name: Upload wininterrupt to Release - if: runner.os == 'Windows' + if: contains(matrix.config.artifact, 'Windows') uses: actions/upload-release-asset@v1.0.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -696,7 +694,7 @@ jobs: asset_content_type: application/x-gtar - name: Upload qtcreatorcdbext to Release - if: runner.os == 'Windows' && matrix.config.is_msvc + if: matrix.config.artifact == 'Windows-MSVC' uses: actions/upload-release-asset@v1.0.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -707,7 +705,7 @@ jobs: asset_content_type: application/x-gtar - name: Upload disk image to Release - if: runner.os == 'macOS' + if: matrix.config.artifact == 'macOS' uses: actions/upload-release-asset@v1.0.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 96ba15dc3a0002ff3cc0823b6ebaa47637b4549c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20K=C3=B6hne?= Date: Mon, 20 Sep 2021 14:59:55 +0200 Subject: [PATCH 03/10] MSVC: Fix C4996 in sqlite3.c Fixes warnings sqlite3.c:43154: warning: C4996: 'GetVersionExA': was declared deprecated sqlite3.c:43164: warning: C4996: 'GetVersionExW': was declared deprecated We know that we're running on Windows NT based versions (the default), so we can as well skip this check. Change-Id: Idd7db098645060bf8b9e449e59904f2f63fb0e0a Reviewed-by: Marco Bubke Reviewed-by: Qt CI Bot --- src/libs/3rdparty/sqlite/config.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libs/3rdparty/sqlite/config.h b/src/libs/3rdparty/sqlite/config.h index dbd0c36e123..345e2b0b01d 100644 --- a/src/libs/3rdparty/sqlite/config.h +++ b/src/libs/3rdparty/sqlite/config.h @@ -88,3 +88,4 @@ #define SQLITE_OMIT_EXPLAIN 1 #define SQLITE_OMIT_TRACE 1 #define SQLITE_DEFAULT_LOCKING_MODE 1 +#define SQLITE_WIN32_GETVERSIONEX 0 From 56d346018a2d468e21d7fa50390f165df19f8072 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 21 Sep 2021 09:15:05 +0200 Subject: [PATCH 04/10] Acknowledgments: Fix path to cpluscplus lib Change-Id: Id1a2f9797bff6b07d75d40c3ce5e6541aeea585e Reviewed-by: Kai Koehne --- README.md | 2 +- doc/qtcreator/src/overview/creator-acknowledgements.qdoc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 712c969edd7..ba4f1c30c3b 100644 --- a/README.md +++ b/README.md @@ -350,7 +350,7 @@ we thank the authors who made this possible: Roberto Raggi - QtCreator/src/shared/cplusplus + QtCreator/src/libs/3rdparty/cplusplus Copyright 2005 Roberto Raggi diff --git a/doc/qtcreator/src/overview/creator-acknowledgements.qdoc b/doc/qtcreator/src/overview/creator-acknowledgements.qdoc index 28b967d8f98..226160d7695 100644 --- a/doc/qtcreator/src/overview/creator-acknowledgements.qdoc +++ b/doc/qtcreator/src/overview/creator-acknowledgements.qdoc @@ -441,7 +441,7 @@ \li \b{Open Source front-end for C++ (license MIT)}, enhanced for use in \QC.\br Roberto Raggi \br - QtCreator/src/shared/cplusplus\br\br + QtCreator/src/libs/3rdparty/cplusplus\br\br \li \b{ANGLE Library (Windows)} From 04bb1ee5dac2c856a542e79ec2cdabaa2026e271 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 17 Sep 2021 14:20:38 +0200 Subject: [PATCH 05/10] Fix QtProjectImporter test for Qt 6.2 versions in PATH In Qt 5, qmake is statically linked to the bootstrap library, so just copying qmake somewhere results in a runnable executable. In Qt 6 this changed, and qmake depends on the dynamic QtCore library, and on Linux also on ICU. Copy these in addition to the qmake executable. Keep the directory structure as in Qt, so the dynamic linker finds them. Change-Id: Ie4f6b617bc91d847b1e4fe38dc8a1c603eae4087 Reviewed-by: Christian Kandeler --- src/plugins/qtsupport/qtprojectimporter.cpp | 51 ++++++++++++++++++--- 1 file changed, 45 insertions(+), 6 deletions(-) diff --git a/src/plugins/qtsupport/qtprojectimporter.cpp b/src/plugins/qtsupport/qtprojectimporter.cpp index 19e9054fb43..d3b25312f2b 100644 --- a/src/plugins/qtsupport/qtprojectimporter.cpp +++ b/src/plugins/qtsupport/qtprojectimporter.cpp @@ -33,7 +33,8 @@ #include #include -#include +#include +#include #include #include @@ -41,6 +42,7 @@ #include using namespace ProjectExplorer; +using namespace Utils; namespace QtSupport { @@ -269,14 +271,51 @@ void TestQtProjectImporter::deleteDirectoryData(void *directoryData) const delete static_cast(directoryData); } +static QStringList additionalFilesToCopy(const BaseQtVersion *qt) +{ + // This is a hack and only works with local, "standard" installations of Qt + const int major = qt->qtVersion().majorVersion; + if (major >= 6) { + if (HostOsInfo::isMacHost()) { + return {"lib/QtCore.framework/Versions/A/QtCore"}; + } else if (HostOsInfo::isWindowsHost()) { + const QString release = QString("bin/Qt%1Core.dll").arg(major); + const QString debug = QString("bin/Qt%1Cored.dll").arg(major); + const FilePath base = qt->qmakeFilePath().parentDir().parentDir(); + if (base.pathAppended(release).exists()) + return {release}; + if (base.pathAppended(debug).exists()) + return {debug}; + return {release}; + } else if (HostOsInfo::isLinuxHost()) { + const QString core = QString("lib/libQt%1Core.so.%1").arg(major); + const QDir base(qt->qmakeFilePath().parentDir().parentDir().pathAppended("lib").toString()); + const QStringList icuLibs = Utils::transform(base.entryList({"libicu*.so.*"}), [](const QString &lib) { return QString("lib/" + lib); }); + return QStringList(core) + icuLibs; + } + } + return {}; +} + static Utils::FilePath setupQmake(const BaseQtVersion *qt, const QString &path) { - const QFileInfo fi = QFileInfo(qt->qmakeFilePath().toFileInfo().canonicalFilePath()); - const QString qmakeFile = path + "/" + fi.fileName(); - if (!QFile::copy(fi.absoluteFilePath(), qmakeFile)) - return Utils::FilePath(); + // This is a hack and only works with local, "standard" installations of Qt + const FilePath qmake = qt->qmakeFilePath().canonicalPath(); + const QString qmakeFile = "bin/" + qmake.fileName(); + const FilePath source = qmake.parentDir().parentDir(); + const FilePath target = FilePath::fromString(path); - return Utils::FilePath::fromString(qmakeFile); + const QStringList filesToCopy = QStringList(qmakeFile) + additionalFilesToCopy(qt); + for (const QString &file : filesToCopy) { + const FilePath sourceFile = source.pathAppended(file); + const FilePath targetFile = target.pathAppended(file); + if (!targetFile.parentDir().ensureWritableDir() || !sourceFile.copyFile(targetFile)) { + qDebug() << "Failed to copy" << sourceFile.toString() << "to" << targetFile.toString(); + return {}; + } + } + + return target.pathAppended(qmakeFile); } void QtSupportPlugin::testQtProjectImporter_oneProject_data() From 128c7dfbefb71523c064c0c221797d4f35a42213 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Mon, 20 Sep 2021 17:45:08 +0200 Subject: [PATCH 06/10] Implement heuristics for parsing version number Similar solution exists in QtHelp module: QString QHelpDBReader::qtVersionHeuristic() const Fixes: QTCREATORBUG-26292 Change-Id: I9037785920e25428db0fa7f03f737c5ef66c4ac3 Reviewed-by: Qt CI Bot Reviewed-by: Eike Ziller --- src/plugins/coreplugin/helpitem.cpp | 61 +++++++++++++++++++++++------ 1 file changed, 49 insertions(+), 12 deletions(-) diff --git a/src/plugins/coreplugin/helpitem.cpp b/src/plugins/coreplugin/helpitem.cpp index 2a972cb98eb..50f84bbf7ab 100644 --- a/src/plugins/coreplugin/helpitem.cpp +++ b/src/plugins/coreplugin/helpitem.cpp @@ -29,6 +29,8 @@ #include #include +#include + using namespace Core; HelpItem::HelpItem() = default; @@ -165,31 +167,66 @@ QString HelpItem::extractContent(bool extended) const return contents; } -static std::pair extractVersion(const QUrl &url) +// The following is only correct under the specific current conditions, and it will +// always be quite some guessing as long as the version information does not +// include separators for major vs minor vs patch version. +static QVersionNumber qtVersionHeuristic(const QString &digits) +{ + if (digits.count() > 6 || digits.count() < 3) + return {}; // suspicious version number + + for (const QChar &digit : digits) + if (!digit.isDigit()) + return {}; // we should have only digits + + // When we have 3 digits, we split it like: ABC -> A.B.C + // When we have 4 digits, we split it like: ABCD -> A.BC.D + // When we have 5 digits, we split it like: ABCDE -> A.BC.DE + // When we have 6 digits, we split it like: ABCDEF -> AB.CD.EF + switch (digits.count()) { + case 3: + return QVersionNumber(digits.mid(0, 1).toInt(), + digits.mid(1, 1).toInt(), + digits.mid(2, 1).toInt()); + case 4: + return QVersionNumber(digits.mid(0, 1).toInt(), + digits.mid(1, 2).toInt(), + digits.mid(3, 1).toInt()); + case 5: + return QVersionNumber(digits.mid(0, 1).toInt(), + digits.mid(1, 2).toInt(), + digits.mid(3, 2).toInt()); + case 6: + return QVersionNumber(digits.mid(0, 2).toInt(), + digits.mid(2, 2).toInt(), + digits.mid(4, 2).toInt()); + default: + break; + } + return {}; +} + +static std::pair extractVersion(const QUrl &url) { const QString host = url.host(); const QStringList hostParts = host.split('.'); if (hostParts.size() == 4 && (host.startsWith("com.trolltech.") || host.startsWith("org.qt-project."))) { - bool ok = false; - // the following is only correct under the specific current conditions, and it will - // always be quite some guessing as long as the version information does not - // include separators for major vs minor vs patch version - const int version = hostParts.at(3).toInt(&ok); - if (ok) { + const QVersionNumber version = qtVersionHeuristic(hostParts.at(3)); + if (!version.isNull()) { QUrl urlWithoutVersion(url); urlWithoutVersion.setHost(hostParts.mid(0, 3).join('.')); return {urlWithoutVersion, version}; } } - return {url, 0}; + return {url, {}}; } // sort primary by "url without version" and seconday by "version" static bool helpUrlLessThan(const QUrl &a, const QUrl &b) { - const std::pair va = extractVersion(a); - const std::pair vb = extractVersion(b); + const std::pair va = extractVersion(a); + const std::pair vb = extractVersion(b); const QString sa = va.first.toString(); const QString sb = vb.first.toString(); if (sa == sb) @@ -260,10 +297,10 @@ static const HelpItem::Links getBestLink(const HelpItem::Links &links) // This is to ensure that if we succeeded with an ID lookup, and we have e.g. Qt5 and Qt4 // documentation, that we only return the Qt5 link even though the Qt5 and Qt4 URLs look // different. - int highestVersion = -1; + QVersionNumber highestVersion; HelpItem::Link bestLink; for (const HelpItem::Link &link : links) { - const int version = extractVersion(link.second).second; + const QVersionNumber version = extractVersion(link.second).second; if (version > highestVersion) { highestVersion = version; bestLink = link; From f8f1732a1e149cc16f7b9336b75094d46ea6ab77 Mon Sep 17 00:00:00 2001 From: Ivan Komissarov Date: Tue, 21 Sep 2021 15:16:39 +0300 Subject: [PATCH 07/10] Update Qbs submodule to the top of 1.20 branch Change-Id: Ic9f108b1f0c96ee82bacb78da3c14998e95e53d3 Reviewed-by: Christian Kandeler --- src/shared/qbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/qbs b/src/shared/qbs index 351461d3680..27bd9ac836b 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit 351461d3680ec680a606fc5333e529c00e161c50 +Subproject commit 27bd9ac836b5cd2937b8d19dfa32cb4ff617b73c From 4e1eb3727f31f3ee05f95dec8e799d752836e3d0 Mon Sep 17 00:00:00 2001 From: Henning Gruendl Date: Mon, 20 Sep 2021 12:13:03 +0200 Subject: [PATCH 08/10] QmlDesigner: Cleanup color logic code Change-Id: I33019c06bc9c1f077ac88367f3b8ea279e2801c5 Reviewed-by: Thomas Hartmann --- .../imports/HelperWidgets/ColorLogic.qml | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorLogic.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorLogic.qml index 2f5a78bdbc2..06ec4ff1aca 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorLogic.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorLogic.qml @@ -27,57 +27,57 @@ import QtQuick 2.15 import StudioTheme 1.0 as StudioTheme QtObject { - id: innerObject + id: root property variant backendValue property color textColor: StudioTheme.Values.themeTextColor - property variant valueFromBackend: backendValue === undefined ? 0 : backendValue.value + property variant valueFromBackend: root.backendValue === undefined ? 0 : root.backendValue.value property bool baseStateFlag: isBaseState property bool isInModel: { - if (backendValue !== undefined && backendValue.isInModel !== undefined) - return backendValue.isInModel + if (root.backendValue !== undefined && root.backendValue.isInModel !== undefined) + return root.backendValue.isInModel return false } property bool isInSubState: { - if (backendValue !== undefined && backendValue.isInSubState !== undefined) - return backendValue.isInSubState + if (root.backendValue !== undefined && root.backendValue.isInSubState !== undefined) + return root.backendValue.isInSubState return false } - property bool highlight: textColor === __changedTextColor + property bool highlight: root.textColor === root.__changedTextColor property bool errorState: false readonly property color __defaultTextColor: StudioTheme.Values.themeTextColor readonly property color __changedTextColor: StudioTheme.Values.themeInteraction readonly property color __errorTextColor: StudioTheme.Values.themeError - onBackendValueChanged: evaluate() - onValueFromBackendChanged: evaluate() - onBaseStateFlagChanged: evaluate() - onIsInModelChanged: evaluate() - onIsInSubStateChanged: evaluate() - onErrorStateChanged: evaluate() + onBackendValueChanged: root.evaluate() + onValueFromBackendChanged: root.evaluate() + onBaseStateFlagChanged: root.evaluate() + onIsInModelChanged: root.evaluate() + onIsInSubStateChanged: root.evaluate() + onErrorStateChanged: root.evaluate() function evaluate() { - if (innerObject.backendValue === undefined) + if (root.backendValue === undefined) return - if (innerObject.errorState) { - innerObject.textColor = __errorTextColor + if (root.errorState) { + root.textColor = root.__errorTextColor return } - if (innerObject.baseStateFlag) { - if (innerObject.backendValue.isInModel) - innerObject.textColor = __changedTextColor + if (root.baseStateFlag) { + if (root.backendValue.isInModel) + root.textColor = root.__changedTextColor else - innerObject.textColor = __defaultTextColor + root.textColor = root.__defaultTextColor } else { - if (innerObject.backendValue.isInSubState) - innerObject.textColor = StudioTheme.Values.themeChangedStateText + if (root.backendValue.isInSubState) + root.textColor = StudioTheme.Values.themeChangedStateText else - innerObject.textColor = __defaultTextColor + root.textColor = root.__defaultTextColor } } } From 2e1bdabd1f22ea62f14024ac177725d1e4620ae3 Mon Sep 17 00:00:00 2001 From: Henning Gruendl Date: Mon, 20 Sep 2021 17:59:01 +0200 Subject: [PATCH 09/10] QmlDesigner: Fix ColorEditor opening position Fix ColorEditor being cut off at the top, when there isn't enough space to fit. Task-number: QDS-5076 Change-Id: If9dc832b89d64c60e11a3458e1d90e5d7e2f0450 Reviewed-by: Miikka Heikkinen Reviewed-by: Thomas Hartmann --- .../imports/HelperWidgets/ColorEditor.qml | 57 +++++++++++++------ .../imports/StudioTheme/Values.qml | 5 +- 2 files changed, 42 insertions(+), 20 deletions(-) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml index cd956dd99e0..d07812f02fd 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml @@ -303,38 +303,59 @@ SecondColumnLayout { } } + // This connection is meant to update the popups y-position and the main scrollviews + // height as soon as the height of the color picker changes. Initially the height of the + // color picker is 0 until its completion is done. + Connections { + target: colorPicker + function onHeightChanged() { + cePopup.setPopupY() + cePopup.setMainScrollViewHeight() + } + } + onOpened: { + cePopup.setPopupY() + cePopup.setMainScrollViewHeight() + } + onYChanged: cePopup.setMainScrollViewHeight() + onHeightChanged: cePopup.setMainScrollViewHeight() + + function setMainScrollViewHeight() { if (Controller.mainScrollView === null) return var mapped = preview.mapToItem(Controller.mainScrollView.contentItem, cePopup.x, cePopup.y) - Controller.mainScrollView.temporaryHeight = mapped.y + cePopup.height + 20 + Controller.mainScrollView.temporaryHeight = mapped.y + cePopup.height + + StudioTheme.Values.colorEditorPopupMargin } - onHeightChanged: { + function setPopupY() { if (Controller.mainScrollView === null) return - var mapped = preview.mapToItem(Controller.mainScrollView.contentItem, cePopup.x, cePopup.y) - Controller.mainScrollView.temporaryHeight = mapped.y + cePopup.height + 20 + var tmp = preview.mapToItem(Controller.mainScrollView.contentItem, preview.x, preview.y) + cePopup.y = Math.max(-tmp.y + StudioTheme.Values.colorEditorPopupMargin, + cePopup.__defaultY) } - onClosed: { - Controller.mainScrollView.temporaryHeight = 0 - } + onClosed: Controller.mainScrollView.temporaryHeight = 0 - x: - StudioTheme.Values.colorEditorPopupWidth * 0.5 - + preview.width * 0.5 - y: - StudioTheme.Values.colorEditorPopupMargin - - (StudioTheme.Values.colorEditorPopupSpacing * 2) - - StudioTheme.Values.defaultControlHeight - - StudioTheme.Values.colorEditorPopupLineHeight - - colorPicker.height * 0.5 - + preview.height * 0.5 + property real __defaultX: - StudioTheme.Values.colorEditorPopupWidth * 0.5 + + preview.width * 0.5 + property real __defaultY: - StudioTheme.Values.colorEditorPopupPadding + - (StudioTheme.Values.colorEditorPopupSpacing * 2) + - StudioTheme.Values.defaultControlHeight + - StudioTheme.Values.colorEditorPopupLineHeight + - colorPicker.height * 0.5 + + preview.height * 0.5 + + x: cePopup.__defaultX + y: cePopup.__defaultY width: StudioTheme.Values.colorEditorPopupWidth height: colorColumn.height + sectionColumn.height - + StudioTheme.Values.colorEditorPopupMargin + 2 // TODO magic number + + StudioTheme.Values.colorEditorPopupPadding + 2 // TODO magic number padding: StudioTheme.Values.border margins: -1 // If not defined margin will be -1 @@ -353,7 +374,7 @@ SecondColumnLayout { anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right - anchors.margins: StudioTheme.Values.colorEditorPopupMargin + anchors.margins: StudioTheme.Values.colorEditorPopupPadding spacing: StudioTheme.Values.colorEditorPopupSpacing RowLayout { @@ -714,7 +735,7 @@ SecondColumnLayout { Column { id: sectionColumn - anchors.topMargin: StudioTheme.Values.colorEditorPopupMargin + anchors.topMargin: StudioTheme.Values.colorEditorPopupPadding anchors.top: colorColumn.bottom anchors.left: parent.left anchors.right: parent.right diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml index 09764f7baf9..c4084ca4359 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml @@ -179,9 +179,10 @@ QtObject { // Color Editor Popup property real colorEditorPopupWidth: 4 * values.colorEditorPopupSpinBoxWidth + 3 * values.controlGap - + 2 * values.colorEditorPopupMargin + + 2 * values.colorEditorPopupPadding property real colorEditorPopupHeight: 800 - property real colorEditorPopupMargin: 10 + property real colorEditorPopupPadding: 10 + property real colorEditorPopupMargin: 20 property real colorEditorPopupSpacing: 10 property real colorEditorPopupLineHeight: 60 From 11fd8232b790e8a24070709e046a55b44fbb2fc2 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Fri, 17 Sep 2021 18:03:58 +0200 Subject: [PATCH 10/10] CMakePM: Display tree node only on failure Fixes: QTCREATORBUG-25994 Fixes: QTCREATORBUG-25974 Change-Id: I383fe5c28d1f71c8f7939bc9fe4f1f0bf1d6a01b Reviewed-by: Qt CI Bot Reviewed-by: Eike Ziller (cherry picked from commit 36a0151c6d041a82203c40b4d8b6a800d04e361b) Reviewed-by: Cristian Adam --- .../cmakeprojectmanager/cmakebuildsystem.cpp | 10 ++++------ src/plugins/cmakeprojectmanager/cmakebuildsystem.h | 2 +- src/plugins/cmakeprojectmanager/fileapireader.cpp | 13 +++++-------- src/plugins/cmakeprojectmanager/fileapireader.h | 4 +--- 4 files changed, 11 insertions(+), 18 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index e42732c4b51..6988cdb8825 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -527,11 +527,9 @@ void CMakeBuildSystem::clearCMakeCache() } std::unique_ptr CMakeBuildSystem::generateProjectTree( - const TreeScanner::Result &allFiles, bool includeHeaderNodes) + const TreeScanner::Result &allFiles, bool failedToParse) { - QString errorMessage; - auto root = m_reader.generateProjectTree(allFiles, errorMessage, includeHeaderNodes); - checkAndReportError(errorMessage); + auto root = m_reader.generateProjectTree(allFiles, failedToParse); return root; } @@ -604,7 +602,7 @@ void CMakeBuildSystem::updateProjectData() Project *p = project(); { - auto newRoot = generateProjectTree(m_allFiles, true); + auto newRoot = generateProjectTree(m_allFiles, false); if (newRoot) { setRootProjectNode(std::move(newRoot)); @@ -703,7 +701,7 @@ void CMakeBuildSystem::updateFallbackProjectData() QTC_ASSERT(m_treeScanner.isFinished() && !m_reader.isParsing(), return ); - auto newRoot = generateProjectTree(m_allFiles, false); + auto newRoot = generateProjectTree(m_allFiles, true); setRootProjectNode(std::move(newRoot)); qCDebug(cmakeBuildSystemLog) << "All fallback CMake project data up to date."; diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.h b/src/plugins/cmakeprojectmanager/cmakebuildsystem.h index 95d31367d81..c722ee172f0 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.h @@ -133,7 +133,7 @@ private: void combineScanAndParse(); std::unique_ptr generateProjectTree( - const ProjectExplorer::TreeScanner::Result &allFiles, bool includeHeadersNode); + const ProjectExplorer::TreeScanner::Result &allFiles, bool failedToParse); void checkAndReportError(QString &errorMessage); void updateCMakeConfiguration(QString &errorMessage); diff --git a/src/plugins/cmakeprojectmanager/fileapireader.cpp b/src/plugins/cmakeprojectmanager/fileapireader.cpp index 09aa375bd24..b7da82f568a 100644 --- a/src/plugins/cmakeprojectmanager/fileapireader.cpp +++ b/src/plugins/cmakeprojectmanager/fileapireader.cpp @@ -217,16 +217,13 @@ bool FileApiReader::usesAllCapsTargets() const } std::unique_ptr FileApiReader::generateProjectTree( - const ProjectExplorer::TreeScanner::Result &allFiles, - QString &errorMessage, - bool includeHeaderNodes) + const ProjectExplorer::TreeScanner::Result &allFiles, bool failedToParse) { - Q_UNUSED(errorMessage) - - if (includeHeaderNodes) { + if (failedToParse) + addFileSystemNodes(m_rootProjectNode.get(), allFiles.folderNode); + else addHeaderNodes(m_rootProjectNode.get(), m_knownHeaders, allFiles.allFiles); - } - addFileSystemNodes(m_rootProjectNode.get(), allFiles.folderNode); + return std::exchange(m_rootProjectNode, {}); } diff --git a/src/plugins/cmakeprojectmanager/fileapireader.h b/src/plugins/cmakeprojectmanager/fileapireader.h index 4e447966990..30cdae42679 100644 --- a/src/plugins/cmakeprojectmanager/fileapireader.h +++ b/src/plugins/cmakeprojectmanager/fileapireader.h @@ -72,9 +72,7 @@ public: CMakeConfig takeParsedConfiguration(QString &errorMessage); QString ctestPath() const; std::unique_ptr generateProjectTree( - const ProjectExplorer::TreeScanner::Result &allFiles, - QString &errorMessage, - bool includeHeaderNodes); + const ProjectExplorer::TreeScanner::Result &allFiles, bool failedToParse); ProjectExplorer::RawProjectParts createRawProjectParts(QString &errorMessage); bool isMultiConfig() const;