From 92139f18b0ce0d6906f31fcf51913fb2e27c431e Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Thu, 18 Jun 2020 19:03:44 +0200 Subject: [PATCH 1/5] McuSupport: Improve version checking, support Desktop-only installation Due to the missing .json file for desktop targets, the Desktop target was only listed in the target chooser if at least one hardware target (which do have .json files) was installed in the SDK. This prevented using of Desktop-only Qt for MCUs installations. This change causes the Desktop target to be listed if the respective library exists. With a Desktop-only Qt for MCUs installation, this means that we blindly trust that the selected Qt for MCUs SDK version is supported. On the other hand we make the version checking stricter (in case we do find .json files). If the version of one targets does not match, the whole SDK installation is deemed invalid and no target is listed, also none for Desktop. Change-Id: I9d83b22255c19c5f8c6360e0b6137ce40311f8c4 Reviewed-by: Marco Bubke Reviewed-by: Alessandro Portale --- src/plugins/mcusupport/mcusupportsdk.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/mcusupport/mcusupportsdk.cpp b/src/plugins/mcusupport/mcusupportsdk.cpp index 7dd79679977..d87038c8a00 100644 --- a/src/plugins/mcusupport/mcusupportsdk.cpp +++ b/src/plugins/mcusupport/mcusupportsdk.cpp @@ -344,17 +344,17 @@ void targetsAndPackages(const Utils::FilePath &dir, QVector *packa const McuTargetDescription desc = parseDescriptionJson(file.readAll()); if (!McuSupportOptions::supportedQulVersion() .isPrefixOf(QVersionNumber::fromString(desc.qulVersion))) - continue; + return; // Invalid version means invalid SDK installation. descriptions.append(desc); } - if (!descriptions.isEmpty()) { - // Workaround for missing JSON file for Desktop target: + // Workaround for missing JSON file for Desktop target: + if (dir.pathAppended("/lib/QulQuickUltralite_QT_32bpp_Windows_Release.lib").exists()) { descriptions.prepend({McuSupportOptions::supportedQulVersion().toString(), {"Qt"}, {"Qt"}, {32}, {"desktop"}, {}, {}}); - - mcuTargets->append(targetsFromDescriptions(descriptions, packages)); } + + mcuTargets->append(targetsFromDescriptions(descriptions, packages)); } } // namespace Sdk From e78b5ff93610bb12891296483fe7b97e78504ec7 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Tue, 23 Jun 2020 12:18:51 +0200 Subject: [PATCH 2/5] German translation: Avoid ambiguous shortcut overload D clashes with "Datei". E clashes with "Erstellen". B clashes with "Bearbeiten". U clashes with "Auswahl in Kleinschreibung wandeln". Change-Id: I2ef93837fda1ba6e05d6dab2d6cc36fbddf23817 Reviewed-by: Friedemann Kleint --- share/qtcreator/translations/qtcreator_de.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/qtcreator/translations/qtcreator_de.ts b/share/qtcreator/translations/qtcreator_de.ts index 96de085da96..46a1322c4f2 100644 --- a/share/qtcreator/translations/qtcreator_de.ts +++ b/share/qtcreator/translations/qtcreator_de.ts @@ -6923,7 +6923,7 @@ konnte dem Projekt "%2" nicht hinzugefügt werden. &Debug - Deb&uggen + Debu&ggen &Start Debugging From 82bc519b7e3913cf62389b032c4fc91eec2a13b2 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Thu, 18 Jun 2020 18:38:53 +0200 Subject: [PATCH 3/5] McuSupport: Display the expected Qt for MCUs SDK version number Reduce the confusion around the Qt for MCUs version that is currently supported in this Qt Creator version. Change-Id: I21e88bfacc7502244aec49e829a1dfff0075226f Reviewed-by: hjk --- src/plugins/mcusupport/mcusupportsdk.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/mcusupport/mcusupportsdk.cpp b/src/plugins/mcusupport/mcusupportsdk.cpp index d87038c8a00..a00d542027c 100644 --- a/src/plugins/mcusupport/mcusupportsdk.cpp +++ b/src/plugins/mcusupport/mcusupportsdk.cpp @@ -59,7 +59,8 @@ static QString findInProgramFiles(const QString &folder) McuPackage *createQtForMCUsPackage() { auto result = new McuPackage( - McuPackage::tr("Qt for MCUs SDK"), + McuPackage::tr("Qt for MCUs %1 SDK").arg( + McuSupportOptions::supportedQulVersion().toString()), QDir::homePath(), Utils::HostOsInfo::withExecutableSuffix("bin/qmltocpp"), Constants::SETTINGS_KEY_PACKAGE_QT_FOR_MCUS_SDK); From 848054ce3ca12c1cbe2aaf03222a64571e812542 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 23 Jun 2020 10:18:19 +0200 Subject: [PATCH 4/5] Add shiboken2tasks.py for converting Qt for Python's shiboken tool warnings Add a tool for converting shiboken warnings to task files to be able to load them into the Issues pane of Qt Creator. Task-number: PYSIDE-904 Change-Id: Ie28e93ad76a615e549594edf5bba60e134b46a88 Reviewed-by: Cristian Maureira-Fredes Reviewed-by: Christian Tismer Reviewed-by: Christian Kandeler --- scripts/shiboken2tasks.py | 52 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100755 scripts/shiboken2tasks.py diff --git a/scripts/shiboken2tasks.py b/scripts/shiboken2tasks.py new file mode 100755 index 00000000000..024f53cd15c --- /dev/null +++ b/scripts/shiboken2tasks.py @@ -0,0 +1,52 @@ +############################################################################ +# +# Copyright (C) 2020 The Qt Company Ltd. +# Contact: https://www.qt.io/licensing/ +# +# This file is part of Qt Creator. +# +# Commercial License Usage +# Licensees holding valid commercial Qt licenses may use this file in +# accordance with the commercial license agreement provided with the +# Software or, alternatively, in accordance with the terms contained in +# a written agreement between you and The Qt Company. For licensing terms +# and conditions see https://www.qt.io/terms-conditions. For further +# information use the contact form at https://www.qt.io/contact-us. +# +# GNU General Public License Usage +# Alternatively, this file may be used under the terms of the GNU +# General Public License version 3 as published by the Free Software +# Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +# included in the packaging of this file. Please review the following +# information to ensure the GNU General Public License requirements will +# be met: https://www.gnu.org/licenses/gpl-3.0.html. +# +############################################################################ + +''' +shiboken2tasks.py - Convert shiboken warnings into Qt Creator task files. + +SYNOPSIS + + shiboken2tasks.py < logfile > taskfile +''' + +import sys +import re + +if __name__ == '__main__': + # qt.shiboken: () ::[:] text + pattern = re.compile(r'^qt\.shiboken: \(([^)]+)\) ([^:]+):(\d+):(?:\d+:)? (.*)$') + while True: + line = sys.stdin.readline() + if not line: + break + match = pattern.match(line.rstrip()) + if match: + module = match.group(1) + file_name = match.group(2).replace('\\', '/') + line_number = match.group(3) + text = match.group(4) + output = "{}\t{}\twarn\t{}: {}".format(file_name, line_number, + module, text) + print(output) From 96c1b4119e7053981a3109b658a656430c4abaaf Mon Sep 17 00:00:00 2001 From: Fawzi Mohamed Date: Thu, 18 Jun 2020 17:12:31 +0200 Subject: [PATCH 5/5] QML: ensure that signal treated like functions/slots in completions Renames enumerateSlots -> enumerateMethods to mirror the new usage Fixes: QTCREATORBUG-24124 Change-Id: I31ac7d5f4bf568e1ab9c9463b1ebd0011dfcb9d6 Reviewed-by: Tim Jenssen Reviewed-by: Fabian Kosmale --- src/plugins/qmljseditor/qmljscompletionassist.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/qmljseditor/qmljscompletionassist.cpp b/src/plugins/qmljseditor/qmljscompletionassist.cpp index 839e3fd19f3..5cfa28c609a 100644 --- a/src/plugins/qmljseditor/qmljscompletionassist.cpp +++ b/src/plugins/qmljseditor/qmljscompletionassist.cpp @@ -187,7 +187,7 @@ class ProcessProperties: private MemberProcessor QSet _processed; bool _globalCompletion = false; bool _enumerateGeneratedSlots = false; - bool _enumerateSlots = true; + bool _enumerateMethods = true; const ScopeChain *_scopeChain; const ObjectValue *_currentObject = nullptr; PropertyProcessor *_propertyProcessor = nullptr; @@ -208,9 +208,9 @@ public: _enumerateGeneratedSlots = enumerate; } - void setEnumerateSlots(bool enumerate) + void setEnumerateMethods(bool enumerate) { - _enumerateSlots = enumerate; + _enumerateMethods = enumerate; } void operator ()(const Value *value, PropertyProcessor *processor) @@ -251,14 +251,14 @@ private: bool processSignal(const QString &name, const Value *value) override { - if (_globalCompletion) + if (_globalCompletion || _enumerateMethods) process(name, value); return true; } bool processSlot(const QString &name, const Value *value) override { - if (_enumerateSlots) + if (_enumerateMethods) process(name, value); return true; } @@ -771,7 +771,7 @@ IAssistProposal *QmlJSCompletionAssistProcessor::perform(const AssistInterface * ProcessProperties processProperties(&scopeChain); processProperties.setGlobalCompletion(true); processProperties.setEnumerateGeneratedSlots(true); - processProperties.setEnumerateSlots(false); + processProperties.setEnumerateMethods(false); // id: is special AssistProposalItem *idProposalItem = new QmlJSAssistProposalItem;