Merge remote-tracking branch 'origin/10.0'

Change-Id: I7a3925ad8e4f97461b64a70217102ed900430253
This commit is contained in:
Eike Ziller
2023-05-05 10:39:47 +02:00
31 changed files with 286 additions and 127 deletions

View File

@@ -23,44 +23,41 @@ instructions:
ref: master ref: master
directory: "build/qtsdk" directory: "build/qtsdk"
userMessageOnFailure: "Failed to install qtsdk, check logs" userMessageOnFailure: "Failed to install qtsdk, check logs"
- type: ExecuteCommand - type: InstallSourceArchive
command: "python3 -m pip install pipenv==2022.4.8 --user" maxTimeInSeconds: 600
maxTimeInSeconds: 1200 maxTimeBetweenOutput: 600
maxTimeBetweenOutput: 120 project: qtsdk/tqtc-qtsdk
userMessageOnFailure: "Failed to install Pipenv" ref: master
directory: "build/tqtc-qtsdk"
userMessageOnFailure: "Failed to install tqtc-qtsdk, check logs"
- type: Group
instructions:
- type: ExecuteCommand
command: python tqtc-qtsdk/jenkins-templates/jenkins/scripts/pkg_bootstrap.py
maxTimeInSeconds: 36000
maxTimeBetweenOutput: 3600
userMessageOnFailure: "pkg_bootstrap.py failed"
enable_if: enable_if:
condition: property condition: and
property: host.os conditions:
in_values: [MacOS, Linux] - condition: property
- type: ExecuteCommand property: host.os
command: "python -m pip install pipenv==2022.4.8 --user" equals_value: Windows
maxTimeInSeconds: 1200 - type: Group
maxTimeBetweenOutput: 120 instructions:
userMessageOnFailure: "Failed to install Pipenv" - type: ExecuteCommand
command: python3 tqtc-qtsdk/jenkins-templates/jenkins/scripts/pkg_bootstrap.py
maxTimeInSeconds: 36000
maxTimeBetweenOutput: 3600
userMessageOnFailure: "pkg_bootstrap.py failed"
enable_if: enable_if:
condition: property condition: and
property: host.os conditions:
equals_value: Windows - condition: property
property: host.os
not_equals_value: Windows
- type: ChangeDirectory - type: ChangeDirectory
directory: "{{.AgentWorkingDir}}/build/qtsdk/packaging-tools" directory: "{{.BuildDir}}/qtsdk/packaging-tools"
- type: ExecuteCommand
command: "python3 -m pipenv install --skip-lock"
maxTimeInSeconds: 1200
maxTimeBetweenOutput: 120
userMessageOnFailure: "Failed to install requirements from Pipfile"
enable_if:
condition: property
property: host.os
in_values: [MacOS, Linux]
- type: ExecuteCommand
command: "python -m pipenv install --skip-lock"
maxTimeInSeconds: 1200
maxTimeBetweenOutput: 120
userMessageOnFailure: "Failed to install requirements from Pipfile"
enable_if:
condition: property
property: host.os
equals_value: Windows
- type: ExecuteCommand - type: ExecuteCommand
command: "python3 -m pipenv run python -u install_qt.py --qt-path {{.BuildDir}}/qt_install_dir --base-url {{.Env.QTC_QT_BASE_URL}} --base-url-postfix={{.Env.QTC_QT_POSTFIX}} --icu7z http://master.qt.io/development_releases/prebuilt/icu/prebuilt/56.1/icu-linux-g++-Rhel7.2-x64.7z {{.Env.QTC_QT_MODULES}}" command: "python3 -m pipenv run python -u install_qt.py --qt-path {{.BuildDir}}/qt_install_dir --base-url {{.Env.QTC_QT_BASE_URL}} --base-url-postfix={{.Env.QTC_QT_POSTFIX}} --icu7z http://master.qt.io/development_releases/prebuilt/icu/prebuilt/56.1/icu-linux-g++-Rhel7.2-x64.7z {{.Env.QTC_QT_MODULES}}"
executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution

105
dist/changelog/changes-10.0.1.md vendored Normal file
View File

@@ -0,0 +1,105 @@
Qt Creator 10.0.1
=================
Qt Creator version 10.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/v10.0.0..v10.0.1
General
-------
* Enabled example categories for Qt 6.5.1 and later
Editing
-------
* Fixed layout issues in the editor toolbar (QTCREATORBUG-28765)
### C++
* Clangd
* Fixed the renaming of macros and namespaces
* Fixed that renaming appended `_new` to the replacement by default
(QTCREATORBUG-28321, QTCREATORBUG-28910)
* Fixed that Cuda files were not passed to Clangd (QTCREATORBUG-28984)
* Clang Format
* Fixed the formatting for advanced C++ (QTCREATORBUG-29033)
* Fixed the updating of the coding style preview (QTCREATORBUG-29043)
* Fixed the indentation of `QML_*` macros (QTCREATORBUG-29086)
### QML
* Fixed a crash when trying to open non-existing `.qml` files
(QTCREATORBUG-29021)
Projects
--------
* Re-added a Qt Quick Application wizard that works with Qt 5 and other build
systems than CMake
* Fixed that additional empty lines could be added to files created by wizards
(QTCREATORBUG-29040)
### CMake
* Added missing `RUNTIME DESTINATION` properties to the `install` commands of
wizard-generated projects (QTCREATORBUG-28999)
* Fixed that macros were not expanded for all configure cache variables
(QTCREATORBUG-28982)
* Fixed switching from `.c` files to their header (QTCREATORBUG-28991)
* Presets
* Fixed that boolean values for cache variables were interpreted as string
values (QTCREATORBUG-29078)
* Fixed inheritance over multiple levels
(QTCREATORBUG-29076)
Debugging
---------
### Clang
* Fixed the pretty printers of `std::string` for Clang 15 and later
Analyzer
--------
### Clang
* Fixed starting Clazy and Clang-Tidy while a build is running
(QTCREATORBUG-29044)
Platforms
---------
### Android
* Fixed that changes to the `JDK Location` did not take effect immediately
(QTCREATORBUG-28827)
* Fixed debugging on Android Automotive devices (QTCREATORBUG-28851)
Credits for these changes go to:
--------------------------------
Alessandro Portale
Artem Sokolovskii
Christian Kandeler
Christian Stenger
Cristian Adam
David Schulz
Eike Ziller
Haowei Hsu
Jaroslaw Kobus
Jussi Witick
Leena Miettinen
Marcus Tillmanns
Orgad Shaneh
Patrik Teivonen
Robert Löhning
Sivert Krøvel
Thiago Macieira
Ulf Hermann
Zoltan Gera

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

View File

@@ -45,6 +45,10 @@
\image qtcreator-project-qt-quick.webp {New Project dialog} \image qtcreator-project-qt-quick.webp {New Project dialog}
\note To use \l qmake as the build system, develop with Qt 5,
or add translations to the application, select
\uicontrol {Qt Quick Application (compat)}.
\li In the \uicontrol {Project Location} dialog, \uicontrol Name field, \li In the \uicontrol {Project Location} dialog, \uicontrol Name field,
enter a name for the project. Keep in mind that you cannot easily enter a name for the project. Keep in mind that you cannot easily
change the project name later. change the project name later.
@@ -63,8 +67,8 @@
\QDS, select \uicontrol {Create a project that you can open in \QDS}. \QDS, select \uicontrol {Create a project that you can open in \QDS}.
\li In the \uicontrol {Build system} field, select the build system to \li In the \uicontrol {Build system} field, select the build system to
use for building and running the project: \l qmake, use for building and running the project: \l {Setting Up CMake}
\l {Setting Up CMake}{CMake}, or \l {Setting Up Qbs}{Qbs}. {CMake} or \l {Setting Up Qbs}{Qbs}.
\li Select \uicontrol Next to open the \li Select \uicontrol Next to open the
\uicontrol {Define Project Details} dialog. \uicontrol {Define Project Details} dialog.

View File

@@ -30,8 +30,8 @@
{CMake} as the build system to use for building and running the {CMake} as the build system to use for building and running the
project. project.
\note If you select \l qmake, the instructions for configuring the \note If you select \l {Setting Up Qbs}{Qbs}, the instructions for
project won't apply. configuring the project won't apply.
\li Select \uicontrol Next to open the \li Select \uicontrol Next to open the
\uicontrol {Define Project Details} dialog. \uicontrol {Define Project Details} dialog.

View File

@@ -15,8 +15,8 @@
\title Creating a Qt Widget Based Application \title Creating a Qt Widget Based Application
This tutorial describes how to use \QC to create a small Qt application, This tutorial describes how to use \QC to create a small Qt application,
Text Finder. It is a simplified version of the Qt UI Tools \l{Text Finder Text Finder. It is a simplified version of the Qt UI Tools \l{Text Finder}
Example}. We use \QD to construct the application user interface from example. You'll use \QD to construct the application user interface from
Qt widgets and the code editor to write the application logic in C++. Qt widgets and the code editor to write the application logic in C++.
\image qtcreator-textfinder-screenshot.png \image qtcreator-textfinder-screenshot.png

View File

@@ -17,6 +17,7 @@
( '%{IncludeQMainWindow}' ) ? 'QtWidgets/%{IncludeQMainWindow}' : '', ( '%{IncludeQMainWindow}' ) ? 'QtWidgets/%{IncludeQMainWindow}' : '',
( '%{IncludeQDeclarativeItem}' ) ? 'QtQuick1/%{IncludeQDeclarativeItem}' : '', ( '%{IncludeQDeclarativeItem}' ) ? 'QtQuick1/%{IncludeQDeclarativeItem}' : '',
( '%{IncludeQQuickItem}' ) ? 'QtDeclarative/%{IncludeQQuickItem}' : '', ( '%{IncludeQQuickItem}' ) ? 'QtDeclarative/%{IncludeQQuickItem}' : '',
( '%{AddQmlElementMacro}' && !'%{IncludeQQuickItem}' ) ? 'QtQml/QQmlEngine' : '',
( '%{IncludeQSharedData}' ) ? 'QtCore/QSharedDataPointer' : '' ])}\ ( '%{IncludeQSharedData}' ) ? 'QtCore/QSharedDataPointer' : '' ])}\
%{JS: Cpp.openNamespaces('%{Class}')} %{JS: Cpp.openNamespaces('%{Class}')}
@if '%{IncludeQSharedData}' @if '%{IncludeQSharedData}'

View File

@@ -5512,7 +5512,7 @@ Add, modify, and remove document filters, which determine the documentation set
</message> </message>
<message> <message>
<source>Hide Sidebar</source> <source>Hide Sidebar</source>
<translation type="unfinished"></translation> <translation></translation>
</message> </message>
<message> <message>
<source>Increase Font Size</source> <source>Increase Font Size</source>
@@ -13006,11 +13006,11 @@ For qmlproject projects, use the importPaths property to add import paths.</sour
</message> </message>
<message> <message>
<source>Toggle &amp;Left Sidebar</source> <source>Toggle &amp;Left Sidebar</source>
<translation>(&amp;L)</translation> <translation>(&amp;L)</translation>
</message> </message>
<message> <message>
<source>Toggle &amp;Right Sidebar</source> <source>Toggle &amp;Right Sidebar</source>
<translation>(&amp;R)</translation> <translation>(&amp;R)</translation>
</message> </message>
<message> <message>
<source>Projects</source> <source>Projects</source>
@@ -14917,11 +14917,11 @@ Ids must begin with a lowercase letter.</source>
</message> </message>
<message> <message>
<source>Hide Sidebar</source> <source>Hide Sidebar</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<source>Show Sidebar</source> <source>Show Sidebar</source>
<translation></translation> <translation></translation>
</message> </message>
</context> </context>
<context> <context>
@@ -15671,7 +15671,7 @@ instead of its installation directory when run outside git bash.</source>
<name>QtC::Help</name> <name>QtC::Help</name>
<message> <message>
<source>Show Sidebar</source> <source>Show Sidebar</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<source>Qt Creator Offline Help</source> <source>Qt Creator Offline Help</source>

View File

@@ -248,7 +248,10 @@ bool FileInProjectFinder::findFileOrDirectory(const FilePath &originalPath, File
} }
} }
while (prefixToIgnore != -1) { while (prefixToIgnore != -1) {
FilePath candidate = originalPath.resolvePath(m_projectDir); QString candidateString = originalPath.toFSPathString();
candidateString.remove(0, prefixToIgnore);
candidateString.prepend(m_projectDir.toString());
const FilePath candidate = FilePath::fromString(candidateString);
const int matchLength = origLength - prefixToIgnore; const int matchLength = origLength - prefixToIgnore;
// FIXME: This might be a worse match than what we find later. // FIXME: This might be a worse match than what we find later.
if (checkPath(candidate, matchLength, fileHandler, directoryHandler)) { if (checkPath(candidate, matchLength, fileHandler, directoryHandler)) {

View File

@@ -171,9 +171,7 @@ clang::format::FormatStyle qtcStyle()
style.SpacesInCStyleCastParentheses = false; style.SpacesInCStyleCastParentheses = false;
style.SpacesInParentheses = false; style.SpacesInParentheses = false;
style.SpacesInSquareBrackets = false; style.SpacesInSquareBrackets = false;
style.StatementMacros.emplace_back("Q_OBJECT"); addQtcStatementMacros(style);
style.StatementMacros.emplace_back("QT_BEGIN_NAMESPACE");
style.StatementMacros.emplace_back("QT_END_NAMESPACE");
style.Standard = FormatStyle::LS_Cpp11; style.Standard = FormatStyle::LS_Cpp11;
style.TabWidth = 4; style.TabWidth = 4;
style.UseTab = FormatStyle::UT_Never; style.UseTab = FormatStyle::UT_Never;
@@ -278,9 +276,44 @@ Utils::FilePath configForFile(const Utils::FilePath &fileName)
void addQtcStatementMacros(clang::format::FormatStyle &style) void addQtcStatementMacros(clang::format::FormatStyle &style)
{ {
static const std::vector<std::string> macros = {"Q_OBJECT", static const std::vector<std::string> macros = {"Q_CLASSINFO",
"Q_ENUM",
"Q_ENUM_NS",
"Q_FLAG",
"Q_FLAG_NS",
"Q_GADGET",
"Q_GADGET_EXPORT",
"Q_INTERFACES",
"Q_MOC_INCLUDE",
"Q_NAMESPACE",
"Q_NAMESPACE_EXPORT",
"Q_OBJECT",
"Q_PROPERTY",
"Q_REVISION",
"Q_DISABLE_COPY",
"Q_SET_OBJECT_NAME",
"QT_BEGIN_NAMESPACE", "QT_BEGIN_NAMESPACE",
"QT_END_NAMESPACE"}; "QT_END_NAMESPACE",
"QML_ADDED_IN_MINOR_VERSION",
"QML_ANONYMOUS",
"QML_ATTACHED",
"QML_DECLARE_TYPE",
"QML_DECLARE_TYPEINFO",
"QML_ELEMENT",
"QML_EXTENDED",
"QML_EXTENDED_NAMESPACE",
"QML_EXTRA_VERSION",
"QML_FOREIGN",
"QML_FOREIGN_NAMESPACE",
"QML_IMPLEMENTS_INTERFACES",
"QML_INTERFACE",
"QML_NAMED_ELEMENT",
"QML_REMOVED_IN_MINOR_VERSION",
"QML_SINGLETON",
"QML_UNAVAILABLE",
"QML_UNCREATABLE",
"QML_VALUE_TYPE"};
for (const std::string &macro : macros) { for (const std::string &macro : macros) {
if (std::find(style.StatementMacros.begin(), style.StatementMacros.end(), macro) if (std::find(style.StatementMacros.begin(), style.StatementMacros.end(), macro)
== style.StatementMacros.end()) == style.StatementMacros.end())

View File

@@ -628,10 +628,16 @@ void ClangFormatTest::testCommentBlock()
void ClangFormatTest::testClassIndentStructure() void ClangFormatTest::testClassIndentStructure()
{ {
insertLines({"class test {", " Q_OBJECT", " public:", "};"}); insertLines(
{"class test {", " Q_OBJECT", " QML_ELEMENT", " QML_SINGLETON", " public:", "};"});
m_indenter->indent(*m_cursor, QChar::Null, TextEditor::TabSettings()); m_indenter->indent(*m_cursor, QChar::Null, TextEditor::TabSettings());
QCOMPARE(documentLines(), QCOMPARE(documentLines(),
(std::vector<QString>{"class test {", " Q_OBJECT", "public:", "};"})); (std::vector<QString>{"class test {",
" Q_OBJECT",
" QML_ELEMENT",
" QML_SINGLETON",
"public:",
"};"}));
} }
void ClangFormatTest::testIndentInitializeVector() void ClangFormatTest::testIndentInitializeVector()

View File

@@ -105,7 +105,9 @@ Internal::PresetsData CMakeProject::combinePresets(Internal::PresetsData &cmakeP
Utils::sort(presetsList, [](const auto &left, const auto &right) { Utils::sort(presetsList, [](const auto &left, const auto &right) {
const bool sameInheritance = left.inherits && right.inherits const bool sameInheritance = left.inherits && right.inherits
&& left.inherits.value() == right.inherits.value(); && left.inherits.value() == right.inherits.value();
if (!left.inherits || left.inherits.value().contains(right.name) || sameInheritance) const bool leftInheritsRight = left.inherits
&& left.inherits.value().contains(right.name);
if ((left.inherits && !right.inherits) || leftInheritsRight || sameInheritance)
return false; return false;
return true; return true;
}); });

View File

@@ -82,7 +82,7 @@ std::optional<PresetsDetails::Condition> parseCondition(const QJsonValue &jsonVa
if (type == "const") { if (type == "const") {
condition->type = type; condition->type = type;
condition->constValue = object.value("const").toBool(); condition->constValue = object.value("value").toBool();
return condition; return condition;
} }

View File

@@ -94,7 +94,7 @@ QVariant FilterItem::data(int column, int role) const
return m_filter->shortcutString(); return m_filter->shortcutString();
break; break;
case FilterIncludedByDefault: case FilterIncludedByDefault:
if (role == Qt::CheckStateRole || role == SortRole || role == Qt::EditRole) if (role == Qt::CheckStateRole || role == SortRole)
return m_filter->isIncludedByDefault() ? Qt::Checked : Qt::Unchecked; return m_filter->isIncludedByDefault() ? Qt::Checked : Qt::Unchecked;
break; break;
default: default:
@@ -113,7 +113,7 @@ Qt::ItemFlags FilterItem::flags(int column) const
if (column == FilterPrefix) if (column == FilterPrefix)
return Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable; return Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable;
if (column == FilterIncludedByDefault) if (column == FilterIncludedByDefault)
return Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsUserCheckable; return Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable;
return Qt::ItemIsSelectable | Qt::ItemIsEnabled; return Qt::ItemIsSelectable | Qt::ItemIsEnabled;
} }

View File

@@ -1267,20 +1267,16 @@ std::unique_ptr<AssistInterface> CppEditorWidget::createAssistInterface(AssistKi
if (cap) if (cap)
return cap->createAssistInterface(textDocument()->filePath(), this, getFeatures(), reason); return cap->createAssistInterface(textDocument()->filePath(), this, getFeatures(), reason);
else {
if (isOldStyleSignalOrSlot()) if (isOldStyleSignalOrSlot()) {
return CppModelManager::instance() return CppModelManager::instance()
->completionAssistProvider() ->completionAssistProvider()
->createAssistInterface(textDocument()->filePath(), this, getFeatures(), reason); ->createAssistInterface(textDocument()->filePath(), this, getFeatures(), reason);
return TextEditorWidget::createAssistInterface(kind, reason);
} }
} else if (kind == QuickFix) {
if (isSemanticInfoValid())
return std::make_unique<CppQuickFixInterface>(const_cast<CppEditorWidget *>(this), reason);
} else {
return TextEditorWidget::createAssistInterface(kind, reason);
} }
return nullptr; if (kind == QuickFix && isSemanticInfoValid())
return std::make_unique<CppQuickFixInterface>(const_cast<CppEditorWidget *>(this), reason);
return TextEditorWidget::createAssistInterface(kind, reason);
} }
QSharedPointer<FunctionDeclDefLink> CppEditorWidget::declDefLink() const QSharedPointer<FunctionDeclDefLink> CppEditorWidget::declDefLink() const

View File

@@ -149,7 +149,8 @@ QTextCursor CppQuickFixInterface::adjustedCursor()
QuickFixOperations quickFixOperations(const TextEditor::AssistInterface *interface) QuickFixOperations quickFixOperations(const TextEditor::AssistInterface *interface)
{ {
const auto cppInterface = dynamic_cast<const CppQuickFixInterface *>(interface); const auto cppInterface = dynamic_cast<const CppQuickFixInterface *>(interface);
QTC_ASSERT(cppInterface, return {}); if (!cppInterface)
return {};
QuickFixOperations quickFixes; QuickFixOperations quickFixes;
for (CppQuickFixFactory *factory : CppQuickFixFactory::cppQuickFixFactories()) for (CppQuickFixFactory *factory : CppQuickFixFactory::cppQuickFixFactories())
factory->match(*cppInterface, quickFixes); factory->match(*cppInterface, quickFixes);

View File

@@ -330,8 +330,9 @@ bool GenericBuildSystem::addFiles(Node *, const FilePaths &filePaths_, FilePaths
QSet<QString> toAdd; QSet<QString> toAdd;
for (const QString &filePath : filePaths) { for (const QString &filePath : filePaths) {
const QString directory = QFileInfo(filePath).absolutePath(); const QFileInfo fi(filePath);
if (!includes.contains(directory)) const QString directory = fi.absolutePath();
if (fi.fileName() == "include" && !includes.contains(directory))
toAdd << directory; toAdd << directory;
} }

View File

@@ -141,6 +141,8 @@ Core::GeneratedFiles GenericProjectWizard::generateFiles(const QWizard *w,
const QDir dir(projectPath.toString()); const QDir dir(projectPath.toString());
for (const QString &path : paths) { for (const QString &path : paths) {
QFileInfo fileInfo(path); QFileInfo fileInfo(path);
if (fileInfo.fileName() != "include")
continue;
QDir thisDir(fileInfo.absoluteFilePath()); QDir thisDir(fileInfo.absoluteFilePath());
if (! thisDir.entryList(nameFilters, QDir::Files).isEmpty()) { if (! thisDir.entryList(nameFilters, QDir::Files).isEmpty()) {

View File

@@ -289,8 +289,7 @@ public:
cMakeToolchainFile.toString().toUtf8()); cMakeToolchainFile.toString().toUtf8());
if (!cMakeToolchainFile.exists()) { if (!cMakeToolchainFile.exists()) {
printMessage( printMessage(
Tr::tr( Tr::tr("Warning for target %1: missing CMake toolchain file expected at %2.")
"Warning for target %1: missing CMake toolchain file expected at %2.")
.arg(generateKitNameFromTarget(mcuTarget), .arg(generateKitNameFromTarget(mcuTarget),
cMakeToolchainFile.toUserOutput()), cMakeToolchainFile.toUserOutput()),
false); false);
@@ -301,8 +300,7 @@ public:
"/lib/cmake/Qul/QulGenerators.cmake"); "/lib/cmake/Qul/QulGenerators.cmake");
configMap.insert("QUL_GENERATORS", generatorsPath.toString().toUtf8()); configMap.insert("QUL_GENERATORS", generatorsPath.toString().toUtf8());
if (!generatorsPath.exists()) { if (!generatorsPath.exists()) {
printMessage(Tr::tr( printMessage(Tr::tr("Warning for target %1: missing QulGenerators expected at %2.")
"Warning for target %1: missing QulGenerators expected at %2.")
.arg(generateKitNameFromTarget(mcuTarget), .arg(generateKitNameFromTarget(mcuTarget),
generatorsPath.toUserOutput()), generatorsPath.toUserOutput()),
false); false);
@@ -510,8 +508,7 @@ void createAutomaticKits(const SettingsHandler::Ptr &settingsHandler)
} }
case McuAbstractPackage::Status::EmptyPath: { case McuAbstractPackage::Status::EmptyPath: {
printMessage( printMessage(
Tr::tr( Tr::tr("Missing %1. Add the path in Edit > Preferences > Devices > MCU.")
"Missing %1. Add the path in Edit > Preferences > Devices > MCU.")
.arg(qtForMCUsPackage->detectionPath().toUserOutput()), .arg(qtForMCUsPackage->detectionPath().toUserOutput()),
true); true);
return; return;
@@ -524,9 +521,8 @@ void createAutomaticKits(const SettingsHandler::Ptr &settingsHandler)
if (CMakeProjectManager::CMakeToolManager::cmakeTools().isEmpty()) { if (CMakeProjectManager::CMakeToolManager::cmakeTools().isEmpty()) {
printMessage( printMessage(
Tr::tr( Tr::tr("No CMake tool was detected. Add a CMake tool in Edit > Preferences > "
"No CMake tool was detected. Add a CMake tool in Edit > Preferences > " "Kits > CMake."),
"Kits > CMake."),
true); true);
return; return;
} }
@@ -744,11 +740,17 @@ static bool anyKitDescriptionFileExists(const FilePaths &jsonFiles,
const QRegularExpressionMatch match = re.match(jsonFile.fileName()); const QRegularExpressionMatch match = re.match(jsonFile.fileName());
QStringList kitsPropertiesFromFileName; QStringList kitsPropertiesFromFileName;
if (match.hasMatch()) { if (match.hasMatch()) {
const QString toolchain = match.captured(1).replace( QString toolchain = match.captured(1);
"gnu", "gcc"); // kitFileName contains gnu while profiles.xml contains gcc
const QString vendor = match.captured(2); const QString vendor = match.captured(2);
const QString device = match.captured(3); const QString device = match.captured(3);
/*
* file name of kit starts with "gnu" while in profiles.xml name of
* toolchain is "gcc" on Linux and "mingw" on Windows
*/
toolchain = HostOsInfo::isLinuxHost() ? toolchain.replace("gnu", "gcc")
: toolchain.replace("gnu", "mingw");
kitsPropertiesFromFileName << toolchain << vendor << device; kitsPropertiesFromFileName << toolchain << vendor << device;
} }

View File

@@ -1042,7 +1042,7 @@ std::unique_ptr<AssistInterface> QmlJSEditorWidget::createAssistInterface(
return std::make_unique<Internal::QmlJSQuickFixAssistInterface>( return std::make_unique<Internal::QmlJSQuickFixAssistInterface>(
const_cast<QmlJSEditorWidget *>(this), reason); const_cast<QmlJSEditorWidget *>(this), reason);
} }
return nullptr; return TextEditorWidget::createAssistInterface(assistKind, reason);
} }
QString QmlJSEditorWidget::foldReplacementText(const QTextBlock &block) const QString QmlJSEditorWidget::foldReplacementText(const QTextBlock &block) const

View File

@@ -175,8 +175,7 @@ void CodeAssistantPrivate::requestProposal(AssistReason reason,
std::unique_ptr<AssistInterface> assistInterface = std::unique_ptr<AssistInterface> assistInterface =
m_editorWidget->createAssistInterface(kind, reason); m_editorWidget->createAssistInterface(kind, reason);
if (!assistInterface) QTC_ASSERT(assistInterface, return);
return;
// We got an assist provider and interface so no need to reset the current context anymore // We got an assist provider and interface so no need to reset the current context anymore
earlyReturnContextClear.reset({}); earlyReturnContextClear.reset({});
@@ -403,8 +402,10 @@ void CodeAssistantPrivate::notifyChange()
if (m_editorWidget->position() < m_proposalWidget->basePosition()) { if (m_editorWidget->position() < m_proposalWidget->basePosition()) {
destroyContext(); destroyContext();
} else { } else {
m_proposalWidget->updateProposal( std::unique_ptr<AssistInterface> assistInterface
m_editorWidget->createAssistInterface(m_assistKind, m_proposalWidget->reason())); = m_editorWidget->createAssistInterface(m_assistKind, m_proposalWidget->reason());
QTC_ASSERT(assistInterface, destroyContext(); return);
m_proposalWidget->updateProposal(std::move(assistInterface));
if (!isDisplayingProposal()) if (!isDisplayingProposal())
requestActivationCharProposal(); requestActivationCharProposal();
} }

View File

@@ -5,7 +5,6 @@ QtcAutotest {
Depends { name: "QmlJS" } Depends { name: "QmlJS" }
files: [ "tst_testtrie.h", "tst_testtrie.cpp" ] files: [ "tst_testtrie.h", "tst_testtrie.cpp" ]
cpp.defines: base.concat([ cpp.defines: base.concat([
'QMLJS_LIBRARY',
'QTCREATORDIR="' + project.ide_source_tree + '"', 'QTCREATORDIR="' + project.ide_source_tree + '"',
'TESTSRCDIR="' + path + '"' 'TESTSRCDIR="' + path + '"'
]) ])

View File

@@ -544,6 +544,7 @@ def checkAndCopyFiles(dataSet, fieldName, templateDir):
files = map(lambda record: files = map(lambda record:
os.path.normpath(os.path.join(srcPath, testData.field(record, fieldName))), os.path.normpath(os.path.join(srcPath, testData.field(record, fieldName))),
dataSet) dataSet)
files = list(files) # copy data from map object to list to make it reusable
for currentFile in files: for currentFile in files:
if not neededFilePresent(currentFile): if not neededFilePresent(currentFile):
return [] return []

View File

@@ -513,8 +513,13 @@ def progressBarWait(timeout=60000, warn=True):
checkIfObjectExists(":Qt Creator_Core::Internal::ProgressBar", False, timeout) checkIfObjectExists(":Qt Creator_Core::Internal::ProgressBar", False, timeout)
def readFile(filename): def readFile(filename):
with open(filename, "r") as f: try:
return f.read() with open(filename, "r") as f:
return f.read()
except:
# Read file as binary
with open(filename, "rb") as f:
return f.read()
def simpleFileName(navigatorFileName): def simpleFileName(navigatorFileName):
# try to find the last part of the given name, assume it's inside a (folder) structure # try to find the last part of the given name, assume it's inside a (folder) structure

View File

@@ -50,10 +50,6 @@ def main():
} }
for useClang in [False, True]: for useClang in [False, True]:
with TestSection(getCodeModelString(useClang)): with TestSection(getCodeModelString(useClang)):
if (useClang and platform.system() in ('Windows', 'Microsoft')
and JIRA.isBugStillOpen(18607)):
test.warning("Skipping unstable tests on Windows", "See QTCREATORBUG-18607")
continue
if not startCreatorVerifyingClang(useClang): if not startCreatorVerifyingClang(useClang):
continue continue
projectName = createNewNonQtProject(tempDir(), "project-csup03", projectName = createNewNonQtProject(tempDir(), "project-csup03",

View File

@@ -42,8 +42,14 @@ def performAutoCompletionTest(editor, lineToStartRegEx, linePrefix, testFunc, *f
def checkIncludeCompletion(editor, isClangCodeModel): def checkIncludeCompletion(editor, isClangCodeModel):
test.log("Check auto-completion of include statements.") test.log("Check auto-completion of include statements.")
# define special handlings # define special handlings
noProposal = ["detail/hea"] noProposal = []
specialHandling = {"ios":"iostream", "cstd":"cstdio"} specialHandling = {"ios":"iostream", "cstd":"cstdio"}
if isClangCodeModel:
specialHandling["QDe"] = "QDebug"
for i in specialHandling.keys():
specialHandling[i] = " %s>" % specialHandling[i]
else:
noProposal += ["detail/hea"]
# define test function to perform the _real_ auto completion test on the current line # define test function to perform the _real_ auto completion test on the current line
def testIncl(currentLine, *args): def testIncl(currentLine, *args):
@@ -69,25 +75,24 @@ def checkIncludeCompletion(editor, isClangCodeModel):
def checkSymbolCompletion(editor, isClangCodeModel): def checkSymbolCompletion(editor, isClangCodeModel):
test.log("Check auto-completion of symbols.") test.log("Check auto-completion of symbols.")
# define special handlings # define special handlings
expectedSuggestion = {"in":["internal", "int", "INT_MAX", "INT_MIN"], expectedSuggestion = {"in":["internal", "int", "intmax_t"],
"Dum":["Dummy", "dummy"], "Dummy::O":["ONE","one"], "Dum":["Dummy", "dummy"], "Dummy::O":["ONE","one"],
"dummy.":["foo", "bla", "ONE", "one", "PI", "sfunc", "v1", "v2", "v3"], "dummy.":["one", "ONE", "PI", "v1", "v2", "v3"],
"dummy.o":["one", "ONE"], "Dummy::In":["Internal", "INT"], "dummy.o":["one", "ONE"], "Dummy::In":["Internal", "INT"],
"Dummy::Internal::":["DOUBLE", "one"] "Dummy::Internal::":["DOUBLE", "one"]
} }
missing = ["Dummy::s", "Dummy::P", "dummy.b", "dummy.bla(", "internal.o", "freefunc2"] missing = ["Dummy::s", "Dummy::P", "dummy.b", "dummy.bla(", "internal.o", "freefunc2"]
expectedResults = {"dummy.":"dummy.foo(", "Dummy::s":"Dummy::sfunc()", expectedResults = {"Dummy::s":"Dummy::sfunc()",
"Dummy::P":"Dummy::PI", "dummy.b":"dummy.bla(", "dummy.bla(":"dummy.bla(", "Dummy::P":"Dummy::PI", "dummy.b":"dummy.bla(", "dummy.bla(":"dummy.bla(",
"internal.o":"internal.one", "freefunc2":"freefunc2(", "internal.o":"internal.one", "freefunc2":"freefunc2(",
"using namespace st":"using namespace std", "afun":"afunc()"} "using namespace st":"using namespace std", "afun":"afunc()"}
if isClangCodeModel: if isClangCodeModel:
missing.remove("internal.o") missing = ["dummy.bla("]
expectedSuggestion["in"] = ["internal", "int"] # QTCREATORBUG-22728 expectedSuggestion["internal.o"] = ["one"]
expectedSuggestion["internal.o"] = ["one", "operator="]
if platform.system() in ('Microsoft', 'Windows'): if platform.system() in ('Microsoft', 'Windows'):
expectedSuggestion["using namespace st"] = ["std", "stdext"] expectedSuggestion["using namespace st"] = ["std", "stdext"]
else: else:
expectedSuggestion["using namespace st"] = ["std", "struct ", "struct template"] expectedSuggestion["using namespace st"] = ["std", "struct", "struct template"]
else: else:
expectedSuggestion["using namespace st"] = ["std", "st"] expectedSuggestion["using namespace st"] = ["std", "st"]
# define test function to perform the _real_ auto completion test on the current line # define test function to perform the _real_ auto completion test on the current line
@@ -101,27 +106,25 @@ def checkSymbolCompletion(editor, isClangCodeModel):
found = [] found = []
if propShown: if propShown:
proposalListView = waitForObject(':popupFrame_Proposal_QListView') proposalListView = waitForObject(':popupFrame_Proposal_QListView')
found = dumpItems(proposalListView.model()) found = [i.strip() for i in dumpItems(proposalListView.model())]
diffShownExp = set(expectedSug.get(symbol, [])) - set(found) diffShownExp = set(expectedSug.get(symbol, [])) - set(found)
if not test.verify(len(diffShownExp) == 0, if not test.verify(len(diffShownExp) == 0,
"Verify if all expected suggestions could be found"): "Verify if all expected suggestions could be found"):
test.log("Expected but not found suggestions: %s" % diffShownExp, test.log("Expected but not found suggestions: %s" % diffShownExp,
"%s | %s" % (expectedSug[symbol], str(found))) "%s | %s" % (expectedSug[symbol], str(found)))
# select first item of the expected suggestion list # select first item of the expected suggestion list
doubleClickItem(':popupFrame_Proposal_QListView', expectedSug.get(symbol, found)[0], suggestionToClick = expectedSug.get(symbol, found)[0]
if isClangCodeModel:
suggestionToClick = " " + suggestionToClick
doubleClickItem(':popupFrame_Proposal_QListView', suggestionToClick,
5, 5, 0, Qt.LeftButton) 5, 5, 0, Qt.LeftButton)
changedLine = str(lineUnderCursor(editor)).strip() changedLine = str(lineUnderCursor(editor)).strip()
if symbol in expectedRes: if symbol in expectedRes:
exp = expectedRes[symbol] exp = expectedRes[symbol]
else: else:
exp = (symbol[:max(symbol.rfind(":"), symbol.rfind(".")) + 1] exp = (symbol[:max(symbol.rfind(":"), symbol.rfind(".")) + 1]
+ expectedSug.get(symbol, found)[0]) + expectedSug.get(symbol, found)[0]).strip()
if isClangCodeModel and changedLine != exp and JIRA.isBugStillOpen(15483): test.compare(changedLine, exp, "Verify completion matches.")
test.xcompare(changedLine, exp, "Verify completion matches (QTCREATORBUG-15483).")
test.verify(changedLine.startswith(exp.replace("(", "").replace(")", "")),
"Verify completion starts with expected string.")
else:
test.compare(changedLine, exp, "Verify completion matches.")
performAutoCompletionTest(editor, ".*Complete symbols.*", "//", performAutoCompletionTest(editor, ".*Complete symbols.*", "//",
testSymb, missing, expectedSuggestion, expectedResults) testSymb, missing, expectedSuggestion, expectedResults)
@@ -143,6 +146,10 @@ def main():
return return
editor = getEditorForFileSuffix("main.cpp") editor = getEditorForFileSuffix("main.cpp")
if editor: if editor:
if useClang:
test.log("Wait for parsing to finish...")
progressBarWait(15000)
test.log("Parsing done.")
checkIncludeCompletion(editor, useClang) checkIncludeCompletion(editor, useClang)
checkSymbolCompletion(editor, useClang) checkSymbolCompletion(editor, useClang)
invokeMenuItem('File', 'Revert "main.cpp" to Saved') invokeMenuItem('File', 'Revert "main.cpp" to Saved')

View File

@@ -87,8 +87,7 @@ def main():
type(resultWidget, "<Return>") type(resultWidget, "<Return>")
waitFor("__getUrl__() != url or selText != __getSelectedText__()", 20000) waitFor("__getUrl__() != url or selText != __getSelectedText__()", 20000)
verifySelection(searchKeyword) verifySelection(searchKeyword)
if not (searchKeyword == "QODBC" and JIRA.isBugStillOpen(10331)): verifyUrl(urlDictionary[searchKeyword])
verifyUrl(urlDictionary[searchKeyword])
else: else:
test.verify(waitFor("noMatch in " test.verify(waitFor("noMatch in "
"str(resultWidget.plainText)", 1000), "str(resultWidget.plainText)", 1000),

View File

@@ -48,14 +48,12 @@ def main():
pass pass
# open MyComponent.qml file for verification # open MyComponent.qml file for verification
docOpened = openDocument(myCompTE) docOpened = openDocument(myCompTE)
if JIRA.isBugStillOpen(28985): # Work around QTCREATORBUG-28985
test.xverify(docOpened, "Was MyComponent.qml properly generated in project explorer?") test.xverify(docOpened, "Was MyComponent.qml properly generated in project explorer?")
saveAndExit() saveAndExit()
return return
if not test.verify(docOpened, "Was MyComponent.qml properly generated in project explorer?"): # The workaround will be removed in master branch
test.fatal("Could not open MyComponent.qml.") # Following dead code left in intentionally to still allow merging forward changes in it.
saveAndExit()
return
editorArea = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget") editorArea = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
codeText = str(editorArea.plainText) codeText = str(editorArea.plainText)
# there should be Text item in new file # there should be Text item in new file

View File

@@ -12,7 +12,7 @@ TripleTab = '\t\t\t'
def main(): def main():
files = map(lambda record: os.path.join(srcPath, testData.field(record, "filename")), files = map(lambda record: os.path.join(srcPath, testData.field(record, "filename")),
testData.dataset("files.tsv")) testData.dataset("files.tsv"))
files = filter(lambda x: not x.endswith(".bin"), files) files = list(filter(lambda x: not x.endswith(".bin"), files))
for currentFile in files: for currentFile in files:
if not neededFilePresent(currentFile): if not neededFilePresent(currentFile):
return return

View File

@@ -8,7 +8,7 @@ source("../../shared/qtcreator.py")
def main(): def main():
files = map(lambda record: os.path.join(srcPath, testData.field(record, "filename")), files = map(lambda record: os.path.join(srcPath, testData.field(record, "filename")),
testData.dataset("files.tsv")) testData.dataset("files.tsv"))
files = filter(lambda x: not x.endswith(".bin"), files) files = list(filter(lambda x: not x.endswith(".bin"), files))
for currentFile in files: for currentFile in files:
if not neededFilePresent(currentFile): if not neededFilePresent(currentFile):
return return