Merge remote-tracking branch 'origin/11.0'

Conflicts:
	src/plugins/beautifier/clangformat/clangformatsettings.cpp
	src/shared/qbs

Change-Id: Ie614f036ef9529a3cae6366a9313eded988d725c
This commit is contained in:
Eike Ziller
2023-08-03 11:35:17 +02:00
13 changed files with 182 additions and 48 deletions

77
dist/changelog/changes-11.0.1.md vendored Normal file
View File

@@ -0,0 +1,77 @@
Qt Creator 11.0.1
=================
Qt Creator version 11.0.1 contains bug fixes.
The most important changes are listed in this document. For a complete list of
changes, see the Git log for the Qt Creator sources that you can check out from
the public Git repository. For example:
git clone git://code.qt.io/qt-creator/qt-creator.git
git log --cherry-pick --pretty=oneline origin/v11.0.0..v11.0.1
General
-------
* Fixed writing configuration files with `sdktool`
* Fixed exporting keyboard shortcut schemes
([QTCREATORBUG-29431](https://bugreports.qt.io/browse/QTCREATORBUG-29431))
Editing
-------
### SCXML
* Fixed a crash when `onEntry`/`onExit` events and transitions where displayed
together
([QTCREATORBUG-29429](https://bugreports.qt.io/browse/QTCREATORBUG-29429))
### Beautifier
* Fixed setting a customized Clang Format style
([QTCREATORBUG-28525](https://bugreports.qt.io/browse/QTCREATORBUG-28525))
Projects
--------
* Fixed a crash when editing kits
([QTCREATORBUG-29382](https://bugreports.qt.io/browse/QTCREATORBUG-29382),
[QTCREATORBUG-29425](https://bugreports.qt.io/browse/QTCREATORBUG-29425))
* Fixed a crash when manually re-detecting toolchains
([QTCREATORBUG-29430](https://bugreports.qt.io/browse/QTCREATORBUG-29430))
* Fixed the pasting of large texts in integrated terminal
* Incredibuild
* Fixed missing UI in the build steps
### CMake
* Fixed an issue with framework paths with CMake >= 3.27
([QTCREATORBUG-29450](https://bugreports.qt.io/browse/QTCREATORBUG-29450))
Debugging
---------
* Fixed the button state in the dialog for loading core files
* Fixed debugging with debuggers that still use Python 2.7
([QTCREATORBUG-29440](https://bugreports.qt.io/browse/QTCREATORBUG-29440))
* GDB
* Fixed `Use common locations for debug information`
Version Control Systems
-----------------------
### Git
* Fixed a crash when tools are not found in `PATH`
Credits for these changes go to:
--------------------------------
Aleksei German
André Pönitz
Christian Kandeler
Christian Stenger
Cristian Adam
Eike Ziller
Leena Miettinen
Marcus Tillmanns
Robert Löhning

View File

@@ -34,7 +34,7 @@
\if defined(qtcreator) \if defined(qtcreator)
\row \row
\li View examples of what you can do with Qt \li View examples of what you can do with Qt
\li \l{List of Qt Examples} \li \l{Qt Examples and Tutorials}
\row \row
\li Develop Qt applications for desktop and \l{glossary-device}{devices} \li Develop Qt applications for desktop and \l{glossary-device}{devices}

View File

@@ -297,7 +297,8 @@ public:
connect(styleButtonGroup, &QButtonGroup::buttonClicked, this, updateEnabled); connect(styleButtonGroup, &QButtonGroup::buttonClicked, this, updateEnabled);
connect(&s.predefinedStyle, &SelectionAspect::volatileValueChanged, this, updateEnabled); connect(&s.predefinedStyle, &SelectionAspect::volatileValueChanged, this, updateEnabled);
setOnApply([configurations] { setOnApply([configurations, customizedStyleButton] {
settings().usePredefinedStyle.setValue(!customizedStyleButton->isChecked());
settings().customStyle.setValue(configurations->currentConfiguration()); settings().customStyle.setValue(configurations->currentConfiguration());
settings().save(); settings().save();
}); });

View File

@@ -485,6 +485,26 @@ static std::vector<FileApiDetails::FragmentInfo> extractFragments(const QJsonObj
}); });
} }
static void addIncludeInfo(std::vector<IncludeInfo> *includes,
const QJsonObject &compileGroups,
const QString &section)
{
const std::vector<IncludeInfo> add
= transform<std::vector>(compileGroups.value(section).toArray(), [](const QJsonValue &v) {
const QJsonObject i = v.toObject();
const QString path = i.value("path").toString();
const bool isSystem = i.value("isSystem").toBool();
const ProjectExplorer::HeaderPath hp(path,
isSystem
? ProjectExplorer::HeaderPathType::System
: ProjectExplorer::HeaderPathType::User);
return IncludeInfo{ProjectExplorer::RawProjectPart::frameworkDetectionHeuristic(hp),
i.value("backtrace").toInt(-1)};
});
std::copy(add.cbegin(), add.cend(), std::back_inserter(*includes));
}
static TargetDetails extractTargetDetails(const QJsonObject &root, QString &errorMessage) static TargetDetails extractTargetDetails(const QJsonObject &root, QString &errorMessage)
{ {
TargetDetails t; TargetDetails t;
@@ -580,6 +600,10 @@ static TargetDetails extractTargetDetails(const QJsonObject &root, QString &erro
const QJsonArray compileGroups = root.value("compileGroups").toArray(); const QJsonArray compileGroups = root.value("compileGroups").toArray();
t.compileGroups = transform<std::vector>(compileGroups, [](const QJsonValue &v) { t.compileGroups = transform<std::vector>(compileGroups, [](const QJsonValue &v) {
const QJsonObject o = v.toObject(); const QJsonObject o = v.toObject();
std::vector<IncludeInfo> includes;
addIncludeInfo(&includes, o, "includes");
// new in CMake 3.27+:
addIncludeInfo(&includes, o, "frameworks");
return CompileInfo{ return CompileInfo{
transform<std::vector>(o.value("sourceIndexes").toArray(), transform<std::vector>(o.value("sourceIndexes").toArray(),
[](const QJsonValue &v) { return v.toInt(-1); }), [](const QJsonValue &v) { return v.toInt(-1); }),
@@ -589,21 +613,7 @@ static TargetDetails extractTargetDetails(const QJsonObject &root, QString &erro
const QJsonObject o = v.toObject(); const QJsonObject o = v.toObject();
return o.value("fragment").toString(); return o.value("fragment").toString();
}), }),
transform<std::vector>( includes,
o.value("includes").toArray(),
[](const QJsonValue &v) {
const QJsonObject i = v.toObject();
const QString path = i.value("path").toString();
const bool isSystem = i.value("isSystem").toBool();
const ProjectExplorer::HeaderPath
hp(path,
isSystem ? ProjectExplorer::HeaderPathType::System
: ProjectExplorer::HeaderPathType::User);
return IncludeInfo{
ProjectExplorer::RawProjectPart::frameworkDetectionHeuristic(hp),
i.value("backtrace").toInt(-1)};
}),
transform<std::vector>(o.value("defines").toArray(), transform<std::vector>(o.value("defines").toArray(),
[](const QJsonValue &v) { [](const QJsonValue &v) {
const QJsonObject d = v.toObject(); const QJsonObject d = v.toObject();

View File

@@ -64,6 +64,13 @@ static QString defineDirectiveToDefineOption(const Macro &macro)
return QString::fromUtf8(option); return QString::fromUtf8(option);
} }
static QStringList cpuBlacklist()
{
QStringList blacklist = qtcEnvironmentVariable("QTC_CLANGD_CPU_BLACKLIST")
.split(':', Qt::SkipEmptyParts);
return blacklist << "cortex-a72.cortex-a53"; // See QTCREATORBUG-29304
}
QStringList XclangArgs(const QStringList &args) QStringList XclangArgs(const QStringList &args)
{ {
QStringList options; QStringList options;
@@ -270,6 +277,7 @@ void CompilerOptionsBuilder::addPicIfCompilerFlagsContainsIt()
void CompilerOptionsBuilder::addCompilerFlags() void CompilerOptionsBuilder::addCompilerFlags()
{ {
add(m_compilerFlags.flags); add(m_compilerFlags.flags);
removeUnsupportedCpuFlags();
} }
void CompilerOptionsBuilder::addMsvcExceptions() void CompilerOptionsBuilder::addMsvcExceptions()
@@ -375,6 +383,17 @@ void CompilerOptionsBuilder::addIncludeFile(const QString &file)
} }
} }
void CompilerOptionsBuilder::removeUnsupportedCpuFlags()
{
const QStringList blacklist = cpuBlacklist();
for (auto it = m_options.begin(); it != m_options.end();) {
if (it->startsWith("-mcpu=") && blacklist.contains(it->mid(6)))
it = m_options.erase(it);
else
++it;
}
}
void CompilerOptionsBuilder::addIncludedFiles(const QStringList &files) void CompilerOptionsBuilder::addIncludedFiles(const QStringList &files)
{ {
for (const QString &file : files) { for (const QString &file : files) {

View File

@@ -87,6 +87,7 @@ private:
QStringList wrappedMingwHeadersIncludePath() const; QStringList wrappedMingwHeadersIncludePath() const;
QByteArray msvcVersion() const; QByteArray msvcVersion() const;
void addIncludeFile(const QString &file); void addIncludeFile(const QString &file);
void removeUnsupportedCpuFlags();
private: private:
const ProjectPart &m_projectPart; const ProjectPart &m_projectPart;

View File

@@ -61,7 +61,8 @@ public:
}; };
CommandBuilderAspect::CommandBuilderAspect(BuildStep *step) CommandBuilderAspect::CommandBuilderAspect(BuildStep *step)
: d(new CommandBuilderAspectPrivate(step)) : BaseAspect(step)
, d(new CommandBuilderAspectPrivate(step))
{ {
} }

View File

@@ -1376,6 +1376,17 @@ void BuildDeviceKitAspect::devicesChanged()
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
// EnvironmentKitAspect: // EnvironmentKitAspect:
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
static EnvironmentItem forceMSVCEnglishItem()
{
static EnvironmentItem item("VSLANG", "1033");
return item;
}
static bool enforcesMSVCEnglish(const EnvironmentItems &changes)
{
return changes.contains(forceMSVCEnglishItem());
}
namespace Internal { namespace Internal {
class EnvironmentKitAspectWidget final : public KitAspectWidget class EnvironmentKitAspectWidget final : public KitAspectWidget
{ {
@@ -1410,7 +1421,7 @@ private:
void refresh() override void refresh() override
{ {
const EnvironmentItems changes = currentEnvironment(); const EnvironmentItems changes = envWithoutMSVCEnglishEnforcement();
const QString shortSummary = EnvironmentItem::toStringList(changes).join("; "); const QString shortSummary = EnvironmentItem::toStringList(changes).join("; ");
m_summaryLabel->setText(shortSummary.isEmpty() ? Tr::tr("No changes to apply.") : shortSummary); m_summaryLabel->setText(shortSummary.isEmpty() ? Tr::tr("No changes to apply.") : shortSummary);
} }
@@ -1422,32 +1433,29 @@ private:
VariableChooser::addSupportForChildWidgets(w, expander); VariableChooser::addSupportForChildWidgets(w, expander);
}; };
auto changes = EnvironmentDialog::getEnvironmentItems(m_summaryLabel, auto changes = EnvironmentDialog::getEnvironmentItems(m_summaryLabel,
currentEnvironment(), envWithoutMSVCEnglishEnforcement(),
QString(), QString(),
polisher); polisher);
if (!changes) if (!changes)
return; return;
if (HostOsInfo::isWindowsHost()) { if (HostOsInfo::isWindowsHost()) {
const EnvironmentItem forceMSVCEnglishItem("VSLANG", "1033"); // re-add what envWithoutMSVCEnglishEnforcement removed
if (m_vslangCheckbox->isChecked() && changes->indexOf(forceMSVCEnglishItem) < 0) // or update vslang checkbox if user added it manually
changes->append(forceMSVCEnglishItem); if (m_vslangCheckbox->isChecked() && !enforcesMSVCEnglish(*changes))
changes->append(forceMSVCEnglishItem());
else if (enforcesMSVCEnglish(*changes))
m_vslangCheckbox->setChecked(true);
} }
EnvironmentKitAspect::setEnvironmentChanges(m_kit, *changes); EnvironmentKitAspect::setEnvironmentChanges(m_kit, *changes);
} }
EnvironmentItems currentEnvironment() const EnvironmentItems envWithoutMSVCEnglishEnforcement() const
{ {
EnvironmentItems changes = EnvironmentKitAspect::environmentChanges(m_kit); EnvironmentItems changes = EnvironmentKitAspect::environmentChanges(m_kit);
if (HostOsInfo::isWindowsHost()) { if (HostOsInfo::isWindowsHost())
const EnvironmentItem forceMSVCEnglishItem("VSLANG", "1033"); changes.removeAll(forceMSVCEnglishItem());
if (changes.indexOf(forceMSVCEnglishItem) >= 0) {
m_vslangCheckbox->setCheckState(Qt::Checked);
changes.removeAll(forceMSVCEnglishItem);
}
}
return sorted(std::move(changes), [](const EnvironmentItem &lhs, const EnvironmentItem &rhs) return sorted(std::move(changes), [](const EnvironmentItem &lhs, const EnvironmentItem &rhs)
{ return QString::localeAwareCompare(lhs.name, rhs.name) < 0; }); { return QString::localeAwareCompare(lhs.name, rhs.name) < 0; });
@@ -1460,13 +1468,14 @@ private:
m_vslangCheckbox->setToolTip(Tr::tr("Either switches MSVC to English or keeps the language and " m_vslangCheckbox->setToolTip(Tr::tr("Either switches MSVC to English or keeps the language and "
"just forces UTF-8 output (may vary depending on the used MSVC " "just forces UTF-8 output (may vary depending on the used MSVC "
"compiler).")); "compiler)."));
connect(m_vslangCheckbox, &QCheckBox::toggled, this, [this](bool checked) { if (enforcesMSVCEnglish(EnvironmentKitAspect::environmentChanges(m_kit)))
m_vslangCheckbox->setChecked(true);
connect(m_vslangCheckbox, &QCheckBox::clicked, this, [this](bool checked) {
EnvironmentItems changes = EnvironmentKitAspect::environmentChanges(m_kit); EnvironmentItems changes = EnvironmentKitAspect::environmentChanges(m_kit);
const EnvironmentItem forceMSVCEnglishItem("VSLANG", "1033"); if (!checked && changes.indexOf(forceMSVCEnglishItem()) >= 0)
if (!checked && changes.indexOf(forceMSVCEnglishItem) >= 0) changes.removeAll(forceMSVCEnglishItem());
changes.removeAll(forceMSVCEnglishItem); if (checked && changes.indexOf(forceMSVCEnglishItem()) < 0)
if (checked && changes.indexOf(forceMSVCEnglishItem) < 0) changes.append(forceMSVCEnglishItem());
changes.append(forceMSVCEnglishItem);
EnvironmentKitAspect::setEnvironmentChanges(m_kit, changes); EnvironmentKitAspect::setEnvironmentChanges(m_kit, changes);
}); });
} }

View File

@@ -18,7 +18,7 @@ EventItem::EventItem(const QPointF &pos, BaseItem *parent)
{ {
m_eventNameItem = new TextItem(this); m_eventNameItem = new TextItem(this);
m_eventNameItem->setParentItem(this); m_eventNameItem->setParentItem(this);
QFont serifFont("Times", 13, QFont::Normal); QFont serifFont("Times", 10, QFont::Normal);
m_eventNameItem->setFont(serifFont); m_eventNameItem->setFont(serifFont);
QString color = editorInfo("fontColor"); QString color = editorInfo("fontColor");
@@ -49,7 +49,7 @@ OnEntryExitItem::OnEntryExitItem(BaseItem *parent)
{ {
m_eventNameItem = new TextItem(this); m_eventNameItem = new TextItem(this);
m_eventNameItem->setParentItem(this); m_eventNameItem->setParentItem(this);
QFont serifFont("Times", 13, QFont::Normal); QFont serifFont("Times", 10, QFont::Normal);
m_eventNameItem->setFont(serifFont); m_eventNameItem->setFont(serifFont);
m_eventNameItem->setDefaultTextColor(Qt::black); m_eventNameItem->setDefaultTextColor(Qt::black);
m_eventNameItem->setTextInteractionFlags(Qt::NoTextInteraction); m_eventNameItem->setTextInteractionFlags(Qt::NoTextInteraction);

View File

@@ -232,6 +232,9 @@ void StateItem::transitionsChanged()
} }
m_transitionRect = rectInternalTransitions; m_transitionRect = rectInternalTransitions;
positionOnEntryItems();
positionOnExitItems();
updateBoundingRect(); updateBoundingRect();
} }
@@ -437,8 +440,7 @@ void StateItem::updatePolygon()
f.setPixelSize(m_titleRect.height() * 0.65); f.setPixelSize(m_titleRect.height() * 0.65);
m_stateNameItem->setFont(f); m_stateNameItem->setFont(f);
if (m_onEntryItem) positionOnEntryItems();
m_onEntryItem->setPos(m_titleRect.x(), m_titleRect.bottom());
positionOnExitItems(); positionOnExitItems();
updateTextPositions(); updateTextPositions();
@@ -552,7 +554,7 @@ void StateItem::addChild(ScxmlTag *child)
item->setTag(child); item->setTag(child);
item->finalizeCreation(); item->finalizeCreation();
item->updateAttributes(); item->updateAttributes();
m_onEntryItem->setPos(m_titleRect.x(), m_titleRect.bottom()); positionOnEntryItems();
} else if (child->tagName() == "onexit") { } else if (child->tagName() == "onexit") {
OnEntryExitItem *item = new OnEntryExitItem(this); OnEntryExitItem *item = new OnEntryExitItem(this);
m_onExitItem = item; m_onExitItem = item;
@@ -566,8 +568,18 @@ void StateItem::addChild(ScxmlTag *child)
void StateItem::positionOnExitItems() void StateItem::positionOnExitItems()
{ {
int offset = m_onEntryItem ? m_onEntryItem->boundingRect().height() : 0; int offset = m_onEntryItem ? m_onEntryItem->boundingRect().height() : 0;
if (m_onExitItem) if (m_onExitItem) {
m_onExitItem->setPos(m_titleRect.x(), m_titleRect.bottom() + offset); auto x = m_transitionRect.isValid() ? m_transitionRect.right() : m_titleRect.x();
m_onExitItem->setPos(x, m_titleRect.bottom() + offset);
}
}
void StateItem::positionOnEntryItems()
{
if (m_onEntryItem) {
auto x = m_transitionRect.isValid() ? m_transitionRect.right() : m_titleRect.x();
m_onEntryItem->setPos(x, m_titleRect.bottom());
}
} }
QString StateItem::itemId() const QString StateItem::itemId() const

View File

@@ -75,6 +75,7 @@ private:
void checkParentBoundingRect(); void checkParentBoundingRect();
void checkWarningItems(); void checkWarningItems();
void positionOnExitItems(); void positionOnExitItems();
void positionOnEntryItems();
TextItem *m_stateNameItem; TextItem *m_stateNameItem;
StateWarningItem *m_stateWarningItem = nullptr; StateWarningItem *m_stateWarningItem = nullptr;

View File

@@ -59,12 +59,15 @@ def main():
type(editorWidget, "<Tab>") type(editorWidget, "<Tab>")
type(editorWidget, "Myname") type(editorWidget, "Myname")
result = re.search(pattern.replace("name", "Myname"), str(editorWidget.plainText)) result = re.search(pattern.replace("name", "Myname"), str(editorWidget.plainText))
failMsg = ("Step 5: Seems that not all instances of variable had been renamed "
"- Content of editor:\n%s" % editorWidget.plainText)
if result: if result:
test.passes("Step 5: Verifying if: A value for a variable is inserted and all " test.passes("Step 5: Verifying if: A value for a variable is inserted and all "
"instances of the variable within the snippet are renamed.") "instances of the variable within the snippet are renamed.")
elif JIRA.isBugStillOpen(29012):
test.xfail(failMsg)
else: else:
test.fail("Step 5: Seems that not all instances of variable had been renamed " test.fail(failMsg)
"- Content of editor:\n%s" % editorWidget.plainText)
invokeMenuItem('File', 'Revert "main.cpp" to Saved') invokeMenuItem('File', 'Revert "main.cpp" to Saved')
clickButton(waitForObject(":Revert to Saved.Proceed_QPushButton")) clickButton(waitForObject(":Revert to Saved.Proceed_QPushButton"))
invokeMenuItem("File", "Exit") invokeMenuItem("File", "Exit")