From e106fd009005a52c6fc91af19d815cb7e3e6119b Mon Sep 17 00:00:00 2001 From: Denis Shienkov Date: Tue, 2 Feb 2021 13:11:25 +0300 Subject: [PATCH 1/9] Debugger: Handle missing {lsb|msb} tags in SVD file The SVD file format describes the possible presence of tags `` and `` to describe the bit fields of the register data: * https://www.keil.com/pack/doc/CMSIS/SVD/html/schema_1_2_gr.html So, we need also implement parsing for such tags from the SVD files. Task-number: QTCREATORBUG-24414 Change-Id: I968cdfb4c86bfed0aac212c3f3a4376c8ee93ffe Reviewed-by: hjk --- src/plugins/debugger/peripheralregisterhandler.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/plugins/debugger/peripheralregisterhandler.cpp b/src/plugins/debugger/peripheralregisterhandler.cpp index 0236697d7e0..667c3d21dba 100644 --- a/src/plugins/debugger/peripheralregisterhandler.cpp +++ b/src/plugins/debugger/peripheralregisterhandler.cpp @@ -59,6 +59,8 @@ constexpr char kDisplayName[] = "displayName"; constexpr char kField[] = "field"; constexpr char kFields[] = "fields"; constexpr char kGroupName[] = "groupName"; +constexpr char kLsb[] = "lsb"; +constexpr char kMsb[] = "msb"; constexpr char kName[] = "name"; constexpr char kPeripheral[] = "peripheral"; constexpr char kPeripherals[] = "peripherals"; @@ -566,6 +568,8 @@ PeripheralRegisterHandler::PeripheralRegisterHandler(DebuggerEngine *engine) static void handleField(QXmlStreamReader &in, PeripheralRegister ®) { PeripheralRegisterField fld; + Utils::optional from; + Utils::optional to; while (in.readNextStartElement()) { const auto elementName = in.name(); if (elementName == QLatin1String(kName)) { @@ -593,11 +597,20 @@ static void handleField(QXmlStreamReader &in, PeripheralRegister ®) fld.bitOffset = int(decodeNumeric(in.readElementText())); } else if (elementName == QLatin1String(kBitWidth)) { fld.bitWidth = int(decodeNumeric(in.readElementText())); + } else if (elementName == QLatin1String(kLsb)) { + from = int(decodeNumeric(in.readElementText())); + } else if (elementName == QLatin1String(kMsb)) { + to = int(decodeNumeric(in.readElementText())); } else { in.skipCurrentElement(); } } + if (from && to) { + fld.bitOffset = *from; + fld.bitWidth = *to - *from + 1; + } + // Inherit the field access from the register access if the filed // has not the access rights description. if (fld.access == PeripheralRegisterAccess::Unknown) From 59488d9606728526b4d2347a0302a415c191f76c Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Wed, 27 Jan 2021 04:07:37 +0100 Subject: [PATCH 2/9] qmlpuppet: call engine()->setUiLanguage so qml components can react on it Change-Id: I31dc46fabeef0936accd23ed22cbebfe2cd8663c Reviewed-by: Thomas Hartmann --- .../qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp index 64d790c6a7f..f4068ab5683 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp @@ -1343,6 +1343,8 @@ void NodeInstanceServer::loadDummyContextObjectFile(const QFileInfo& qmlFileInfo void NodeInstanceServer::setTranslationLanguage(const QString &language) { + // if there exists an /i18n directory it sets default translators + engine()->setUiLanguage(language); static QPointer multilanguageTranslator; if (!MultiLanguage::databaseFilePath().isEmpty()) { if (!multilanguageLink) { From 3468d302866171c174a6099593503e50700634f0 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 4 Feb 2021 06:32:21 +0100 Subject: [PATCH 3/9] QmlDesigner: Fix build for Qt5.14 Amends 59488d96067. Change-Id: I70fd3f962de5abb6254a406263df2ea61c7e9bcc Reviewed-by: Tim Jenssen --- .../qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp index f4068ab5683..49dac81b63f 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp @@ -1343,8 +1343,10 @@ void NodeInstanceServer::loadDummyContextObjectFile(const QFileInfo& qmlFileInfo void NodeInstanceServer::setTranslationLanguage(const QString &language) { +#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) // if there exists an /i18n directory it sets default translators engine()->setUiLanguage(language); +#endif static QPointer multilanguageTranslator; if (!MultiLanguage::databaseFilePath().isEmpty()) { if (!multilanguageLink) { From 303008a09ad3d42883072a246e841996f88f1950 Mon Sep 17 00:00:00 2001 From: Alexis Jeandet Date: Wed, 3 Feb 2021 22:14:10 +0100 Subject: [PATCH 4/9] Meson plugin: Fix segfault when switching build type Change-Id: I837e0a7ba8dd731438d36cfb766fd60c9643be73 Reviewed-by: hjk Reviewed-by: Eike Ziller --- src/plugins/mesonprojectmanager/project/ninjabuildstep.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/mesonprojectmanager/project/ninjabuildstep.cpp b/src/plugins/mesonprojectmanager/project/ninjabuildstep.cpp index 931d7de2797..2070942c9e9 100644 --- a/src/plugins/mesonprojectmanager/project/ninjabuildstep.cpp +++ b/src/plugins/mesonprojectmanager/project/ninjabuildstep.cpp @@ -120,7 +120,7 @@ QWidget *NinjaBuildStep::createConfigWidget() connect(this, &NinjaBuildStep::commandChanged, this, updateDetails); - connect(this, &NinjaBuildStep::targetListChanged, this, updateTargetList); + connect(this, &NinjaBuildStep::targetListChanged, widget, updateTargetList); connect(toolArguments, &QLineEdit::textEdited, this, [this, updateDetails](const QString &text) { setCommandArgs(text); From c25afb1b598ad566e6b0db6be91e7b110269dbb3 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Thu, 19 Nov 2020 09:08:53 +0100 Subject: [PATCH 5/9] McuSupport: Remove explicit appointment of Jom as CMAKE_MAKE_PROGRAM Detecting the presence of Jom, setting CMAKE_MAKE_PROGRAM to it and choosing "NMake Makefiles JOM" as CMake generator was implemented in a time where the Qt SDK did not yet ship ninja. By now, ninja is shipped and it *should* be automatically installed as dependency of Qt for MCUs. Qt Creator will by default prefer ninja as generator/buildtool if it is installed. Task-number: QTMCU-18 Change-Id: Ia83ac3a454b90bb5b5b69ddefb3fbb8f23fa15c9 Reviewed-by: Eike Ziller Reviewed-by: Reviewed-by: Alessandro Portale --- src/plugins/mcusupport/mcusupportoptions.cpp | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/plugins/mcusupport/mcusupportoptions.cpp b/src/plugins/mcusupport/mcusupportoptions.cpp index 55ebe006a9a..1413970dadc 100644 --- a/src/plugins/mcusupport/mcusupportoptions.cpp +++ b/src/plugins/mcusupport/mcusupportoptions.cpp @@ -563,13 +563,6 @@ FilePath McuSupportOptions::qulDirFromSettings() QSettings::UserScope)); } -static FilePath jomExecutablePath() -{ - return HostOsInfo::isWindowsHost() - ? FilePath::fromUserInput(Core::ICore::libexecPath() + "/jom.exe") - : FilePath(); -} - static void setKitProperties(const QString &kitName, Kit *k, const McuTarget *mcuTarget) { using namespace Constants; @@ -589,8 +582,6 @@ static void setKitProperties(const QString &kitName, Kit *k, const McuTarget *mc QSet irrelevant = { SysRootKitAspect::id() }; if (!kitNeedsQtVersion()) irrelevant.insert(QtSupport::QtKitAspect::id()); - if (jomExecutablePath().exists()) // TODO: add id() getter to CMakeGeneratorKitAspect - irrelevant.insert("CMake.GeneratorKitInformation"); k->setIrrelevantAspects(irrelevant); } @@ -694,11 +685,6 @@ static void setKitCMakeOptions(Kit *k, const McuTarget* mcuTarget, const QString if (mcuTarget->colorDepth() >= 0) config.append(CMakeConfigItem("QUL_COLOR_DEPTH", QString::number(mcuTarget->colorDepth()).toLatin1())); - const FilePath jom = jomExecutablePath(); - if (jom.exists()) { - config.append(CMakeConfigItem("CMAKE_MAKE_PROGRAM", jom.toString().toLatin1())); - CMakeGeneratorKitAspect::setGenerator(k, "NMake Makefiles JOM"); - } if (kitNeedsQtVersion()) config.append(CMakeConfigItem("CMAKE_PREFIX_PATH", "%{Qt:QT_INSTALL_PREFIX}")); CMakeConfigurationKitAspect::setConfiguration(k, config); From 8875c59021586bf66b38299873dd05f440a99665 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 4 Feb 2021 09:28:14 +0100 Subject: [PATCH 6/9] Core: Do not remove context objects during shutdown Like we suppress context updates during shutdown also disconnect from the context object's destroyed signal. At that point we don't care anymore. This also avoids issues if the context object lives as the child of a widget in the MainWindow geometry. These widgets (and respectively their children) are destroyed only in the QObject destructor, i.e. after the MainWindow itself already destroyed all its members, including the m_contextWidgets map. Amends 6d97c1fcb1f0a8c712d902065a887f8b74c61cf4 Fixes: QTCREATORBUG-25310 Change-Id: I75db6f8783b5f62aa9805b69d4d2bba07b906a5b Reviewed-by: David Schulz --- src/plugins/coreplugin/mainwindow.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index 6fb5e170ddd..aececbbb2d3 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -1016,6 +1016,8 @@ void MainWindow::updateContextObject(const QList &context) void MainWindow::aboutToShutdown() { disconnect(qApp, &QApplication::focusChanged, this, &MainWindow::updateFocusWidget); + for (auto contextPair : m_contextWidgets) + disconnect(contextPair.second, &QObject::destroyed, this, nullptr); m_activeContext.clear(); hide(); } From 87197be604e3c5f8bf39e9aa11fdfea88b6eab75 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Thu, 4 Feb 2021 12:30:03 +0100 Subject: [PATCH 7/9] CMakeProjectManager: Do not report CMake as invalid when adding/cloning Fixes: QTCREATORBUG-25250 Change-Id: Ic78a5645540145977c7ff0b05d8d7a5c3fc15fda Reviewed-by: Eike Ziller --- .../cmakeprojectmanager/cmakesettingspage.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakesettingspage.cpp b/src/plugins/cmakeprojectmanager/cmakesettingspage.cpp index 30e1a50dd38..8afc1480221 100644 --- a/src/plugins/cmakeprojectmanager/cmakesettingspage.cpp +++ b/src/plugins/cmakeprojectmanager/cmakesettingspage.cpp @@ -118,9 +118,6 @@ public: , m_changed(changed) { updateErrorFlags(); - m_tooltip = tr("Version: %1
Supports fileApi: %2") - .arg(QString::fromUtf8(item->version().fullVersion)) - .arg(item->hasFileApi() ? tr("yes") : tr("no")); } CMakeToolTreeItem(const QString &name, @@ -146,6 +143,15 @@ public: m_pathExists = fi.exists(); m_pathIsFile = fi.isFile(); m_pathIsExecutable = fi.isExecutable(); + + auto cmake = std::make_unique(m_autodetected ? CMakeTool::AutoDetection + : CMakeTool::ManualDetection, m_id); + cmake->setFilePath(m_executable); + m_isSupported = cmake->hasFileApi(); + + m_tooltip = tr("Version: %1
Supports fileApi: %2") + .arg(QString::fromUtf8(cmake->version().fullVersion)) + .arg(cmake->hasFileApi() ? tr("yes") : tr("no")); } CMakeToolTreeItem() = default; From a8db7721eb3f3f32e52c7390e54e206af5cc1d73 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Fri, 5 Feb 2021 14:38:41 +0100 Subject: [PATCH 8/9] CMakeProjectManager: Do not use dynamic allocation for CMakeTool ammends 87197be604e3c5f8bf39e9aa11fdfea88b6eab75 Change-Id: I600c0c26b3301607360f93ff6075f7c7d4a1b438 Reviewed-by: hjk --- .../cmakeprojectmanager/cmakesettingspage.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakesettingspage.cpp b/src/plugins/cmakeprojectmanager/cmakesettingspage.cpp index 8afc1480221..052600611d9 100644 --- a/src/plugins/cmakeprojectmanager/cmakesettingspage.cpp +++ b/src/plugins/cmakeprojectmanager/cmakesettingspage.cpp @@ -144,14 +144,14 @@ public: m_pathIsFile = fi.isFile(); m_pathIsExecutable = fi.isExecutable(); - auto cmake = std::make_unique(m_autodetected ? CMakeTool::AutoDetection - : CMakeTool::ManualDetection, m_id); - cmake->setFilePath(m_executable); - m_isSupported = cmake->hasFileApi(); + CMakeTool cmake(m_autodetected ? CMakeTool::AutoDetection + : CMakeTool::ManualDetection, m_id); + cmake.setFilePath(m_executable); + m_isSupported = cmake.hasFileApi(); m_tooltip = tr("Version: %1
Supports fileApi: %2") - .arg(QString::fromUtf8(cmake->version().fullVersion)) - .arg(cmake->hasFileApi() ? tr("yes") : tr("no")); + .arg(QString::fromUtf8(cmake.version().fullVersion)) + .arg(cmake.hasFileApi() ? tr("yes") : tr("no")); } CMakeToolTreeItem() = default; From bd257859975e15128e8d2ae60a135748777b3783 Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Fri, 5 Feb 2021 18:09:48 +0100 Subject: [PATCH 9/9] qmlpuppet: fix crash initializeView(); creates the necessary engine where we need to set the languageUi. Change-Id: Ib9f9f35e00167ce0bfe4d96ed4e66a965daea084 Reviewed-by: Thomas Hartmann --- .../qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp | 2 +- .../qml2puppet/instances/qt5previewnodeinstanceserver.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp index 49dac81b63f..8ddc3a7f068 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp @@ -322,8 +322,8 @@ void NodeInstanceServer::stopRenderTimer() void NodeInstanceServer::createScene(const CreateSceneCommand &command) { - setTranslationLanguage(command.language); initializeView(); + setTranslationLanguage(command.language); Internal::QmlPrivateGate::stopUnifiedTimer(); diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5previewnodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5previewnodeinstanceserver.cpp index 2a34864a844..8fcf8962d74 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5previewnodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5previewnodeinstanceserver.cpp @@ -46,8 +46,8 @@ Qt5PreviewNodeInstanceServer::Qt5PreviewNodeInstanceServer(NodeInstanceClientInt void Qt5PreviewNodeInstanceServer::createScene(const CreateSceneCommand &command) { - setTranslationLanguage(command.language); initializeView(); + setTranslationLanguage(command.language); setupScene(command); startRenderTimer(); }