From afe95c4ac29102d5fc0b44f8b698303f26269bc5 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 16 Jun 2021 22:08:05 +0200 Subject: [PATCH 01/23] QmlDesigner: Switch to QtQuick import The Qt import is a leftover from Qt 4. Change-Id: Ib7781be40774632bbe3fa869f174301bf3e28143 Reviewed-by: Thomas Hartmann --- tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp | 2 +- tests/auto/qml/qmldesigner/data/fx/imports.qml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp b/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp index 3d23777eaa9..b3633ff614a 100644 --- a/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp +++ b/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp @@ -900,7 +900,7 @@ void tst_TestCore::testRewriterImports() QVERIFY(import.isLibraryImport()); QCOMPARE(import.url(), QString("QtQuick")); QVERIFY(import.hasVersion()); - QCOMPARE(import.version(), QString("1.0")); + QCOMPARE(import.version(), QString("2.15")); QVERIFY(!import.hasAlias()); // import "subitems" diff --git a/tests/auto/qml/qmldesigner/data/fx/imports.qml b/tests/auto/qml/qmldesigner/data/fx/imports.qml index f0ba46f2cdd..ebff695aa2a 100644 --- a/tests/auto/qml/qmldesigner/data/fx/imports.qml +++ b/tests/auto/qml/qmldesigner/data/fx/imports.qml @@ -23,7 +23,7 @@ ** ****************************************************************************/ -import Qt 4.7 +import QtQuick 2.15 import "subitems" import QtWebKit 1.0 as Web From 324ff024d70ac69edb61d546eebe3a7678498406 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 12 Jul 2021 16:10:43 +0200 Subject: [PATCH 02/23] QtSupport: Rename BaseQtVersion::autodetection* to detection It's also used for manually triggered detection nowadays and closer in naming to what kit, debugger and kit have. Change-Id: I68705aafe297d61afc8b5918650e47353d3ccce1 Reviewed-by: Eike Ziller --- src/plugins/docker/dockerdevice.cpp | 2 +- src/plugins/qtsupport/baseqtversion.cpp | 18 +++++++++--------- src/plugins/qtsupport/baseqtversion.h | 2 +- src/plugins/qtsupport/qtkitinformation.cpp | 4 ++-- src/plugins/qtsupport/qtversionfactory.h | 8 ++++---- src/plugins/qtsupport/qtversionmanager.cpp | 20 ++++++++++---------- 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index 67333f75229..418bc9b8c07 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -478,7 +478,7 @@ void KitDetectorPrivate::undoAutoDetect() const } }; for (BaseQtVersion *qtVersion : QtVersionManager::versions()) { - if (qtVersion->autodetectionSource() == m_sharedId) { + if (qtVersion->detectionSource() == m_sharedId) { emit q->logOutput(tr("Removing Qt version: %1").arg(qtVersion->displayName())); QtVersionManager::removeVersion(qtVersion); } diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index b82e0e5783e..8b34f3c5b98 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -78,7 +78,7 @@ namespace QtSupport { namespace Internal { const char QTVERSIONAUTODETECTED[] = "isAutodetected"; -const char QTVERSIONAUTODETECTIONSOURCE[] = "autodetectionSource"; +const char QTVERSIONDETECTIONSOURCE[] = "autodetectionSource"; const char QTVERSION_OVERRIDE_FEATURES[] = "overrideFeatures"; const char QTVERSIONQMAKEPATH[] = "QMakePath"; const char QTVERSIONSOURCEPATH[] = "SourcePath"; @@ -223,7 +223,7 @@ public: bool m_versionInfoUpToDate = false; bool m_qmakeIsExecutable = true; - QString m_autodetectionSource; + QString m_detectionSource; QSet m_overrideFeatures; FilePath m_mkspec; @@ -368,7 +368,7 @@ QString BaseQtVersion::defaultUnexpandedDisplayName() const } while (!dir.isRoot() && dir.cdUp()); } - return autodetectionSource() == "PATH" ? + return detectionSource() == "PATH" ? QCoreApplication::translate("QtVersion", "Qt %{Qt:Version} in PATH (%2)").arg(location) : QCoreApplication::translate("QtVersion", "Qt %{Qt:Version} (%2)").arg(location); } @@ -724,7 +724,7 @@ void BaseQtVersion::fromMap(const QVariantMap &map) d->m_id = QtVersionManager::getUniqueId(); d->m_data.unexpandedDisplayName.fromMap(map, Constants::QTVERSIONNAME); d->m_isAutodetected = map.value(QTVERSIONAUTODETECTED).toBool(); - d->m_autodetectionSource = map.value(QTVERSIONAUTODETECTIONSOURCE).toString(); + d->m_detectionSource = map.value(QTVERSIONDETECTIONSOURCE).toString(); d->m_overrideFeatures = Utils::Id::fromStringList(map.value(QTVERSION_OVERRIDE_FEATURES).toStringList()); d->m_qmakeCommand = FilePath::fromVariant(map.value(QTVERSIONQMAKEPATH)); @@ -765,7 +765,7 @@ QVariantMap BaseQtVersion::toMap() const d->m_data.unexpandedDisplayName.toMap(result, Constants::QTVERSIONNAME); result.insert(QTVERSIONAUTODETECTED, isAutodetected()); - result.insert(QTVERSIONAUTODETECTIONSOURCE, autodetectionSource()); + result.insert(QTVERSIONDETECTIONSOURCE, detectionSource()); if (!d->m_overrideFeatures.isEmpty()) result.insert(QTVERSION_OVERRIDE_FEATURES, Utils::Id::toStringList(d->m_overrideFeatures)); @@ -885,9 +885,9 @@ bool BaseQtVersion::isAutodetected() const return d->m_isAutodetected; } -QString BaseQtVersion::autodetectionSource() const +QString BaseQtVersion::detectionSource() const { - return d->m_autodetectionSource; + return d->m_detectionSource; } QString BaseQtVersion::displayName() const @@ -2316,7 +2316,7 @@ void BaseQtVersion::resetCache() const static QList g_qtVersionFactories; BaseQtVersion *QtVersionFactory::createQtVersionFromQMakePath - (const FilePath &qmakePath, bool isAutoDetected, const QString &autoDetectionSource, QString *error) + (const FilePath &qmakePath, bool isAutoDetected, const QString &detectionSource, QString *error) { QHash versionInfo; const Environment env = qmakePath.deviceEnvironment(); @@ -2353,7 +2353,7 @@ BaseQtVersion *QtVersionFactory::createQtVersionFromQMakePath ver->d->m_id = QtVersionManager::getUniqueId(); QTC_CHECK(ver->d->m_qmakeCommand.isEmpty()); // Should only be used once. ver->d->m_qmakeCommand = qmakePath; - ver->d->m_autodetectionSource = autoDetectionSource; + ver->d->m_detectionSource = detectionSource; ver->d->m_isAutodetected = isAutoDetected; ver->updateDefaultDisplayName(); ProFileCacheManager::instance()->decRefCount(); diff --git a/src/plugins/qtsupport/baseqtversion.h b/src/plugins/qtsupport/baseqtversion.h index b722b2fcb86..53e1f98c1c8 100644 --- a/src/plugins/qtsupport/baseqtversion.h +++ b/src/plugins/qtsupport/baseqtversion.h @@ -98,7 +98,7 @@ public: virtual bool equals(BaseQtVersion *other); bool isAutodetected() const; - QString autodetectionSource() const; + QString detectionSource() const; QString displayName() const; QString unexpandedDisplayName() const; diff --git a/src/plugins/qtsupport/qtkitinformation.cpp b/src/plugins/qtsupport/qtkitinformation.cpp index b66efe72bfd..f7614bdb2ef 100644 --- a/src/plugins/qtsupport/qtkitinformation.cpp +++ b/src/plugins/qtsupport/qtkitinformation.cpp @@ -184,7 +184,7 @@ void QtKitAspect::setup(Kit *k) const QList &candidates = !exactMatches.empty() ? exactMatches : matches; BaseQtVersion * const qtFromPath = QtVersionManager::version( - equal(&BaseQtVersion::autodetectionSource, QString::fromLatin1("PATH"))); + equal(&BaseQtVersion::detectionSource, QString::fromLatin1("PATH"))); if (qtFromPath && candidates.contains(qtFromPath)) k->setValue(id(), qtFromPath->uniqueId()); else @@ -343,7 +343,7 @@ int QtKitAspect::qtVersionId(const Kit *k) id = -1; } else { QString source = data.toString(); - BaseQtVersion *v = QtVersionManager::version([source](const BaseQtVersion *v) { return v->autodetectionSource() == source; }); + BaseQtVersion *v = QtVersionManager::version([source](const BaseQtVersion *v) { return v->detectionSource() == source; }); if (v) id = v->uniqueId(); } diff --git a/src/plugins/qtsupport/qtversionfactory.h b/src/plugins/qtsupport/qtversionfactory.h index 9f055ea1cc9..d3d48d78058 100644 --- a/src/plugins/qtsupport/qtversionfactory.h +++ b/src/plugins/qtsupport/qtversionfactory.h @@ -51,10 +51,10 @@ public: /// the desktop factory claims to handle all paths int priority() const { return m_priority; } - static BaseQtVersion *createQtVersionFromQMakePath( - const Utils::FilePath &qmakePath, bool isAutoDetected = false, - const QString &autoDetectionSource = QString(), QString *error = nullptr); - + static BaseQtVersion *createQtVersionFromQMakePath(const Utils::FilePath &qmakePath, + bool isAutoDetected = false, + const QString &detectionSource = {}, + QString *error = nullptr); protected: struct SetupData { diff --git a/src/plugins/qtsupport/qtversionmanager.cpp b/src/plugins/qtsupport/qtversionmanager.cpp index 7996bebf8bb..8b5c3eefb60 100644 --- a/src/plugins/qtsupport/qtversionmanager.cpp +++ b/src/plugins/qtsupport/qtversionmanager.cpp @@ -265,8 +265,8 @@ void QtVersionManager::updateFromInstaller(bool emitSignal) if (log().isDebugEnabled()) { qCDebug(log) << "======= Existing Qt versions ======="; for (BaseQtVersion *version : qAsConst(m_versions)) { - qCDebug(log) << version->qmakeFilePath().toString() << "id:"<uniqueId(); - qCDebug(log) << " autodetection source:"<< version->autodetectionSource(); + qCDebug(log) << version->qmakeFilePath().toUserOutput() << "id:"<uniqueId(); + qCDebug(log) << " autodetection source:" << version->detectionSource(); qCDebug(log) << ""; } qCDebug(log)<< "======= Adding sdk versions ======="; @@ -303,7 +303,7 @@ void QtVersionManager::updateFromInstaller(bool emitSignal) bool restored = false; const VersionMap versionsCopy = m_versions; // m_versions is modified in loop for (BaseQtVersion *v : versionsCopy) { - if (v->autodetectionSource() == autoDetectionSource) { + if (v->detectionSource() == autoDetectionSource) { id = v->uniqueId(); qCDebug(log) << " Qt version found with same autodetection source" << autoDetectionSource << " => Migrating id:" << id; m_versions.remove(id); @@ -341,16 +341,16 @@ void QtVersionManager::updateFromInstaller(bool emitSignal) if (log().isDebugEnabled()) { qCDebug(log) << "======= Before removing outdated sdk versions ======="; for (BaseQtVersion *version : qAsConst(m_versions)) { - qCDebug(log) << version->qmakeFilePath().toString() << "id:"<uniqueId(); - qCDebug(log) << " autodetection source:"<< version->autodetectionSource(); + qCDebug(log) << version->qmakeFilePath().toUserOutput() << "id:" << version->uniqueId(); + qCDebug(log) << " autodetection source:" << version->detectionSource(); qCDebug(log) << ""; } } const VersionMap versionsCopy = m_versions; // m_versions is modified in loop for (BaseQtVersion *qtVersion : versionsCopy) { - if (qtVersion->autodetectionSource().startsWith("SDK.")) { - if (!sdkVersions.contains(qtVersion->autodetectionSource())) { - qCDebug(log) << " removing version"<autodetectionSource(); + if (qtVersion->detectionSource().startsWith("SDK.")) { + if (!sdkVersions.contains(qtVersion->detectionSource())) { + qCDebug(log) << " removing version" << qtVersion->detectionSource(); m_versions.remove(qtVersion->uniqueId()); removed << qtVersion->uniqueId(); } @@ -360,8 +360,8 @@ void QtVersionManager::updateFromInstaller(bool emitSignal) if (log().isDebugEnabled()) { qCDebug(log)<< "======= End result ======="; for (BaseQtVersion *version : qAsConst(m_versions)) { - qCDebug(log) << version->qmakeFilePath().toString() << "id:" << version->uniqueId(); - qCDebug(log) << " autodetection source:"<< version->autodetectionSource(); + qCDebug(log) << version->qmakeFilePath().toUserOutput() << "id:" << version->uniqueId(); + qCDebug(log) << " autodetection source:" << version->detectionSource(); qCDebug(log) << ""; } } From f490ea44fde5c7c3d193eef75da05d39e331768a Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 14 Jul 2021 12:43:23 +0200 Subject: [PATCH 03/23] QtSupport: Fix compile Amends 22121885feb7c686eb64. Change-Id: I1758e04561192855340dd5e850d8ddd498eff8b3 Reviewed-by: Tim Jenssen --- src/plugins/qtsupport/qtprojectimporter.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/qtsupport/qtprojectimporter.cpp b/src/plugins/qtsupport/qtprojectimporter.cpp index 2ed2a6ac6bb..19e9054fb43 100644 --- a/src/plugins/qtsupport/qtprojectimporter.cpp +++ b/src/plugins/qtsupport/qtprojectimporter.cpp @@ -271,7 +271,7 @@ void TestQtProjectImporter::deleteDirectoryData(void *directoryData) const static Utils::FilePath setupQmake(const BaseQtVersion *qt, const QString &path) { - const QFileInfo fi = QFileInfo(qt->qmakeCommand().toFileInfo().canonicalFilePath()); + const QFileInfo fi = QFileInfo(qt->qmakeFilePath().toFileInfo().canonicalFilePath()); const QString qmakeFile = path + "/" + fi.fileName(); if (!QFile::copy(fi.absoluteFilePath(), qmakeFile)) return Utils::FilePath(); @@ -379,12 +379,12 @@ void QtSupportPlugin::testQtProjectImporter_oneProject() SysRootKitAspect::setSysRoot(kitTemplates[1], Utils::FilePath::fromString("/some/path")); SysRootKitAspect::setSysRoot(kitTemplates[2], Utils::FilePath::fromString("/some/other/path")); - QVector qmakePaths = {defaultQt->qmakeCommand(), + QVector qmakePaths = {defaultQt->qmakeFilePath(), setupQmake(defaultQt, tempDir1.path().path()), setupQmake(defaultQt, tempDir2.path().path())}; for (int i = 1; i < qmakePaths.count(); ++i) - QVERIFY(!QtVersionManager::version(Utils::equal(&BaseQtVersion::qmakeCommand, qmakePaths.at(i)))); + QVERIFY(!QtVersionManager::version(Utils::equal(&BaseQtVersion::qmakeFilePath, qmakePaths.at(i)))); QList testData; @@ -457,7 +457,7 @@ void QtSupportPlugin::testQtProjectImporter_oneProject() QVERIFY(newQt); // VALIDATE: Qt has the expected qmakePath - QCOMPARE(dd->qmakePath, newQt->qmakeCommand()); + QCOMPARE(dd->qmakePath, newQt->qmakeFilePath()); // VALIDATE: All keys are unchanged: QList newKitKeys = newKit->allKeys(); @@ -569,7 +569,7 @@ void QtSupportPlugin::testQtProjectImporter_oneProject() QVERIFY(QtVersionManager::version(qtId)); // VALIDATE: Qt points to the expected qmake path: - QCOMPARE(QtVersionManager::version(qtId)->qmakeCommand(), dd->qmakePath); + QCOMPARE(QtVersionManager::version(qtId)->qmakeFilePath(), dd->qmakePath); // VALIDATE: Kit uses the expected Qt QCOMPARE(QtKitAspect::qtVersionId(newKit), qtId); From 0ba7c5c0d5254a5b67d1216da24f1ad728812e37 Mon Sep 17 00:00:00 2001 From: Henning Gruendl Date: Fri, 9 Jul 2021 16:15:00 +0200 Subject: [PATCH 04/23] QmlDesigner: Update Hue/OpacitySlider handle * Update the look of the HueSlider and OpacitySlider handle to be more visible and at the same time show the picked color/transparency * Fix undefined warning in ExtendedFunctionLogic Change-Id: Ib593a385f80f199e80aeff5a862efb22aca88c3a Reviewed-by: Alessandro Portale --- .../HelperWidgets/ExtendedFunctionLogic.qml | 2 +- .../imports/HelperWidgets/HueSlider.qml | 18 +++++++++++------- .../imports/HelperWidgets/OpacitySlider.qml | 18 +++++++++++------- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ExtendedFunctionLogic.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ExtendedFunctionLogic.qml index d3b6a9deeca..58b82a7c24d 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ExtendedFunctionLogic.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ExtendedFunctionLogic.qml @@ -61,7 +61,7 @@ Item { extendedFunctionButton.color = StudioTheme.Values.themeInteraction } } else { - if (backendValue.complexNode !== null + if (backendValue.complexNode !== undefined && backendValue.complexNode.exists) { } else { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/HueSlider.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/HueSlider.qml index 50c930d64b5..a09fc23d7f3 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/HueSlider.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/HueSlider.qml @@ -42,7 +42,7 @@ Item { function updatePos() { if (root.maximum > root.minimum) { var pos = (track.width - handle.width) * (root.value - root.minimum) / (root.maximum - root.minimum) - return Math.min(Math.max(pos, 0), track.width - 8) + return Math.min(Math.max(pos, 0), track.width - handle.width) } else { return 0 } @@ -74,20 +74,24 @@ Item { Rectangle { id: handle width: StudioTheme.Values.hueSliderHandleWidth - height: track.height + height: track.height - 4 anchors.verticalCenter: parent.verticalCenter smooth: true - opacity: 0.9 + color: "transparent" radius: 2 border.color: "black" border.width: 1 x: root.updatePos() + y: 2 z: 1 - gradient: Gradient { - GradientStop {color: "#2c2c2c" ; position: 0} - GradientStop {color: "#343434" ; position: 0.15} - GradientStop {color: "#373737" ; position: 1.0} + Rectangle { + anchors.fill: parent + anchors.margins: 1 + color: "transparent" + radius: 1 + border.color: "white" + border.width: 1 } } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/OpacitySlider.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/OpacitySlider.qml index cf1fea7d07b..176b493a19b 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/OpacitySlider.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/OpacitySlider.qml @@ -43,7 +43,7 @@ Item { function updatePos() { if (root.maximum > root.minimum) { var pos = (track.width - handle.width) * (root.value - root.minimum) / (root.maximum - root.minimum) - return Math.min(Math.max(pos, 0), track.width - 8) + return Math.min(Math.max(pos, 0), track.width - handle.width) } else { return 0 } @@ -77,20 +77,24 @@ Item { Rectangle { id: handle width: StudioTheme.Values.hueSliderHandleWidth - height: track.height + height: track.height - 4 anchors.verticalCenter: parent.verticalCenter smooth: true - opacity: 0.9 + color: "transparent" radius: 2 border.color: "black" border.width: 1 x: root.updatePos() + y: 2 z: 1 - gradient: Gradient { - GradientStop {color: "#2c2c2c" ; position: 0} - GradientStop {color: "#343434" ; position: 0.15} - GradientStop {color: "#373737" ; position: 1.0} + Rectangle { + anchors.fill: parent + anchors.margins: 1 + color: "transparent" + radius: 1 + border.color: "white" + border.width: 1 } } From e030d0489269ae85659c14dc233fc10f50411ee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20K=C3=B6hne?= Date: Wed, 14 Jul 2021 08:00:44 +0200 Subject: [PATCH 05/23] Auto Test Project: Prefer Qt6 over Qt5 Be consistent with the other wizards, and prefer Qt6 over Qt5, if both are available. Change-Id: I3a2f1c04c372a98ae6dacd884344fdd8d2ea2deb Reviewed-by: Eike Ziller Reviewed-by: Christian Stenger --- share/qtcreator/templates/wizards/autotest/files/tst.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/share/qtcreator/templates/wizards/autotest/files/tst.txt b/share/qtcreator/templates/wizards/autotest/files/tst.txt index 161fd0ff26f..fe8e30e789d 100644 --- a/share/qtcreator/templates/wizards/autotest/files/tst.txt +++ b/share/qtcreator/templates/wizards/autotest/files/tst.txt @@ -4,10 +4,10 @@ project(%{TestCaseName} LANGUAGES CXX) @if "%{TestFrameWork}" == "QtTest" @if "%{RequireGUI}" == "true" -find_package(QT NAMES Qt5 Qt6 COMPONENTS Gui Test REQUIRED) +find_package(QT NAMES Qt6 Qt5 COMPONENTS Gui Test REQUIRED) find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Gui Test REQUIRED) @else -find_package(QT NAMES Qt5 Qt6 COMPONENTS Test REQUIRED) +find_package(QT NAMES Qt6 Qt5 COMPONENTS Test REQUIRED) find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Test REQUIRED) @endif @@ -32,7 +32,7 @@ target_link_libraries(%{TestCaseName} PRIVATE Qt${QT_VERSION_MAJOR}::Test) @endif @if "%{TestFrameWork}" == "QtQuickTest" -find_package(QT NAMES Qt5 Qt6 COMPONENTS QuickTest REQUIRED) +find_package(QT NAMES Qt6 Qt5 COMPONENTS QuickTest REQUIRED) find_package(Qt${QT_VERSION_MAJOR} COMPONENTS QuickTest REQUIRED) set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -123,7 +123,7 @@ endif () SET(CMAKE_CXX_STANDARD 11) @if "%{Catch2NeedsQt}" == "true" -find_package(QT NAMES Qt5 Qt6 COMPONENTS Gui REQUIRED) +find_package(QT NAMES Qt6 Qt5 COMPONENTS Gui REQUIRED) find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Gui REQUIRED) @endif From 4d8d91647e082f631ad962ff7b2c20b773d6b0b6 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 14 Jul 2021 13:04:54 +0200 Subject: [PATCH 06/23] Tests: Fix nullptr access in QmlDesigner tests This is just a hot fix and will be replaced later on. Change-Id: I63fb5dcadc965ca2e9ade67b0b748f7abb011aff Reviewed-by: Jarek Kobus --- tests/auto/qml/qmldesigner/coretests/tst_testcore.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/auto/qml/qmldesigner/coretests/tst_testcore.h b/tests/auto/qml/qmldesigner/coretests/tst_testcore.h index 92d4ac00aa9..51bd8f496d6 100644 --- a/tests/auto/qml/qmldesigner/coretests/tst_testcore.h +++ b/tests/auto/qml/qmldesigner/coretests/tst_testcore.h @@ -29,6 +29,8 @@ #include +#include + class tst_TestCore : public QObject { @@ -237,4 +239,7 @@ private slots: // QMLAnnotations void writeAnnotations(); void readAnnotations(); + +private: + ExtensionSystem::PluginManager pm; // FIXME remove }; From 8b8f7dca4d8adb2898d5c10a96f4f3d0ddb6e5cf Mon Sep 17 00:00:00 2001 From: Henning Gruendl Date: Wed, 14 Jul 2021 13:32:28 +0200 Subject: [PATCH 07/23] QmlDesigner: Make ColorEditor scrollable Make the ColorEditor react to mouse wheel events when having the mouse inside of it. Use a WheelHandler to forward wheel events to the ItemPane by calling the flick() function. Task-number: QDS-4698 Change-Id: Ic1bcaf21e80d6bdc6dfcc6eb2e4b0341778a7c2f Reviewed-by: Thomas Hartmann --- .../imports/HelperWidgets/ColorEditor.qml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml index 22f8e340532..19746097d41 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml @@ -281,6 +281,12 @@ SecondColumnLayout { T.Popup { id: cePopup + WheelHandler { + onWheel: function(event) { + Controller.mainScrollView.flick(0, event.angleDelta.y * 5) + } + } + onOpened: { if (Controller.mainScrollView === null) return From 4d4fce3cfe83b02765677e5ceff06d24e059b5ec Mon Sep 17 00:00:00 2001 From: Henning Gruendl Date: Wed, 14 Jul 2021 13:33:23 +0200 Subject: [PATCH 08/23] QmlDesigner: Fix SpinBoxes blocking wheel events Change-Id: I99a30926e65805c6198786f46c65392b65f52d65 Reviewed-by: Thomas Hartmann --- .../imports/StudioControls/RealSpinBoxInput.qml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBoxInput.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBoxInput.qml index 8d92d9c94af..abc8568a2d7 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBoxInput.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBoxInput.qml @@ -214,8 +214,10 @@ TextInput { } onWheel: function(wheel) { - if (!myControl.__wheelEnabled) + if (!myControl.__wheelEnabled) { + wheel.accepted = false return + } // Set stepSize according to used modifier key if (wheel.modifiers & Qt.ControlModifier) From d61600a8e2544b31fbfd41de22c282028109b977 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 14 Jul 2021 13:25:46 +0200 Subject: [PATCH 09/23] Docker: Disable merged channel access for Windows This is not supported and anything related to accessing merged channels on Windows fails due to the need of using wsl or a named pipe. On the downside this may crash QC in cases where e.g. Qt detection still tries to handle qmake as if running locally, but at the current state this seems to no more happen automatically (e.g. when using the auto detection). Change-Id: I983cad66c1210de38a33e26958857a5dcaeef767 Reviewed-by: hjk --- src/plugins/docker/dockerdevice.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index 418bc9b8c07..7ac6646333c 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -715,6 +715,14 @@ void DockerDevicePrivate::tryCreateLocalFileAccess() .arg(m_container, m_mergedDir) + '\n' + tr("Output: '%1'").arg(out) + '\n' + tr("Error: '%1'").arg(proc.stdErr())); + if (HostOsInfo::isWindowsHost()) { // TODO investigate how to make it possible nevertheless + m_mergedDir.clear(); + MessageManager::writeSilently( + tr("Disabling merged channel access. This is not supported and anything " + "related to accessing merged channels on Windows fails due to the need " + "of using wsl or a named pipe.")); + return; + } } m_mergedDirWatcher.addPath(m_mergedDir); From addba5ecbe9ac9ca780393772181fef0283c9527 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 14 Jul 2021 12:37:07 +0200 Subject: [PATCH 10/23] LanguageClient: fix compile on mac Change-Id: Idb2da69ed551d55f1b7ff0e8d80b85b89f073fc2 Reviewed-by: Eike Ziller --- src/plugins/languageclient/lspinspector.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/languageclient/lspinspector.cpp b/src/plugins/languageclient/lspinspector.cpp index ef112c1c5ec..7ccab6b5450 100644 --- a/src/plugins/languageclient/lspinspector.cpp +++ b/src/plugins/languageclient/lspinspector.cpp @@ -538,7 +538,7 @@ MessageId LspLogMessage::id() const QString LspLogMessage::displayText() const { if (!m_displayText.has_value()) { - m_displayText = time.toString("hh:mm:ss.zzz") + '\n'; + m_displayText = QString(time.toString("hh:mm:ss.zzz") + '\n'); if (message.mimeType == JsonRpcMessageHandler::jsonRpcMimeType()) m_displayText->append(json().value(QString{methodKey}).toString(id().toString())); else From 5d17ff7a6781a264f64ec86e407aa303d506f51d Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 14 Jul 2021 14:13:52 +0200 Subject: [PATCH 11/23] Docker: Make temporary messages shorter Kinder to the translators. Change-Id: If9c7eb265b2f86fec274e9db7b0d76424cd703cc Reviewed-by: Christian Stenger --- src/plugins/docker/dockerdevice.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index 7ac6646333c..4f366fbe3fb 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -715,12 +715,13 @@ void DockerDevicePrivate::tryCreateLocalFileAccess() .arg(m_container, m_mergedDir) + '\n' + tr("Output: '%1'").arg(out) + '\n' + tr("Error: '%1'").arg(proc.stdErr())); - if (HostOsInfo::isWindowsHost()) { // TODO investigate how to make it possible nevertheless + if (HostOsInfo::isWindowsHost()) { + // Disabling merged layer access. This is not supported and anything + // related to accessing merged layers on Windows fails due to the need + // of using wsl or a named pipe. + // TODO investigate how to make it possible nevertheless. m_mergedDir.clear(); - MessageManager::writeSilently( - tr("Disabling merged channel access. This is not supported and anything " - "related to accessing merged channels on Windows fails due to the need " - "of using wsl or a named pipe.")); + MessageManager::writeSilently(tr("This is expected on Windows.")); return; } } From f8c7d2e848f6f5fae527a7b8f67360a7988da947 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 13 Jul 2021 13:05:36 +0200 Subject: [PATCH 12/23] Docker: Rework auto-detection and removal of kit items - Use more uniform messages for the different kinds of items - Remove all auto-detected items Change-Id: I0b0df0bca484337039432b163bd8e19593b1cd22 Reviewed-by: Christian Stenger --- .../cmakekitinformation.cpp | 7 +- .../cmakeprojectmanager/cmakesettingspage.cpp | 11 ++- src/plugins/cmakeprojectmanager/cmaketool.cpp | 3 + src/plugins/cmakeprojectmanager/cmaketool.h | 2 + .../cmakeprojectmanager/cmaketoolmanager.cpp | 23 +++++- .../cmakeprojectmanager/cmaketoolmanager.h | 1 + src/plugins/debugger/debuggeritemmanager.cpp | 37 ++++++++- src/plugins/debugger/debuggeritemmanager.h | 4 +- src/plugins/debugger/debuggerplugin.cpp | 11 ++- src/plugins/debugger/debuggerplugin.h | 7 +- src/plugins/docker/dockerdevice.cpp | 78 +++++++++++++------ 11 files changed, 143 insertions(+), 41 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp index 1a279e93adc..ea9fa55db01 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp +++ b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp @@ -277,9 +277,10 @@ void CMakeKitAspect::setup(Kit *k) return; // Look for a suitable auto-detected one: - const QString id = k->autoDetectionSource(); + const QString kitSource = k->autoDetectionSource(); for (CMakeTool *tool : CMakeToolManager::cmakeTools()) { - if (tool->detectionSource() == id) { + const QString toolSource = tool->detectionSource(); + if (!toolSource.isEmpty() && toolSource == kitSource) { setCMakeTool(k, tool->id()); return; } @@ -1043,8 +1044,6 @@ CMakeConfig CMakeConfigurationKitAspect::defaultConfiguration(const Kit *k) QVariant CMakeConfigurationKitAspect::defaultValue(const Kit *k) const { - Q_UNUSED(k) - // FIXME: Convert preload scripts CMakeConfig config = defaultConfiguration(k); const QStringList tmp diff --git a/src/plugins/cmakeprojectmanager/cmakesettingspage.cpp b/src/plugins/cmakeprojectmanager/cmakesettingspage.cpp index 0d6430517bf..3e653c51405 100644 --- a/src/plugins/cmakeprojectmanager/cmakesettingspage.cpp +++ b/src/plugins/cmakeprojectmanager/cmakesettingspage.cpp @@ -110,6 +110,7 @@ public: , m_executable(item->filePath()) , m_qchFile(item->qchFilePath()) , m_versionDisplay(item->versionDisplay()) + , m_detectionSource(item->detectionSource()) , m_isAutoRun(item->isAutoRun()) , m_autodetected(item->isAutoDetected()) , m_isSupported(item->hasFileApi()) @@ -145,9 +146,10 @@ public: cmake.setFilePath(m_executable); m_isSupported = cmake.hasFileApi(); - m_tooltip = tr("Version: %1
Supports fileApi: %2") - .arg(cmake.versionDisplay()) - .arg(cmake.hasFileApi() ? tr("yes") : tr("no")); + m_tooltip = tr("Version: %1").arg(cmake.versionDisplay()); + m_tooltip += "
" + tr("Supports fileApi: %1").arg(m_isSupported ? tr("yes") : tr("no")); + m_tooltip += "
" + tr("Detection source: \"%1\"").arg(m_detectionSource); + m_versionDisplay = cmake.versionDisplay(); } @@ -223,6 +225,7 @@ public: FilePath m_executable; FilePath m_qchFile; QString m_versionDisplay; + QString m_detectionSource; bool m_isAutoRun = true; bool m_pathExists = false; bool m_pathIsFile = false; @@ -362,6 +365,7 @@ void CMakeToolItemModel::apply() cmake->setDisplayName(item->m_name); cmake->setFilePath(item->m_executable); cmake->setQchFilePath(item->m_qchFile); + cmake->setDetectionSource(item->m_detectionSource); cmake->setAutorun(item->m_isAutoRun); } else { toRegister.append(item); @@ -375,6 +379,7 @@ void CMakeToolItemModel::apply() cmake->setDisplayName(item->m_name); cmake->setFilePath(item->m_executable); cmake->setQchFilePath(item->m_qchFile); + cmake->setDetectionSource(item->m_detectionSource); if (!CMakeToolManager::registerCMakeTool(std::move(cmake))) item->m_changed = true; } diff --git a/src/plugins/cmakeprojectmanager/cmaketool.cpp b/src/plugins/cmakeprojectmanager/cmaketool.cpp index cf9e83bf1ca..51daa1bb5f3 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketool.cpp @@ -53,6 +53,7 @@ const char CMAKE_INFORMATION_QCH_FILE_PATH[] = "QchFile"; // obsolete since Qt Creator 5. Kept for backward compatibility const char CMAKE_INFORMATION_AUTO_CREATE_BUILD_DIRECTORY[] = "AutoCreateBuildDirectory"; const char CMAKE_INFORMATION_AUTODETECTED[] = "AutoDetected"; +const char CMAKE_INFORMATION_DETECTIONSOURCE[] = "DetectionSource"; const char CMAKE_INFORMATION_READERTYPE[] = "ReaderType"; bool CMakeTool::Generator::matches(const QString &n, const QString &ex) const @@ -132,6 +133,7 @@ CMakeTool::CMakeTool(const QVariantMap &map, bool fromSdk) : //loading a CMakeTool from SDK is always autodetection if (!fromSdk) m_isAutoDetected = map.value(CMAKE_INFORMATION_AUTODETECTED, false).toBool(); + m_detectionSource = map.value(CMAKE_INFORMATION_DETECTIONSOURCE).toString(); setFilePath(FilePath::fromString(map.value(CMAKE_INFORMATION_COMMAND).toString())); @@ -209,6 +211,7 @@ QVariantMap CMakeTool::toMap() const data.insert(CMAKE_INFORMATION_READERTYPE, Internal::readerTypeToString(m_readerType.value())); data.insert(CMAKE_INFORMATION_AUTODETECTED, m_isAutoDetected); + data.insert(CMAKE_INFORMATION_DETECTIONSOURCE, m_detectionSource); return data; } diff --git a/src/plugins/cmakeprojectmanager/cmaketool.h b/src/plugins/cmakeprojectmanager/cmaketool.h index 62b5c9964ce..c45fb7514db 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.h +++ b/src/plugins/cmakeprojectmanager/cmaketool.h @@ -122,6 +122,8 @@ private: void fetchFromCapabilities() const; void parseFromCapabilities(const QString &input) const; + // Note: New items here need also be handled in CMakeToolItemModel::apply() + // FIXME: Use a saner approach. Utils::Id m_id; QString m_displayName; Utils::FilePath m_executable; diff --git a/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp b/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp index 348b1de7627..55b47891e4a 100644 --- a/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp @@ -184,14 +184,14 @@ void CMakeToolManager::autoDetectCMakeForDevice(const FilePath &deviceRoot, const QString &detectionSource, QString *logMessage) { - QStringList messages; + QStringList messages{tr("Searching CMake binaries...")}; const FilePaths candidates = {FilePath::fromString("cmake").onDevice(deviceRoot)}; const Environment env = deviceRoot.deviceEnvironment(); for (const FilePath &candidate : candidates) { const FilePath cmake = candidate.searchOnDevice(env.path()); if (!cmake.isEmpty()) { registerCMakeByPath(cmake, detectionSource); - messages.append(tr("Found CMake binary: %1").arg(cmake.toUserOutput())); + messages.append(tr("Found \"%1\"").arg(cmake.toUserOutput())); } } if (logMessage) @@ -209,11 +209,28 @@ void CMakeToolManager::registerCMakeByPath(const FilePath &cmakePath, const QStr auto newTool = std::make_unique(CMakeTool::ManualDetection, id); newTool->setFilePath(cmakePath); - newTool->setDisplayName(cmakePath.toUserOutput()); newTool->setDetectionSource(detectionSource); + newTool->setDisplayName(cmakePath.toUserOutput()); registerCMakeTool(std::move(newTool)); } +void CMakeToolManager::removeDetectedCMake(const QString &detectionSource, QString *logMessage) +{ + QStringList logMessages{tr("Removing CMake entries...")}; + while (true) { + auto toRemove = Utils::take(d->m_cmakeTools, Utils::equal(&CMakeTool::detectionSource, detectionSource)); + if (!toRemove.has_value()) + break; + logMessages.append(tr("Removed \"%1\"").arg((*toRemove)->displayName())); + emit m_instance->cmakeRemoved((*toRemove)->id()); + } + + ensureDefaultCMakeToolIsValid(); + updateDocumentation(); + if (logMessage) + *logMessage = logMessages.join('\n'); +} + void CMakeToolManager::notifyAboutUpdate(CMakeTool *tool) { if (!tool || !Utils::contains(d->m_cmakeTools, tool)) diff --git a/src/plugins/cmakeprojectmanager/cmaketoolmanager.h b/src/plugins/cmakeprojectmanager/cmaketoolmanager.h index 9497192873d..3c3dfa8f84f 100644 --- a/src/plugins/cmakeprojectmanager/cmaketoolmanager.h +++ b/src/plugins/cmakeprojectmanager/cmaketoolmanager.h @@ -68,6 +68,7 @@ public slots: QString *logMessage); void registerCMakeByPath(const Utils::FilePath &cmakePath, const QString &detectionSource); + void removeDetectedCMake(const QString &detectionSource, QString *logMessage); signals: void cmakeAdded (const Utils::Id &id); diff --git a/src/plugins/debugger/debuggeritemmanager.cpp b/src/plugins/debugger/debuggeritemmanager.cpp index 33a04cf7c41..fd0bfd91178 100644 --- a/src/plugins/debugger/debuggeritemmanager.cpp +++ b/src/plugins/debugger/debuggeritemmanager.cpp @@ -92,7 +92,9 @@ public: QVariant registerDebugger(const DebuggerItem &item); void readDebuggers(const FilePath &fileName, bool isSystem); void autoDetectCdbDebuggers(); - void autoDetectGdbOrLldbDebuggers(const FilePath &deviceRoot, const QString &detectionSource); + void autoDetectGdbOrLldbDebuggers(const FilePath &deviceRoot, + const QString &detectionSource, + QString *logMessage = nullptr); void autoDetectUvscDebuggers(); QString uniqueDisplayName(const QString &base); @@ -715,7 +717,8 @@ static Utils::FilePaths searchGdbPathsFromRegistry() } void DebuggerItemManagerPrivate::autoDetectGdbOrLldbDebuggers(const FilePath &deviceRoot, - const QString &detectionSource) + const QString &detectionSource, + QString *logMessage) { const QStringList filters = {"gdb-i686-pc-mingw32", "gdb-i686-pc-mingw32.exe", "gdb", "gdb.exe", "lldb", "lldb.exe", "lldb-[1-9]*", @@ -773,6 +776,7 @@ void DebuggerItemManagerPrivate::autoDetectGdbOrLldbDebuggers(const FilePath &de suspects.append(device->directoryEntries(globalPath, filters, QDir::Files | QDir::Executable)); } + QStringList logMessages{tr("Searching debuggers...")}; for (const FilePath &command : qAsConst(suspects)) { const auto commandMatches = [command](const DebuggerTreeItem *titem) { return titem->m_item.command() == command; @@ -796,7 +800,10 @@ void DebuggerItemManagerPrivate::autoDetectGdbOrLldbDebuggers(const FilePath &de const QString name = detectionSource.isEmpty() ? tr("System %1 at %2") : tr("Detected %1 at %2"); item.setUnexpandedDisplayName(name.arg(item.engineTypeName()).arg(command.toUserOutput())); m_model->addDebugger(item); + logMessages.append(tr("Found: \"%1\"").arg(name)); } + if (logMessage) + *logMessage = logMessages.join('\n'); } void DebuggerItemManagerPrivate::autoDetectUvscDebuggers() @@ -1030,9 +1037,31 @@ void DebuggerItemManager::deregisterDebugger(const QVariant &id) } void DebuggerItemManager::autoDetectDebuggersForDevice(const FilePath &deviceRoot, - const QString &detectionSource) + const QString &detectionSource, + QString *logMessage) { - d->autoDetectGdbOrLldbDebuggers(deviceRoot, detectionSource); + d->autoDetectGdbOrLldbDebuggers(deviceRoot, detectionSource, logMessage); +} + +void DebuggerItemManager::removeDetectedDebuggers(const QString &detectionSource, + QString *logMessage) +{ + QStringList logMessages{tr("Removing debugger entries...")}; + d->m_model->forItemsAtLevel<2>([detectionSource, &logMessages](DebuggerTreeItem *titem) { + if (titem->m_item.detectionSource() == detectionSource) { + logMessages.append(tr("Removed \"%1\"").arg(titem->m_item.displayName())); + d->m_model->destroyItem(titem); + return; + } + // FIXME: These items appeared in early docker development. Ok to remove for Creator 7.0. + FilePath filePath = titem->m_item.command(); + if (filePath.scheme() + ':' + filePath.host() == detectionSource) { + logMessages.append(tr("Removed \"%1\"").arg(titem->m_item.displayName())); + d->m_model->destroyItem(titem); + } + }); + if (logMessage) + *logMessage = logMessages.join('\n'); } } // namespace Debugger diff --git a/src/plugins/debugger/debuggeritemmanager.h b/src/plugins/debugger/debuggeritemmanager.h index 221ecf72bdb..e8d8cba42b1 100644 --- a/src/plugins/debugger/debuggeritemmanager.h +++ b/src/plugins/debugger/debuggeritemmanager.h @@ -53,7 +53,9 @@ public: static void deregisterDebugger(const QVariant &id); static void autoDetectDebuggersForDevice(const Utils::FilePath &deviceRoot, - const QString &detectionSource); + const QString &detectionSource, + QString *logMessage); + static void removeDetectedDebuggers(const QString &detectionSource, QString *logMessage); static const DebuggerItem *findByCommand(const Utils::FilePath &command); static const DebuggerItem *findById(const QVariant &id); diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index e9a6c2d22ba..442fb2db24e 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -724,6 +724,7 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments) { qRegisterMetaType("ContextData"); qRegisterMetaType("DebuggerRunParameters"); + qRegisterMetaType(); // Menu groups ActionContainer *mstart = ActionManager::actionContainer(PE::M_DEBUG_STARTDEBUGGING); @@ -1747,9 +1748,15 @@ void DebuggerPlugin::getEnginesState(QByteArray *json) const } void DebuggerPlugin::autoDetectDebuggersForDevice(const FilePath &deviceRoot, - const QString &detectionId) + const QString &detectionSource, + QString *logMessage) { - dd->m_debuggerItemManager.autoDetectDebuggersForDevice(deviceRoot, detectionId); + dd->m_debuggerItemManager.autoDetectDebuggersForDevice(deviceRoot, detectionSource, logMessage); +} + +void DebuggerPlugin::removeDetectedDebuggers(const QString &detectionSource, QString *logMessage) +{ + dd->m_debuggerItemManager.removeDetectedDebuggers(detectionSource, logMessage); } void DebuggerPluginPrivate::attachToQmlPort() diff --git a/src/plugins/debugger/debuggerplugin.h b/src/plugins/debugger/debuggerplugin.h index 8ef79ed48fd..4d4efda0f38 100644 --- a/src/plugins/debugger/debuggerplugin.h +++ b/src/plugins/debugger/debuggerplugin.h @@ -59,10 +59,15 @@ private: Q_SLOT void getEnginesState(QByteArray *json) const; // Called from DockerDevice - Q_SLOT void autoDetectDebuggersForDevice(const Utils::FilePath &deviceRoot, const QString &detectionId); + Q_SLOT void autoDetectDebuggersForDevice(const Utils::FilePath &deviceRoot, + const QString &detectionId, + QString *logMessage); + Q_SLOT void removeDetectedDebuggers(const QString &detectionId, QString *logMessage); QVector createTestObjects() const override; }; } // namespace Internal } // namespace Debugger + +Q_DECLARE_METATYPE(QString *) diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index 4f366fbe3fb..b533c67d335 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -471,26 +471,54 @@ DockerDeviceData &DockerDevice::data() void KitDetectorPrivate::undoAutoDetect() const { + emit q->logOutput(tr("Start removing auto-detected items associated with this docker image.")); + + emit q->logOutput('\n' + tr("Removing kits...")); for (Kit *kit : KitManager::kits()) { if (kit->autoDetectionSource() == m_sharedId) { - emit q->logOutput(tr("Removing kit: %1").arg(kit->displayName())); + emit q->logOutput(tr("Removed \"%1\"").arg(kit->displayName())); KitManager::deregisterKit(kit); } }; + + emit q->logOutput('\n' + tr("Removing Qt version entries...")); for (BaseQtVersion *qtVersion : QtVersionManager::versions()) { if (qtVersion->detectionSource() == m_sharedId) { - emit q->logOutput(tr("Removing Qt version: %1").arg(qtVersion->displayName())); + emit q->logOutput(tr("Removed \"%1\"").arg(qtVersion->displayName())); QtVersionManager::removeVersion(qtVersion); } }; - emit q->logOutput(tr("Tool chains not removed.")); - // for (ToolChain *toolChain : ToolChainManager::toolChains()) { - // if (toolChain->autoDetectionSource() == id.toString()) - // // FIXME: Implement - // }; + emit q->logOutput('\n' + tr("Removing toolchain entries...")); + for (ToolChain *toolChain : ToolChainManager::toolChains()) { + QString detectionSource = toolChain->detectionSource(); + if (toolChain->detectionSource() == m_sharedId) { + emit q->logOutput(tr("Removed \"%1\"").arg(toolChain->displayName())); + ToolChainManager::deregisterToolChain(toolChain); + } + }; - emit q->logOutput(tr("Removal of previously auto-detected kit items finished.") + '\n'); + if (QObject *cmakeManager = ExtensionSystem::PluginManager::getObjectByName("CMakeToolManager")) { + QString logMessage; + const bool res = QMetaObject::invokeMethod(cmakeManager, + "removeDetectedCMake", + Q_ARG(QString, m_sharedId), + Q_ARG(QString *, &logMessage)); + QTC_CHECK(res); + emit q->logOutput('\n' + logMessage); + } + + if (QObject *debuggerPlugin = ExtensionSystem::PluginManager::getObjectByName("DebuggerPlugin")) { + QString logMessage; + const bool res = QMetaObject::invokeMethod(debuggerPlugin, + "removeDetectedDebuggers", + Q_ARG(QString, m_sharedId), + Q_ARG(QString *, &logMessage)); + QTC_CHECK(res); + emit q->logOutput('\n' + logMessage); + } + + emit q->logOutput('\n' + tr("Removal of previously auto-detected kit items finished.") + "\n\n"); } QList KitDetectorPrivate::autoDetectQtVersions() const @@ -510,7 +538,7 @@ QList KitDetectorPrivate::autoDetectQtVersions() const continue; qtVersions.append(qtVersion); QtVersionManager::addVersion(qtVersion); - emit q->logOutput(tr("Found Qt: %1").arg(qtVersion->qmakeFilePath().toUserOutput())); + emit q->logOutput(tr("Found \"%1\"").arg(qtVersion->qmakeFilePath().toUserOutput())); } if (qtVersions.isEmpty()) emit q->logOutput(tr("No Qt installation found.")); @@ -521,21 +549,24 @@ QList KitDetectorPrivate::autoDetectToolChains() { const QList factories = ToolChainFactory::allToolChainFactories(); - QList toolChains; + QList alreadyKnown = ToolChainManager::toolChains(); + QList allNewToolChains; QApplication::processEvents(); - emit q->logOutput('\n' + tr("Searching tool chains...")); + emit q->logOutput('\n' + tr("Searching toolchains...")); for (ToolChainFactory *factory : factories) { - const QList newToolChains = factory->autoDetect(toolChains, m_device.constCast()); - emit q->logOutput(tr("Searching tool chains of type %1").arg(factory->displayName())); + emit q->logOutput(tr("Searching toolchains of type %1").arg(factory->displayName())); + const QList newToolChains = factory->autoDetect(alreadyKnown, m_device.constCast()); for (ToolChain *toolChain : newToolChains) { - emit q->logOutput(tr("Found tool chain: %1").arg(toolChain->compilerCommand().toUserOutput())); + emit q->logOutput(tr("Found \"%1\"").arg(toolChain->compilerCommand().toUserOutput())); + toolChain->setDetectionSource(m_sharedId); ToolChainManager::registerToolChain(toolChain); - toolChains.append(toolChain); + alreadyKnown.append(toolChain); } + allNewToolChains.append(newToolChains); } - emit q->logOutput(tr("%1 new tool chains found.").arg(toolChains.size())); + emit q->logOutput(tr("%1 new toolchains found.").arg(allNewToolChains.size())); - return toolChains; + return allNewToolChains; } void KitDetectorPrivate::autoDetectCMake() @@ -544,16 +575,15 @@ void KitDetectorPrivate::autoDetectCMake() if (!cmakeManager) return; - emit q->logOutput('\n' + tr("Searching CMake binary...")); const FilePath deviceRoot = m_device->mapToGlobalPath({}); - QString error; + QString logMessage; const bool res = QMetaObject::invokeMethod(cmakeManager, "autoDetectCMakeForDevice", Q_ARG(Utils::FilePath, deviceRoot), Q_ARG(QString, m_sharedId), - Q_ARG(QString *, &error)); + Q_ARG(QString *, &logMessage)); QTC_CHECK(res); - emit q->logOutput(error); + emit q->logOutput('\n' + logMessage); } void KitDetectorPrivate::autoDetectDebugger() @@ -562,13 +592,15 @@ void KitDetectorPrivate::autoDetectDebugger() if (!debuggerPlugin) return; - emit q->logOutput('\n' + tr("Searching debuggers...")); const FilePath deviceRoot = m_device->mapToGlobalPath({}); + QString logMessage; const bool res = QMetaObject::invokeMethod(debuggerPlugin, "autoDetectDebuggersForDevice", Q_ARG(Utils::FilePath, deviceRoot), - Q_ARG(QString, m_sharedId)); + Q_ARG(QString, m_sharedId), + Q_ARG(QString *, &logMessage)); QTC_CHECK(res); + emit q->logOutput('\n' + logMessage); } void KitDetectorPrivate::autoDetect() From 5c5e9bd339dddf91a07bfaa7350d7f01e75f12a7 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 14 Jul 2021 11:23:29 +0200 Subject: [PATCH 13/23] LanguageClient: reset assigned documents on shutdown request Allows to reassign the documents to another server before the old server is completely shutdown. Change-Id: I20538c317a7664523f55073736eb22d96def8df8 Reviewed-by: Christian Kandeler --- .../languageclient/languageclientmanager.cpp | 37 ++++++++++++------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/src/plugins/languageclient/languageclientmanager.cpp b/src/plugins/languageclient/languageclientmanager.cpp index 24afdaac643..a2ae95a1fad 100644 --- a/src/plugins/languageclient/languageclientmanager.cpp +++ b/src/plugins/languageclient/languageclientmanager.cpp @@ -137,21 +137,28 @@ void LanguageClientManager::clientFinished(Client *client) constexpr int restartTimeoutS = 5; const bool unexpectedFinish = client->state() != Client::Shutdown && client->state() != Client::ShutdownRequested; - if (unexpectedFinish && !managerInstance->m_shuttingDown && client->reset()) { - client->disconnect(managerInstance); - client->log(tr("Unexpectedly finished. Restarting in %1 seconds.").arg(restartTimeoutS)); - QTimer::singleShot(restartTimeoutS * 1000, client, [client]() { client->start(); }); - for (TextEditor::TextDocument *document : managerInstance->m_clientForDocument.keys(client)) - client->deactivateDocument(document); - } else { - if (unexpectedFinish && !managerInstance->m_shuttingDown) + + if (unexpectedFinish) { + if (!managerInstance->m_shuttingDown) { + const QList &clientDocs + = managerInstance->m_clientForDocument.keys(client); + if (client->reset()) { + client->disconnect(managerInstance); + client->log( + tr("Unexpectedly finished. Restarting in %1 seconds.").arg(restartTimeoutS)); + QTimer::singleShot(restartTimeoutS * 1000, client, [client]() { client->start(); }); + for (TextEditor::TextDocument *document : clientDocs) + client->deactivateDocument(document); + return; + } client->log(tr("Unexpectedly finished.")); - for (TextEditor::TextDocument *document : managerInstance->m_clientForDocument.keys(client)) - managerInstance->m_clientForDocument.remove(document); - deleteClient(client); - if (managerInstance->m_shuttingDown && managerInstance->m_clients.isEmpty()) - emit managerInstance->shutdownFinished(); + for (TextEditor::TextDocument *document : clientDocs) + managerInstance->m_clientForDocument.remove(document); + } } + deleteClient(client); + if (managerInstance->m_shuttingDown && managerInstance->m_clients.isEmpty()) + emit managerInstance->shutdownFinished(); } Client *LanguageClientManager::startClient(BaseSettings *setting, ProjectExplorer::Project *project) @@ -193,6 +200,10 @@ void LanguageClientManager::shutdownClient(Client *client) { if (!client) return; + // reset the documents for that client already when requesting the shutdown so they can get + // reassigned to another server right after this request to another server + for (TextEditor::TextDocument *document : managerInstance->m_clientForDocument.keys(client)) + managerInstance->m_clientForDocument.remove(document); if (client->reachable()) client->shutdown(); else if (client->state() != Client::Shutdown && client->state() != Client::ShutdownRequested) From b0e0b3ecda895d1bf8eb8607b4fda16fe4aad472 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 14 Jul 2021 15:20:37 +0200 Subject: [PATCH 14/23] CMakePM: Use Utils::FilePath for accessing cmake tools When storing the cmake tools we otherwise drop auto detected ones when failing to access them locally. This makes the cmake tools on docker devices persist on Windows as long the docker daemon is running. Change-Id: I5235cf00aff49359a2e20ddc1667bcbb99337092 Reviewed-by: hjk --- src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp b/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp index b1dde077b67..6e38e67a0d0 100644 --- a/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp @@ -211,9 +211,9 @@ void CMakeToolSettingsAccessor::saveCMakeTools(const QList &cmakeTo int count = 0; for (const CMakeTool *item : cmakeTools) { - QFileInfo fi = item->cmakeExecutable().toFileInfo(); + Utils::FilePath fi = item->cmakeExecutable(); - if (fi.isExecutable()) { + if (fi.isExecutableFile()) { QVariantMap tmp = item->toMap(); if (tmp.isEmpty()) continue; From 3cdeb1a119c767e2090499a93773064f3926df89 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 14 Jul 2021 15:13:41 +0200 Subject: [PATCH 15/23] Utils: Fix FileChooser error marking for directories Amends b84c8cf892e. Change-Id: I108110cc682d331947c8eb47f62121ed02cd45f9 Reviewed-by: Christian Stenger --- src/libs/utils/pathchooser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/utils/pathchooser.cpp b/src/libs/utils/pathchooser.cpp index 3f658ea4812..f167cf6c6f0 100644 --- a/src/libs/utils/pathchooser.cpp +++ b/src/libs/utils/pathchooser.cpp @@ -582,7 +582,7 @@ bool PathChooser::validatePath(FancyLineEdit *edit, QString *errorMessage) const } break; case PathChooser::Directory: - if (filePath.isDir()) { + if (filePath.exists() && !filePath.isDir()) { if (errorMessage) *errorMessage = tr("The path \"%1\" is not a directory.").arg(filePath.toUserOutput()); return false; From 098e616512d6b171a382ed1990b7125b4bdfce3d Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 14 Jul 2021 15:26:56 +0200 Subject: [PATCH 16/23] CMake: Fix restoration of remote cmake tools So far this only worked accidentally for cases where a local cmake was available in a similar place. Change-Id: I089d2774b3fde00cf369b5524bb98023b6f1aadb Reviewed-by: Christian Stenger --- src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp b/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp index 6e38e67a0d0..315fc6878dd 100644 --- a/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp @@ -239,7 +239,7 @@ CMakeToolSettingsAccessor::cmakeTools(const QVariantMap &data, bool fromSdk) con const QVariantMap dbMap = data.value(key).toMap(); auto item = std::make_unique(dbMap, fromSdk); - if (item->isAutoDetected() && !item->cmakeExecutable().toFileInfo().isExecutable()) { + if (item->isAutoDetected() && !item->cmakeExecutable().isExecutableFile()) { qWarning() << QString::fromLatin1("CMakeTool \"%1\" (%2) dropped since the command is not executable.") .arg(item->cmakeExecutable().toUserOutput(), item->id().toString()); continue; From 426f8185c2bc707238f5ee316262e96db63d3853 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 13 Jul 2021 16:58:02 +0200 Subject: [PATCH 17/23] ProjectTree: Improve performance of finding nodes Using projectNode->forEachGenericNode(...) to find a node is much slower than using project->nodeForFilePath(...), since the latter uses a binary search. Fixes: QTCREATORBUG-25845 Change-Id: I91be577a11b03915d1f21fe86a4cdd9ab0381f51 Reviewed-by: Christian Kandeler --- src/plugins/projectexplorer/project.cpp | 2 +- src/plugins/projectexplorer/project.h | 2 +- src/plugins/projectexplorer/projecttree.cpp | 17 ++++++++--------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index 7064e47204a..25fe115afd3 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -851,7 +851,7 @@ bool Project::isKnownFile(const Utils::FilePath &filename) const } const Node *Project::nodeForFilePath(const Utils::FilePath &filePath, - const Project::NodeMatcher &extraMatcher) + const Project::NodeMatcher &extraMatcher) const { const FileNode dummy(filePath, FileType::Unknown); const auto range = std::equal_range(d->m_sortedNodeList.cbegin(), d->m_sortedNodeList.cend(), diff --git a/src/plugins/projectexplorer/project.h b/src/plugins/projectexplorer/project.h index 9b783b7127c..7eca3cc0645 100644 --- a/src/plugins/projectexplorer/project.h +++ b/src/plugins/projectexplorer/project.h @@ -128,7 +128,7 @@ public: Utils::FilePaths files(const NodeMatcher &matcher) const; bool isKnownFile(const Utils::FilePath &filename) const; const Node *nodeForFilePath(const Utils::FilePath &filePath, - const NodeMatcher &extraMatcher = {}); + const NodeMatcher &extraMatcher = {}) const; virtual QVariantMap toMap() const; diff --git a/src/plugins/projectexplorer/projecttree.cpp b/src/plugins/projectexplorer/projecttree.cpp index e94dcb602c2..22e0ee88d0c 100644 --- a/src/plugins/projectexplorer/projecttree.cpp +++ b/src/plugins/projectexplorer/projecttree.cpp @@ -458,15 +458,14 @@ Node *ProjectTree::nodeForFile(const FilePath &fileName) { Node *node = nullptr; for (const Project *project : SessionManager::projects()) { - if (ProjectNode *projectNode = project->rootProjectNode()) { - projectNode->forEachGenericNode([&](Node *n) { - if (n->filePath() == fileName) { - // prefer file nodes - if (!node || (!node->asFileNode() && n->asFileNode())) - node = n; - } - }); - } + project->nodeForFilePath(fileName, [&](const Node *n) { + if (!node || (!node->asFileNode() && n->asFileNode())) + node = const_cast(n); + return false; + }); + // early return: + if (node && node->asFileNode()) + return node; } return node; } From 86149d9299e3f9b3b4eac0f0291261ab706388fa Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 14 Jul 2021 15:31:22 +0200 Subject: [PATCH 18/23] Utils: Avoid a use of FilePath::toFileInfo() in FileInProjectFinder Doesn't work with remote files. Change-Id: I04a837013520f4f872599d0bb957c6da7ad9bf02 Reviewed-by: Christian Stenger --- src/libs/utils/fileinprojectfinder.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libs/utils/fileinprojectfinder.cpp b/src/libs/utils/fileinprojectfinder.cpp index 0d41433adaa..af95c47ecdd 100644 --- a/src/libs/utils/fileinprojectfinder.cpp +++ b/src/libs/utils/fileinprojectfinder.cpp @@ -88,9 +88,8 @@ void FileInProjectFinder::setProjectDirectory(const FilePath &absoluteProjectPat if (absoluteProjectPath == m_projectDir) return; - const QFileInfo infoPath = absoluteProjectPath.toFileInfo(); QTC_CHECK(absoluteProjectPath.isEmpty() - || (infoPath.exists() && infoPath.isAbsolute())); + || (absoluteProjectPath.exists() && absoluteProjectPath.isAbsolutePath())); m_projectDir = absoluteProjectPath; m_cache.clear(); From cc1375baa10575000507ac2b51f70d4c9aa020a9 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 12 Jul 2021 13:04:00 +0200 Subject: [PATCH 19/23] Wasm: Only detect toolchains from the emsdk installation device Change-Id: I910365c6e02e714adf1a233b42df86110cf65a0a Reviewed-by: Alessandro Portale --- src/plugins/webassembly/webassemblytoolchain.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/plugins/webassembly/webassemblytoolchain.cpp b/src/plugins/webassembly/webassemblytoolchain.cpp index c7755db21eb..276b324ba64 100644 --- a/src/plugins/webassembly/webassemblytoolchain.cpp +++ b/src/plugins/webassembly/webassemblytoolchain.cpp @@ -168,6 +168,13 @@ QList WebAssemblyToolChainFactory::autoDetect( if (!WebAssemblyEmSdk::isValid(sdk)) return {}; + if (device) { + // Only detect toolchains from the emsdk installation device + const FilePath deviceRoot = device->mapToGlobalPath({}); + if (deviceRoot.host() != sdk.host()) + return {}; + } + Environment env = sdk.deviceEnvironment(); WebAssemblyEmSdk::addToEnvironment(sdk, env); From 30f6084f0d3c803c785ec7e5e4e55b40ccb62f07 Mon Sep 17 00:00:00 2001 From: Knud Dollereder Date: Wed, 14 Jul 2021 16:12:23 +0200 Subject: [PATCH 20/23] Execute pixmapChangedCommands only if items have changed This patch prevents continuous image updates by making sure to only execute pixmapChangedCommnds if an item is dirty. Change-Id: Icadc1d8a2a2298d18147b31fbed3fbc4205f0ea8 Reviewed-by: Thomas Hartmann --- .../instances/qt5rendernodeinstanceserver.cpp | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5rendernodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5rendernodeinstanceserver.cpp index bb1aa724450..63dba600d50 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5rendernodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5rendernodeinstanceserver.cpp @@ -77,17 +77,25 @@ void Qt5RenderNodeInstanceServer::collectItemChangesAndSendChangeCommands() DesignerSupport::polishItems(quickWindow()); if (quickWindow() && nodeInstanceClient()->bytesToWrite() < 10000) { + bool windowDirty = false; foreach (QQuickItem *item, allItems()) { if (item) { - if (hasInstanceForObject(item)) { + if (Internal::QuickItemNodeInstance::unifiedRenderPath()) { + if (DesignerSupport::isDirty(item, DesignerSupport::AllMask)) { + windowDirty = true; + break; + } + } else { + if (hasInstanceForObject(item)) { if (DesignerSupport::isDirty(item, DesignerSupport::ContentUpdateMask)) m_dirtyInstanceSet.insert(instanceForObject(item)); - } else if (DesignerSupport::isDirty(item, DesignerSupport::AllMask)) { - ServerNodeInstance ancestorInstance = findNodeInstanceForItem(item->parentItem()); - if (ancestorInstance.isValid()) - m_dirtyInstanceSet.insert(ancestorInstance); + } else if (DesignerSupport::isDirty(item, DesignerSupport::AllMask)) { + ServerNodeInstance ancestorInstance = findNodeInstanceForItem(item->parentItem()); + if (ancestorInstance.isValid()) + m_dirtyInstanceSet.insert(ancestorInstance); + } + Internal::QuickItemNodeInstance::updateDirtyNode(item); } - Internal::QuickItemNodeInstance::updateDirtyNode(item); } } @@ -97,7 +105,8 @@ void Qt5RenderNodeInstanceServer::collectItemChangesAndSendChangeCommands() /* QQuickItem::grabToImage render path */ /* TODO implement QQuickItem::grabToImage based rendering */ /* sheduleRootItemRender(); */ - nodeInstanceClient()->pixmapChanged(createPixmapChangedCommand({rootNodeInstance()})); + if (windowDirty) + nodeInstanceClient()->pixmapChanged(createPixmapChangedCommand({rootNodeInstance()})); } else { if (!m_dirtyInstanceSet.isEmpty()) { nodeInstanceClient()->pixmapChanged( From 75aa1f2a6c9a765225403c0b949f5b8ff38b60df Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 23 Jun 2021 12:45:21 +0200 Subject: [PATCH 21/23] Tests: Expect fail Amends ada39349a2a. Change-Id: I4221590941ba17e28fff1d12bb0c80d92ecac911 Reviewed-by: hjk --- tests/auto/utils/qtcprocess/tst_qtcprocess.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/utils/qtcprocess/tst_qtcprocess.cpp b/tests/auto/utils/qtcprocess/tst_qtcprocess.cpp index bfc19049f60..12f404f5043 100644 --- a/tests/auto/utils/qtcprocess/tst_qtcprocess.cpp +++ b/tests/auto/utils/qtcprocess/tst_qtcprocess.cpp @@ -897,7 +897,7 @@ void tst_QtcProcess::runBlockingStdOut() // with interactive cli tools. QEXPECT_FAIL("Unterminated stdout lost: early timeout", "", Continue); QVERIFY2(sp.result() != QtcProcess::Hang, "Process run did not time out."); - + QEXPECT_FAIL("Unterminated stdout lost: early timeout", "", Continue); QVERIFY2(readLastLine, "Last line was read."); } From 7bba3f7d6f9acae0cd8fbecf3d844bf710d4f648 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 14 Jul 2021 10:12:46 +0200 Subject: [PATCH 22/23] Utils: Remove odd check from FilePath::resolvePath Change-Id: I824b2abd722da1e6a240394bee6578ffb028fb17 Reviewed-by: Christian Stenger --- src/libs/utils/fileutils.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/libs/utils/fileutils.cpp b/src/libs/utils/fileutils.cpp index ca397b0c0d4..9f8c7f67d5a 100644 --- a/src/libs/utils/fileutils.cpp +++ b/src/libs/utils/fileutils.cpp @@ -388,8 +388,6 @@ bool FilePath::isRelativePath() const FilePath FilePath::resolvePath(const QString &fileName) const { - if (fileName.isEmpty()) - return {}; // FIXME: Isn't this odd? if (FileUtils::isAbsolutePath(fileName)) return FilePath::fromString(QDir::cleanPath(fileName)); return FilePath::fromString(QDir::cleanPath(toString() + QLatin1Char('/') + fileName)); From 4103dfd6c26801286afc141338689bfbdace8f4d Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 15 Jul 2021 08:17:38 +0200 Subject: [PATCH 23/23] AutoTest: Ensure we construct a file path The original check that prevented constructing a directory will be removed. Change-Id: Ifb7960bfc245b120513ef65a1764ca60c5108093 Reviewed-by: hjk --- src/plugins/autotest/testoutputreader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/autotest/testoutputreader.cpp b/src/plugins/autotest/testoutputreader.cpp index ada972d094a..f2ad3bff054 100644 --- a/src/plugins/autotest/testoutputreader.cpp +++ b/src/plugins/autotest/testoutputreader.cpp @@ -42,7 +42,7 @@ Utils::FilePath TestOutputReader::constructSourceFilePath(const Utils::FilePath const QString &file) { const Utils::FilePath filePath = path.resolvePath(file); - return filePath.exists() ? filePath : Utils::FilePath(); + return filePath.isReadableFile() ? filePath : Utils::FilePath(); } TestOutputReader::TestOutputReader(const QFutureInterface &futureInterface,