diff options
31 files changed, 285 insertions, 126 deletions
diff --git a/coin/instructions/provision.yaml b/coin/instructions/provision.yaml index bbed89c388..c11325d137 100644 --- a/coin/instructions/provision.yaml +++ b/coin/instructions/provision.yaml @@ -23,44 +23,41 @@ instructions: ref: master directory: "build/qtsdk" userMessageOnFailure: "Failed to install qtsdk, check logs" - - type: ExecuteCommand - command: "python3 -m pip install pipenv==2022.4.8 --user" - maxTimeInSeconds: 1200 - maxTimeBetweenOutput: 120 - userMessageOnFailure: "Failed to install Pipenv" + - type: InstallSourceArchive + maxTimeInSeconds: 600 + maxTimeBetweenOutput: 600 + project: qtsdk/tqtc-qtsdk + 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: - condition: property - property: host.os - in_values: [MacOS, Linux] - - type: ExecuteCommand - command: "python -m pip install pipenv==2022.4.8 --user" - maxTimeInSeconds: 1200 - maxTimeBetweenOutput: 120 - userMessageOnFailure: "Failed to install Pipenv" + condition: and + conditions: + - condition: property + property: host.os + equals_value: Windows + - type: Group + instructions: + - type: ExecuteCommand + command: python3 tqtc-qtsdk/jenkins-templates/jenkins/scripts/pkg_bootstrap.py + maxTimeInSeconds: 36000 + maxTimeBetweenOutput: 3600 + userMessageOnFailure: "pkg_bootstrap.py failed" enable_if: - condition: property - property: host.os - equals_value: Windows + condition: and + conditions: + - condition: property + property: host.os + not_equals_value: Windows - type: ChangeDirectory - directory: "{{.AgentWorkingDir}}/build/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 + directory: "{{.BuildDir}}/qtsdk/packaging-tools" - 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}}" executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution diff --git a/dist/changelog/changes-10.0.1.md b/dist/changelog/changes-10.0.1.md new file mode 100644 index 0000000000..a7fcfba973 --- /dev/null +++ b/dist/changelog/changes-10.0.1.md @@ -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 diff --git a/doc/qtcreator/images/qtcreator-project-qt-quick.webp b/doc/qtcreator/images/qtcreator-project-qt-quick.webp Binary files differindex 48a83d2dda..ac329a5c43 100644 --- a/doc/qtcreator/images/qtcreator-project-qt-quick.webp +++ b/doc/qtcreator/images/qtcreator-project-qt-quick.webp diff --git a/doc/qtcreator/src/qtquick/creator-only/qtquick-creating.qdoc b/doc/qtcreator/src/qtquick/creator-only/qtquick-creating.qdoc index f92d29625b..5545834964 100644 --- a/doc/qtcreator/src/qtquick/creator-only/qtquick-creating.qdoc +++ b/doc/qtcreator/src/qtquick/creator-only/qtquick-creating.qdoc @@ -45,6 +45,10 @@ \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, enter a name for the project. Keep in mind that you cannot easily change the project name later. @@ -63,8 +67,8 @@ \QDS, select \uicontrol {Create a project that you can open in \QDS}. \li In the \uicontrol {Build system} field, select the build system to - use for building and running the project: \l qmake, - \l {Setting Up CMake}{CMake}, or \l {Setting Up Qbs}{Qbs}. + use for building and running the project: \l {Setting Up CMake} + {CMake} or \l {Setting Up Qbs}{Qbs}. \li Select \uicontrol Next to open the \uicontrol {Define Project Details} dialog. diff --git a/doc/qtcreator/src/qtquick/creator-only/qtquick-tutorial-create-empty-project.qdocinc b/doc/qtcreator/src/qtquick/creator-only/qtquick-tutorial-create-empty-project.qdocinc index 9fd1af9b34..d0a5b94cc0 100644 --- a/doc/qtcreator/src/qtquick/creator-only/qtquick-tutorial-create-empty-project.qdocinc +++ b/doc/qtcreator/src/qtquick/creator-only/qtquick-tutorial-create-empty-project.qdocinc @@ -30,8 +30,8 @@ {CMake} as the build system to use for building and running the project. - \note If you select \l qmake, the instructions for configuring the - project won't apply. + \note If you select \l {Setting Up Qbs}{Qbs}, the instructions for + configuring the project won't apply. \li Select \uicontrol Next to open the \uicontrol {Define Project Details} dialog. diff --git a/doc/qtcreator/src/widgets/qtdesigner-app-tutorial.qdoc b/doc/qtcreator/src/widgets/qtdesigner-app-tutorial.qdoc index d211b570d2..ad38116dff 100644 --- a/doc/qtcreator/src/widgets/qtdesigner-app-tutorial.qdoc +++ b/doc/qtcreator/src/widgets/qtdesigner-app-tutorial.qdoc @@ -15,8 +15,8 @@ \title Creating a Qt Widget Based 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 - Example}. We use \QD to construct the application user interface from + Text Finder. It is a simplified version of the Qt UI Tools \l{Text Finder} + 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++. \image qtcreator-textfinder-screenshot.png diff --git a/share/qtcreator/templates/wizards/classes/cpp/file.h b/share/qtcreator/templates/wizards/classes/cpp/file.h index 77f1b21351..ad2b178e8f 100644 --- a/share/qtcreator/templates/wizards/classes/cpp/file.h +++ b/share/qtcreator/templates/wizards/classes/cpp/file.h @@ -17,6 +17,7 @@ ( '%{IncludeQMainWindow}' ) ? 'QtWidgets/%{IncludeQMainWindow}' : '', ( '%{IncludeQDeclarativeItem}' ) ? 'QtQuick1/%{IncludeQDeclarativeItem}' : '', ( '%{IncludeQQuickItem}' ) ? 'QtDeclarative/%{IncludeQQuickItem}' : '', + ( '%{AddQmlElementMacro}' && !'%{IncludeQQuickItem}' ) ? 'QtQml/QQmlEngine' : '', ( '%{IncludeQSharedData}' ) ? 'QtCore/QSharedDataPointer' : '' ])}\ %{JS: Cpp.openNamespaces('%{Class}')} @if '%{IncludeQSharedData}' diff --git a/share/qtcreator/translations/qtcreator_zh_TW.ts b/share/qtcreator/translations/qtcreator_zh_TW.ts index bf09c6b901..c1f35c8180 100644 --- a/share/qtcreator/translations/qtcreator_zh_TW.ts +++ b/share/qtcreator/translations/qtcreator_zh_TW.ts @@ -5512,7 +5512,7 @@ Add, modify, and remove document filters, which determine the documentation set </message> <message> <source>Hide Sidebar</source> - <translation type="unfinished">隱藏邊列</translation> + <translation>隱藏側邊條</translation> </message> <message> <source>Increase Font Size</source> @@ -13006,11 +13006,11 @@ For qmlproject projects, use the importPaths property to add import paths.</sour </message> <message> <source>Toggle &Left Sidebar</source> - <translation>切換左邊欄(&L)</translation> + <translation>切換左側邊條(&L)</translation> </message> <message> <source>Toggle &Right Sidebar</source> - <translation>切換右邊欄(&R)</translation> + <translation>切換右側邊條(&R)</translation> </message> <message> <source>Projects</source> @@ -14917,11 +14917,11 @@ Ids must begin with a lowercase letter.</source> </message> <message> <source>Hide Sidebar</source> - <translation>隱藏邊列</translation> + <translation>隱藏側邊條</translation> </message> <message> <source>Show Sidebar</source> - <translation>顯示邊列</translation> + <translation>顯示側邊條</translation> </message> </context> <context> @@ -15671,7 +15671,7 @@ instead of its installation directory when run outside git bash.</source> <name>QtC::Help</name> <message> <source>Show Sidebar</source> - <translation>顯示邊列</translation> + <translation>顯示側邊條</translation> </message> <message> <source>Qt Creator Offline Help</source> diff --git a/src/libs/utils/fileinprojectfinder.cpp b/src/libs/utils/fileinprojectfinder.cpp index f92cb70fa7..6ee3c34bec 100644 --- a/src/libs/utils/fileinprojectfinder.cpp +++ b/src/libs/utils/fileinprojectfinder.cpp @@ -248,7 +248,10 @@ bool FileInProjectFinder::findFileOrDirectory(const FilePath &originalPath, File } } 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; // FIXME: This might be a worse match than what we find later. if (checkPath(candidate, matchLength, fileHandler, directoryHandler)) { diff --git a/src/plugins/clangformat/clangformatutils.cpp b/src/plugins/clangformat/clangformatutils.cpp index 1b09a9d3a1..3ae9301433 100644 --- a/src/plugins/clangformat/clangformatutils.cpp +++ b/src/plugins/clangformat/clangformatutils.cpp @@ -171,9 +171,7 @@ clang::format::FormatStyle qtcStyle() style.SpacesInCStyleCastParentheses = false; style.SpacesInParentheses = false; style.SpacesInSquareBrackets = false; - style.StatementMacros.emplace_back("Q_OBJECT"); - style.StatementMacros.emplace_back("QT_BEGIN_NAMESPACE"); - style.StatementMacros.emplace_back("QT_END_NAMESPACE"); + addQtcStatementMacros(style); style.Standard = FormatStyle::LS_Cpp11; style.TabWidth = 4; style.UseTab = FormatStyle::UT_Never; @@ -278,9 +276,44 @@ Utils::FilePath configForFile(const Utils::FilePath &fileName) 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_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 ¯o : macros) { if (std::find(style.StatementMacros.begin(), style.StatementMacros.end(), macro) == style.StatementMacros.end()) diff --git a/src/plugins/clangformat/tests/clangformat-test.cpp b/src/plugins/clangformat/tests/clangformat-test.cpp index c5f77072e4..80d2cc4da9 100644 --- a/src/plugins/clangformat/tests/clangformat-test.cpp +++ b/src/plugins/clangformat/tests/clangformat-test.cpp @@ -628,10 +628,16 @@ void ClangFormatTest::testCommentBlock() 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()); 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() diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index 21ee60f365..71b96610db 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -105,7 +105,9 @@ Internal::PresetsData CMakeProject::combinePresets(Internal::PresetsData &cmakeP Utils::sort(presetsList, [](const auto &left, const auto &right) { const bool sameInheritance = left.inherits && right.inherits && 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 true; }); diff --git a/src/plugins/cmakeprojectmanager/presetsparser.cpp b/src/plugins/cmakeprojectmanager/presetsparser.cpp index 0f9b0c8c8e..f3be87f7ea 100644 --- a/src/plugins/cmakeprojectmanager/presetsparser.cpp +++ b/src/plugins/cmakeprojectmanager/presetsparser.cpp @@ -82,7 +82,7 @@ std::optional<PresetsDetails::Condition> parseCondition(const QJsonValue &jsonVa if (type == "const") { condition->type = type; - condition->constValue = object.value("const").toBool(); + condition->constValue = object.value("value").toBool(); return condition; } diff --git a/src/plugins/coreplugin/locator/locatorsettingspage.cpp b/src/plugins/coreplugin/locator/locatorsettingspage.cpp index bd5a9f63aa..2ecc451a9a 100644 --- a/src/plugins/coreplugin/locator/locatorsettingspage.cpp +++ b/src/plugins/coreplugin/locator/locatorsettingspage.cpp @@ -94,7 +94,7 @@ QVariant FilterItem::data(int column, int role) const return m_filter->shortcutString(); break; 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; break; default: @@ -113,7 +113,7 @@ Qt::ItemFlags FilterItem::flags(int column) const if (column == FilterPrefix) return Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable; if (column == FilterIncludedByDefault) - return Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsUserCheckable; + return Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable; return Qt::ItemIsSelectable | Qt::ItemIsEnabled; } diff --git a/src/plugins/cppeditor/cppeditorwidget.cpp b/src/plugins/cppeditor/cppeditorwidget.cpp index 44f9e01a01..9aa98c7189 100644 --- a/src/plugins/cppeditor/cppeditorwidget.cpp +++ b/src/plugins/cppeditor/cppeditorwidget.cpp @@ -1267,20 +1267,16 @@ std::unique_ptr<AssistInterface> CppEditorWidget::createAssistInterface(AssistKi if (cap) return cap->createAssistInterface(textDocument()->filePath(), this, getFeatures(), reason); - else { - if (isOldStyleSignalOrSlot()) - return CppModelManager::instance() - ->completionAssistProvider() - ->createAssistInterface(textDocument()->filePath(), this, getFeatures(), reason); - return TextEditorWidget::createAssistInterface(kind, reason); + + if (isOldStyleSignalOrSlot()) { + return CppModelManager::instance() + ->completionAssistProvider() + ->createAssistInterface(textDocument()->filePath(), this, getFeatures(), 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 diff --git a/src/plugins/cppeditor/cppquickfixassistant.cpp b/src/plugins/cppeditor/cppquickfixassistant.cpp index 89af86e334..19514387d7 100644 --- a/src/plugins/cppeditor/cppquickfixassistant.cpp +++ b/src/plugins/cppeditor/cppquickfixassistant.cpp @@ -149,7 +149,8 @@ QTextCursor CppQuickFixInterface::adjustedCursor() QuickFixOperations quickFixOperations(const TextEditor::AssistInterface *interface) { const auto cppInterface = dynamic_cast<const CppQuickFixInterface *>(interface); - QTC_ASSERT(cppInterface, return {}); + if (!cppInterface) + return {}; QuickFixOperations quickFixes; for (CppQuickFixFactory *factory : CppQuickFixFactory::cppQuickFixFactories()) factory->match(*cppInterface, quickFixes); diff --git a/src/plugins/genericprojectmanager/genericproject.cpp b/src/plugins/genericprojectmanager/genericproject.cpp index 906eeb5809..ef83f906a9 100644 --- a/src/plugins/genericprojectmanager/genericproject.cpp +++ b/src/plugins/genericprojectmanager/genericproject.cpp @@ -330,8 +330,9 @@ bool GenericBuildSystem::addFiles(Node *, const FilePaths &filePaths_, FilePaths QSet<QString> toAdd; for (const QString &filePath : filePaths) { - const QString directory = QFileInfo(filePath).absolutePath(); - if (!includes.contains(directory)) + const QFileInfo fi(filePath); + const QString directory = fi.absolutePath(); + if (fi.fileName() == "include" && !includes.contains(directory)) toAdd << directory; } diff --git a/src/plugins/genericprojectmanager/genericprojectwizard.cpp b/src/plugins/genericprojectmanager/genericprojectwizard.cpp index 27d2a3932b..1f125ff321 100644 --- a/src/plugins/genericprojectmanager/genericprojectwizard.cpp +++ b/src/plugins/genericprojectmanager/genericprojectwizard.cpp @@ -141,6 +141,8 @@ Core::GeneratedFiles GenericProjectWizard::generateFiles(const QWizard *w, const QDir dir(projectPath.toString()); for (const QString &path : paths) { QFileInfo fileInfo(path); + if (fileInfo.fileName() != "include") + continue; QDir thisDir(fileInfo.absoluteFilePath()); if (! thisDir.entryList(nameFilters, QDir::Files).isEmpty()) { diff --git a/src/plugins/mcusupport/mcukitmanager.cpp b/src/plugins/mcusupport/mcukitmanager.cpp index 61f268f021..f68eca6973 100644 --- a/src/plugins/mcusupport/mcukitmanager.cpp +++ b/src/plugins/mcusupport/mcukitmanager.cpp @@ -289,8 +289,7 @@ public: cMakeToolchainFile.toString().toUtf8()); if (!cMakeToolchainFile.exists()) { printMessage( - Tr::tr( - "Warning for target %1: missing CMake toolchain file expected at %2.") + Tr::tr("Warning for target %1: missing CMake toolchain file expected at %2.") .arg(generateKitNameFromTarget(mcuTarget), cMakeToolchainFile.toUserOutput()), false); @@ -301,8 +300,7 @@ public: "/lib/cmake/Qul/QulGenerators.cmake"); configMap.insert("QUL_GENERATORS", generatorsPath.toString().toUtf8()); if (!generatorsPath.exists()) { - printMessage(Tr::tr( - "Warning for target %1: missing QulGenerators expected at %2.") + printMessage(Tr::tr("Warning for target %1: missing QulGenerators expected at %2.") .arg(generateKitNameFromTarget(mcuTarget), generatorsPath.toUserOutput()), false); @@ -510,8 +508,7 @@ void createAutomaticKits(const SettingsHandler::Ptr &settingsHandler) } case McuAbstractPackage::Status::EmptyPath: { printMessage( - Tr::tr( - "Missing %1. Add the path in Edit > Preferences > Devices > MCU.") + Tr::tr("Missing %1. Add the path in Edit > Preferences > Devices > MCU.") .arg(qtForMCUsPackage->detectionPath().toUserOutput()), true); return; @@ -524,9 +521,8 @@ void createAutomaticKits(const SettingsHandler::Ptr &settingsHandler) if (CMakeProjectManager::CMakeToolManager::cmakeTools().isEmpty()) { printMessage( - Tr::tr( - "No CMake tool was detected. Add a CMake tool in Edit > Preferences > " - "Kits > CMake."), + Tr::tr("No CMake tool was detected. Add a CMake tool in Edit > Preferences > " + "Kits > CMake."), true); return; } @@ -744,11 +740,17 @@ static bool anyKitDescriptionFileExists(const FilePaths &jsonFiles, const QRegularExpressionMatch match = re.match(jsonFile.fileName()); QStringList kitsPropertiesFromFileName; if (match.hasMatch()) { - const QString toolchain = match.captured(1).replace( - "gnu", "gcc"); // kitFileName contains gnu while profiles.xml contains gcc + QString toolchain = match.captured(1); const QString vendor = match.captured(2); 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; } diff --git a/src/plugins/qmljseditor/qmljseditor.cpp b/src/plugins/qmljseditor/qmljseditor.cpp index 590ef1da58..ccc94a5ea4 100644 --- a/src/plugins/qmljseditor/qmljseditor.cpp +++ b/src/plugins/qmljseditor/qmljseditor.cpp @@ -1042,7 +1042,7 @@ std::unique_ptr<AssistInterface> QmlJSEditorWidget::createAssistInterface( return std::make_unique<Internal::QmlJSQuickFixAssistInterface>( const_cast<QmlJSEditorWidget *>(this), reason); } - return nullptr; + return TextEditorWidget::createAssistInterface(assistKind, reason); } QString QmlJSEditorWidget::foldReplacementText(const QTextBlock &block) const diff --git a/src/plugins/texteditor/codeassist/codeassistant.cpp b/src/plugins/texteditor/codeassist/codeassistant.cpp index b81161dd6a..bbcbb130be 100644 --- a/src/plugins/texteditor/codeassist/codeassistant.cpp +++ b/src/plugins/texteditor/codeassist/codeassistant.cpp @@ -175,8 +175,7 @@ void CodeAssistantPrivate::requestProposal(AssistReason reason, std::unique_ptr<AssistInterface> assistInterface = m_editorWidget->createAssistInterface(kind, reason); - if (!assistInterface) - return; + QTC_ASSERT(assistInterface, return); // We got an assist provider and interface so no need to reset the current context anymore earlyReturnContextClear.reset({}); @@ -403,8 +402,10 @@ void CodeAssistantPrivate::notifyChange() if (m_editorWidget->position() < m_proposalWidget->basePosition()) { destroyContext(); } else { - m_proposalWidget->updateProposal( - m_editorWidget->createAssistInterface(m_assistKind, m_proposalWidget->reason())); + std::unique_ptr<AssistInterface> assistInterface + = m_editorWidget->createAssistInterface(m_assistKind, m_proposalWidget->reason()); + QTC_ASSERT(assistInterface, destroyContext(); return); + m_proposalWidget->updateProposal(std::move(assistInterface)); if (!isDisplayingProposal()) requestActivationCharProposal(); } diff --git a/src/shared/qbs b/src/shared/qbs -Subproject e002680feb415ee7d26e3a31d70afeef0d50dea +Subproject 03e717b06ed5c0864618e763f08f91d9fc94b73 diff --git a/tests/auto/qml/persistenttrie/persistenttrie.qbs b/tests/auto/qml/persistenttrie/persistenttrie.qbs index 9f03227ee7..0d6490a5b6 100644 --- a/tests/auto/qml/persistenttrie/persistenttrie.qbs +++ b/tests/auto/qml/persistenttrie/persistenttrie.qbs @@ -5,7 +5,6 @@ QtcAutotest { Depends { name: "QmlJS" } files: [ "tst_testtrie.h", "tst_testtrie.cpp" ] cpp.defines: base.concat([ - 'QMLJS_LIBRARY', 'QTCREATORDIR="' + project.ide_source_tree + '"', 'TESTSRCDIR="' + path + '"' ]) diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py index 06c7e115e3..babbf0eb6e 100644 --- a/tests/system/shared/project.py +++ b/tests/system/shared/project.py @@ -544,6 +544,7 @@ def checkAndCopyFiles(dataSet, fieldName, templateDir): files = map(lambda record: os.path.normpath(os.path.join(srcPath, testData.field(record, fieldName))), dataSet) + files = list(files) # copy data from map object to list to make it reusable for currentFile in files: if not neededFilePresent(currentFile): return [] diff --git a/tests/system/shared/utils.py b/tests/system/shared/utils.py index 7397fad5ed..96e63f29f0 100644 --- a/tests/system/shared/utils.py +++ b/tests/system/shared/utils.py @@ -513,8 +513,13 @@ def progressBarWait(timeout=60000, warn=True): checkIfObjectExists(":Qt Creator_Core::Internal::ProgressBar", False, timeout) def readFile(filename): - with open(filename, "r") as f: - return f.read() + try: + 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): # try to find the last part of the given name, assume it's inside a (folder) structure diff --git a/tests/system/suite_CSUP/tst_CSUP03/test.py b/tests/system/suite_CSUP/tst_CSUP03/test.py index 8667f3c2ac..4e6f3e2099 100644 --- a/tests/system/suite_CSUP/tst_CSUP03/test.py +++ b/tests/system/suite_CSUP/tst_CSUP03/test.py @@ -50,10 +50,6 @@ def main(): } for useClang in [False, True]: 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): continue projectName = createNewNonQtProject(tempDir(), "project-csup03", diff --git a/tests/system/suite_CSUP/tst_CSUP06/test.py b/tests/system/suite_CSUP/tst_CSUP06/test.py index 56e934db40..7682d1a672 100644 --- a/tests/system/suite_CSUP/tst_CSUP06/test.py +++ b/tests/system/suite_CSUP/tst_CSUP06/test.py @@ -42,8 +42,14 @@ def performAutoCompletionTest(editor, lineToStartRegEx, linePrefix, testFunc, *f def checkIncludeCompletion(editor, isClangCodeModel): test.log("Check auto-completion of include statements.") # define special handlings - noProposal = ["detail/hea"] + noProposal = [] 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 def testIncl(currentLine, *args): @@ -69,25 +75,24 @@ def checkIncludeCompletion(editor, isClangCodeModel): def checkSymbolCompletion(editor, isClangCodeModel): test.log("Check auto-completion of symbols.") # define special handlings - expectedSuggestion = {"in":["internal", "int", "INT_MAX", "INT_MIN"], + expectedSuggestion = {"in":["internal", "int", "intmax_t"], "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::Internal::":["DOUBLE", "one"] } 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(", "internal.o":"internal.one", "freefunc2":"freefunc2(", "using namespace st":"using namespace std", "afun":"afunc()"} if isClangCodeModel: - missing.remove("internal.o") - expectedSuggestion["in"] = ["internal", "int"] # QTCREATORBUG-22728 - expectedSuggestion["internal.o"] = ["one", "operator="] + missing = ["dummy.bla("] + expectedSuggestion["internal.o"] = ["one"] if platform.system() in ('Microsoft', 'Windows'): expectedSuggestion["using namespace st"] = ["std", "stdext"] else: - expectedSuggestion["using namespace st"] = ["std", "struct ", "struct template"] + expectedSuggestion["using namespace st"] = ["std", "struct", "struct template"] else: expectedSuggestion["using namespace st"] = ["std", "st"] # define test function to perform the _real_ auto completion test on the current line @@ -101,27 +106,25 @@ def checkSymbolCompletion(editor, isClangCodeModel): found = [] if propShown: 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) if not test.verify(len(diffShownExp) == 0, "Verify if all expected suggestions could be found"): test.log("Expected but not found suggestions: %s" % diffShownExp, "%s | %s" % (expectedSug[symbol], str(found))) # 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) changedLine = str(lineUnderCursor(editor)).strip() if symbol in expectedRes: exp = expectedRes[symbol] else: exp = (symbol[:max(symbol.rfind(":"), symbol.rfind(".")) + 1] - + expectedSug.get(symbol, found)[0]) - if isClangCodeModel and changedLine != exp and JIRA.isBugStillOpen(15483): - 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.") + + expectedSug.get(symbol, found)[0]).strip() + test.compare(changedLine, exp, "Verify completion matches.") performAutoCompletionTest(editor, ".*Complete symbols.*", "//", testSymb, missing, expectedSuggestion, expectedResults) @@ -143,6 +146,10 @@ def main(): return editor = getEditorForFileSuffix("main.cpp") if editor: + if useClang: + test.log("Wait for parsing to finish...") + progressBarWait(15000) + test.log("Parsing done.") checkIncludeCompletion(editor, useClang) checkSymbolCompletion(editor, useClang) invokeMenuItem('File', 'Revert "main.cpp" to Saved') diff --git a/tests/system/suite_HELP/tst_HELP04/test.py b/tests/system/suite_HELP/tst_HELP04/test.py index e4c0500d23..3fd63309ad 100644 --- a/tests/system/suite_HELP/tst_HELP04/test.py +++ b/tests/system/suite_HELP/tst_HELP04/test.py @@ -87,8 +87,7 @@ def main(): type(resultWidget, "<Return>") waitFor("__getUrl__() != url or selText != __getSelectedText__()", 20000) verifySelection(searchKeyword) - if not (searchKeyword == "QODBC" and JIRA.isBugStillOpen(10331)): - verifyUrl(urlDictionary[searchKeyword]) + verifyUrl(urlDictionary[searchKeyword]) else: test.verify(waitFor("noMatch in " "str(resultWidget.plainText)", 1000), diff --git a/tests/system/suite_QMLS/tst_QMLS04/test.py b/tests/system/suite_QMLS/tst_QMLS04/test.py index 351b59ac63..2c96939151 100644 --- a/tests/system/suite_QMLS/tst_QMLS04/test.py +++ b/tests/system/suite_QMLS/tst_QMLS04/test.py @@ -48,14 +48,12 @@ def main(): pass # open MyComponent.qml file for verification docOpened = openDocument(myCompTE) - if JIRA.isBugStillOpen(28985): - test.xverify(docOpened, "Was MyComponent.qml properly generated in project explorer?") - saveAndExit() - return - if not test.verify(docOpened, "Was MyComponent.qml properly generated in project explorer?"): - test.fatal("Could not open MyComponent.qml.") - saveAndExit() - return + # Work around QTCREATORBUG-28985 + test.xverify(docOpened, "Was MyComponent.qml properly generated in project explorer?") + saveAndExit() + return + # The workaround will be removed in master branch + # Following dead code left in intentionally to still allow merging forward changes in it. editorArea = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget") codeText = str(editorArea.plainText) # there should be Text item in new file diff --git a/tests/system/suite_editors/tst_clean_whitespaces/test.py b/tests/system/suite_editors/tst_clean_whitespaces/test.py index cdf2add27c..6dab4720f9 100644 --- a/tests/system/suite_editors/tst_clean_whitespaces/test.py +++ b/tests/system/suite_editors/tst_clean_whitespaces/test.py @@ -12,7 +12,7 @@ TripleTab = '\t\t\t' def main(): files = map(lambda record: os.path.join(srcPath, testData.field(record, "filename")), 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: if not neededFilePresent(currentFile): return diff --git a/tests/system/suite_editors/tst_select_all/test.py b/tests/system/suite_editors/tst_select_all/test.py index be96e8f482..bf95250cf7 100644 --- a/tests/system/suite_editors/tst_select_all/test.py +++ b/tests/system/suite_editors/tst_select_all/test.py @@ -8,7 +8,7 @@ source("../../shared/qtcreator.py") def main(): files = map(lambda record: os.path.join(srcPath, testData.field(record, "filename")), 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: if not neededFilePresent(currentFile): return |