Merge remote-tracking branch 'origin/12.0'

Change-Id: I7971dd83798e975d4e10b77a352c9d7ef7b14ec0
This commit is contained in:
Eike Ziller
2023-11-23 10:43:00 +01:00
24 changed files with 115 additions and 44 deletions

View File

@@ -371,6 +371,7 @@ Credits for these changes go to:
--------------------------------
Aleksei German
Alessandro Portale
Alexandre Laurent
Ali Kianian
Amr Essam
Andre Hartmann
@@ -393,6 +394,7 @@ Johanna Vanhatapio
Johnny Jazeix
Jonas Karlsson
Jussi Witick
Karim Abdelrahman
Knud Dollereder
Leena Miettinen
Ludovic Le Brun
@@ -402,6 +404,7 @@ Marcus Tillmanns
Mats Honkamaa
Mehdi Salem
Miikka Heikkinen
Mike Chen
Olivier De Cannière
Olivier Delaune
Orgad Shaneh

View File

@@ -838,17 +838,17 @@ void Lexer::scanRawStringLiteral(Token *tok, unsigned char hint)
bool Lexer::scanUntilRawStringLiteralEndPrecise()
{
int matchLen = 0;
QByteArray slidingWindow;
slidingWindow.reserve(_expectedRawStringSuffix.size());
while (_yychar) {
if (_yychar == _expectedRawStringSuffix.at(matchLen)) {
if (++matchLen == _expectedRawStringSuffix.length()) {
slidingWindow.append(_yychar);
if (slidingWindow.size() > _expectedRawStringSuffix.size())
slidingWindow.remove(0, 1);
if (slidingWindow == _expectedRawStringSuffix) {
_expectedRawStringSuffix.clear();
yyinp();
return true;
}
} else {
matchLen = 0;
}
yyinp();
}
return false;

View File

@@ -1,6 +1,8 @@
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#pragma once
#include "androiddeviceinfo.h"
namespace Android {

View File

@@ -1,6 +1,8 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#pragma once
#include "cmakeprojectnodes.h"
#include <utils/filepath.h>

View File

@@ -590,6 +590,12 @@ void CppHighlighterTest::test_data()
<< 38 << 18 << 39 << 3 << C_STRING;
QTest::newRow("multi-line user-defined UTF-16 string literal (suffix)")
<< 39 << 4 << 39 << 5 << C_OPERATOR;
QTest::newRow("multi-line raw string literal with consecutive closing parens (prefix)")
<< 48 << 18 << 48 << 20 << C_KEYWORD;
QTest::newRow("multi-line raw string literal with consecutive closing parens (content)")
<< 49 << 1 << 49 << 1 << C_STRING;
QTest::newRow("multi-line raw string literal with consecutive closing parens (suffix)")
<< 49 << 2 << 49 << 3 << C_KEYWORD;
}
void CppHighlighterTest::test()

View File

@@ -79,12 +79,12 @@ static int skipChars(QTextCursor *tc,
return count;
}
static int skipCharsForward(QTextCursor *tc, std::function<bool(const QChar &)> skip)
static int skipCharsForward(QTextCursor *tc, const std::function<bool(const QChar &)> &skip)
{
return skipChars(tc, QTextCursor::NextCharacter, 0, skip);
}
static int skipCharsBackward(QTextCursor *tc, std::function<bool(const QChar &)> skip)
static int skipCharsBackward(QTextCursor *tc, const std::function<bool(const QChar &)> &skip)
{
return skipChars(tc, QTextCursor::PreviousCharacter, -1, skip);
}

View File

@@ -44,3 +44,6 @@ static void parenTest()
/* comment */ \
} while (false);
}
const char* s7 = R"(
))";

View File

@@ -481,6 +481,7 @@ void DebuggerRunTool::start()
runControl()->setDisplayName(m_runParameters.displayName);
if (!m_engine)
m_engine = createDapEngine(runControl()->runMode());
if (!m_engine) {

View File

@@ -30,6 +30,7 @@
#include <utils/algorithm.h>
#include <QCoreApplication>
#include <QMessageBox>
#include <QPushButton>
#include <QRegularExpression>
@@ -430,11 +431,17 @@ bool kitIsUpToDate(const Kit *kit,
QList<Kit *> existingKits(const McuTarget *mcuTarget)
{
using namespace Constants;
// some models have compatible name changes that refere to the same supported board across versions.
// name changes are tracked here to recognize the corresponding kits as upgradable.
static QMap<QString, QStringList> upgradable_to = {
{"MIMXRT1170-EVK-FREERTOS", {"MIMXRT1170-EVKB-FREERTOS"}}};
return Utils::filtered(KitManager::kits(), [mcuTarget](Kit *kit) {
return kit->value(KIT_MCUTARGET_KITVERSION_KEY) == KIT_VERSION
&& (!mcuTarget
|| (kit->value(KIT_MCUTARGET_VENDOR_KEY) == mcuTarget->platform().vendor
&& kit->value(KIT_MCUTARGET_MODEL_KEY) == mcuTarget->platform().name
&& (kit->value(KIT_MCUTARGET_MODEL_KEY) == mcuTarget->platform().name
|| upgradable_to[kit->value(KIT_MCUTARGET_MODEL_KEY).toString()].contains(
mcuTarget->platform().name))
&& kit->value(KIT_MCUTARGET_COLORDEPTH_KEY) == mcuTarget->colorDepth()
&& kit->value(KIT_MCUTARGET_OS_KEY).toInt()
== static_cast<int>(mcuTarget->os())
@@ -590,6 +597,9 @@ void upgradeKitsByCreatingNewPackage(const SettingsHandler::Ptr &settingsHandler
if (upgradeOption == UpgradeOption::Replace) {
for (auto existingKit : kits)
KitManager::deregisterKit(existingKit);
// Reset cached values that are not valid after an update
// Exp: a board sdk version that was dropped in newer releases
target->resetInvalidPathsToDefault();
}
if (target->isValid())

View File

@@ -13,8 +13,8 @@
<file>wizards/qmlproject/DejaVuSansMono.ttf</file>
<file>wizards/qmlproject/LICENSE</file>
<file>wizards/qmlproject/translation.nb_NO.ts</file>
<file>wizards/qmlproject/translation.en_US.ts</file>
<file>wizards/qmlproject/BackendObject.h</file>
<file>wizards/qmlproject/main_big.qml.tpl</file>
<file>wizards/qmlproject/main.qml.tpl</file>
<file>wizards/qmlproject/project.qmlproject.tpl</file>
<file>wizards/qmlproject/module.qmlproject.tpl</file>

View File

@@ -113,6 +113,19 @@ void McuTarget::handlePackageProblems(MessagesList &messages) const
}
}
void McuTarget::resetInvalidPathsToDefault()
{
for (McuPackagePtr package : std::as_const(m_packages)) {
if (!package)
continue;
if (package->isValidStatus())
continue;
package->setPath(package->defaultPath());
package->writeToSettings();
}
}
QVersionNumber McuTarget::qulVersion() const
{
return m_qulVersion;

View File

@@ -56,6 +56,12 @@ public:
QString desktopCompilerId() const;
void handlePackageProblems(MessagesList &messages) const;
// Used when updating to new version of QtMCUs
// Paths that is not valid in the new version,
// and were valid in the old version. have the possibility be valid if
// reset to the default value without user intervention
void resetInvalidPathsToDefault();
private:
const QVersionNumber m_qulVersion;
const Platform m_platform;

View File

@@ -5,7 +5,6 @@ Project {
// importPaths: [] // Alternative API to ModuleFiles for importing modules.
// projectRootPath: "." // Optional root path relative to qmlproject file path.
mainFile: "%{MainQmlFile}" // The application's entrypoint
idBasedTranslations: true // Use qsTrId() instead of qsTr()
MCU.Config {
controlsStyle: "QtQuick.Controls.StyleDefault"

View File

@@ -16,10 +16,9 @@ Rectangle {
CustomButton {
anchors.centerIn: parent
text: qsTrId("hello-world")
text: qsTr("Hello world!")
onClicked: BackendObject.toggle()
}
BackendObject.onCustomPropertyChanged: Qt.uiLanguage = BackendObject.customProperty ? "en_US" : "nb_NO"
Component.onCompleted: Qt.uiLanguage = "en_US"
}

View File

@@ -0,0 +1,30 @@
import QtQuick 2.0
import CustomModule
Rectangle {
// Component.onCompleted: Qt.uiLanguage = "nb_NO" // Uncomment to change the UI language //TODO: Is this the "official" method of setting ui language?
Row {
visible: CustomObject.customProperty
Image {
anchors.centerIn: parent
id: icon
source: "assets/icon.png"
}
Text {
anchors.centerIn: parent
font.pixelSize: 28
id: title
text: " for MCUs"
}
}
CustomComponent {
anchors.centerIn: parent
}
MouseArea {
anchors.fill: parent
onClicked: CustomObject.toggle()
}
}

View File

@@ -5,7 +5,6 @@ Project {
// importPaths: ["imports/CustomModule"] // Alternative API for importing modules.
// projectRootPath: "." // Optional root path relative to qmlproject file path.
mainFile: "%{MainQmlFile}" // The application's entrypoint
idBasedTranslations: true // Use qsTrId() instead of qsTr()
/* Global configuration */
MCU.Config {
@@ -89,11 +88,8 @@ Project {
/* Translations */
TranslationFiles {
files: [
"translations/%{TsFileEn}",
"translations/%{TsFileNo}"
]
MCU.omitSourceLanguage: true
files: ["translations/%{TsFile}"]
MCU.omitSourceLanguage: false
}
FontFiles {

View File

@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="en_US">
<context>
<name>%{CorrectedProjectName}</name>
<message id="hello-world">
<translation>Hello world!</translation>
</message>
</context>
</TS>

View File

@@ -3,7 +3,9 @@
<TS version="2.1" language="nb_NO">
<context>
<name>%{CorrectedProjectName}</name>
<message id="hello-world">
<message>
<location filename="../%{MainQmlFile}" line="37"/>
<source>Hello world!</source>
<translation>Hallo verden!</translation>
</message>
</context>

View File

@@ -21,8 +21,7 @@
{ "key": "ModuleFile", "value": "CustomModule.qmlproject"},
{ "key": "QmlComponent", "value": "CustomButton.qml"},
{ "key": "InterfaceFile", "value": "BackendObject.h"},
{ "key": "TsFileEn", "value": "%{CorrectedProjectName}.en_US.ts"},
{ "key": "TsFileNo", "value": "%{CorrectedProjectName}.nb_NO.ts"}
{ "key": "TsFile", "value": "%{CorrectedProjectName}.nb_NO.ts"}
],
"pages":
@@ -104,12 +103,7 @@
},
{
"source": "translation.nb_NO.ts",
"target": "%{QmlProjectDirectory}/translations/%{TsFileNo}",
"openInEditor": false
},
{
"source": "translation.en_US.ts",
"target": "%{QmlProjectDirectory}/translations/%{TsFileEn}",
"target": "%{QmlProjectDirectory}/translations/%{TsFile}",
"openInEditor": false
},
{

View File

@@ -11,6 +11,7 @@
#include "../projectexplorertr.h"
#include "../projecttree.h"
#include <coreplugin/editormanager/documentmodel.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/editormanager/ieditor.h>
#include <coreplugin/messagemanager.h>
@@ -351,6 +352,14 @@ void JsonWizard::accept()
return;
}
const QList<Core::IDocument *> documentsToClose
= transform(m_files, [](const GeneratorFile &file) -> Core::IDocument * {
if ((file.file.attributes() & Core::GeneratedFile::OpenEditorAttribute) == 0)
return nullptr;
return Core::DocumentModel::documentForFilePath(file.file.filePath());
});
Core::EditorManager::closeDocuments(documentsToClose, /*askAboutModifiedEditors=*/false);
emit preWriteFiles(m_files);
if (!JsonWizardGenerator::writeFiles(this, &m_files, &errorMessage)) {
if (!errorMessage.isEmpty())

View File

@@ -89,8 +89,8 @@ void PySideInstaller::installPyside(const FilePath &python,
const Utils::QtcSettings *settings = Core::ICore::settings(QSettings::SystemScope);
const FilePaths requirementsList
= Utils::transform(settings->value("Python/PySideWheelsRequirements").toList(),
&FilePath::fromSettings);
= Utils::transform(settings->value("Python/PySideWheelsRequirements").toStringList(),
&FilePath::fromString);
for (const FilePath &requirements : requirementsList) {
if (requirements.exists()) {
auto version = QVersionNumber::fromString(requirements.parentDir().fileName());

View File

@@ -1,6 +1,8 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#pragma once
#include <projectexplorer/jsonwizard/jsonwizard.h>
#include <projectexplorer/jsonwizard/jsonwizardpagefactory.h>
#include <projectexplorer/runconfigurationaspects.h>

View File

@@ -1,6 +1,8 @@
// Copyright (C) 2017 Przemyslaw Gorszkowski <pgorszkowski@gmail.com>.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#pragma once
#include <QObject>
namespace SilverSearcher {

View File

@@ -1,6 +1,8 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#pragma once
#include <QObject>
QT_BEGIN_NAMESPACE