From 5aff1419fa0ebee1e94e7a47b467a3dd289fec34 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Fri, 16 Jul 2021 09:20:41 +0200 Subject: [PATCH 1/7] Tracing: Restore support for Qt >= 6.2 First (try to) add the "Tracing" target as Qt Creator library, *then* check whether it exists. amends: f29d7b896f4757719c68b5ed14235ea64f4124cd Change-Id: I931e3ff632324faf4c6e07e8e083f00c55df197f Reviewed-by: hjk --- src/libs/tracing/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libs/tracing/CMakeLists.txt b/src/libs/tracing/CMakeLists.txt index e44c9dc57b3..d8970a79623 100644 --- a/src/libs/tracing/CMakeLists.txt +++ b/src/libs/tracing/CMakeLists.txt @@ -43,10 +43,6 @@ if(${Qt5_VERSION} VERSION_LESS "6.2.0") qml/tracing.qrc ) else() # < Qt 6.2 - if (NOT TARGET Tracing) - return() - endif() - add_qtc_library(Tracing FEATURE_INFO DEPENDS Utils Qt5::Qml Qt5::Quick @@ -55,6 +51,10 @@ else() # < Qt 6.2 ${TEST_SOURCES} ) + if (NOT TARGET Tracing) + return() + endif() + set(TRACING_QML_FILES qml/ButtonsBar.qml qml/CategoryLabel.qml From 34a1971edea43bf999978bd1abc039139bb143dc Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 15 Jul 2021 11:39:56 +0200 Subject: [PATCH 2/7] Clangd: Allow more fine-grained logging Change-Id: Ia882575a3b6babd0945ef60be08b152428d3f39d Reviewed-by: David Schulz --- src/plugins/clangcodemodel/clangdclient.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/plugins/clangcodemodel/clangdclient.cpp b/src/plugins/clangcodemodel/clangdclient.cpp index c180710a340..31d4b71ef08 100644 --- a/src/plugins/clangcodemodel/clangdclient.cpp +++ b/src/plugins/clangcodemodel/clangdclient.cpp @@ -72,6 +72,9 @@ namespace ClangCodeModel { namespace Internal { static Q_LOGGING_CATEGORY(clangdLog, "qtc.clangcodemodel.clangd", QtWarningMsg); +static Q_LOGGING_CATEGORY(clangdLogServer, "qtc.clangcodemodel.clangd.server", QtWarningMsg); +static Q_LOGGING_CATEGORY(clangdLogAst, "qtc.clangcodemodel.clangd.ast", QtWarningMsg); +static Q_LOGGING_CATEGORY(clangdLogHighlight, "qtc.clangcodemodel.clangd.highlight", QtWarningMsg); static QString indexingToken() { return "backgroundIndexProgress"; } class AstParams : public JsonObject @@ -438,7 +441,7 @@ static BaseClientInterface *clientInterface(Project *project, const Utils::FileP cmd.addArg("-j=" + QString::number(settings.workerThreadLimit())); if (!jsonDbDir.isEmpty()) cmd.addArg("--compile-commands-dir=" + jsonDbDir.toString()); - if (clangdLog().isDebugEnabled()) + if (clangdLogServer().isDebugEnabled()) cmd.addArgs({"--log=verbose", "--pretty"}); const auto interface = new StdIOClientInterface; interface->setCommandLine(cmd); @@ -1367,7 +1370,7 @@ void ClangdClient::gatherHelpItemForTooltip(const HoverRequest::Response &hoverR if (children && !children->isEmpty()) node = children->first(); } - if (clangdLog().isDebugEnabled()) + if (clangdLogAst().isDebugEnabled()) node.print(0); QString type = node.type(); @@ -1687,7 +1690,7 @@ void ClangdClient::Private::handleDeclDefSwitchReplies() // Find the function declaration or definition associated with the cursor. // For instance, the cursor could be somwehere inside a function body or // on a function return type, or ... - if (clangdLog().isDebugEnabled()) + if (clangdLogAst().isDebugEnabled()) switchDeclDefData->ast->print(0); const Utils::optional functionNode = switchDeclDefData->getFunctionNode(); if (!functionNode) { @@ -1760,7 +1763,7 @@ static void collectExtraResults(QFutureInterface return; const auto it = std::lower_bound(results.begin(), results.end(), result, lessThan); if (it == results.end() || *it != result) { - qCDebug(clangdLog) << "adding additional highlighting result" + qCDebug(clangdLogHighlight) << "adding additional highlighting result" << result.line << result.column << result.length; results.insert(it, result); return; @@ -2317,7 +2320,7 @@ static void semanticHighlighter(QFutureInterface styles.mixinStyles.push_back(TextEditor::C_DECLARATION); if (isOutputParameter(token)) styles.mixinStyles.push_back(TextEditor::C_OUTPUT_ARGUMENT); - qCDebug(clangdLog) << "adding highlighting result" + qCDebug(clangdLogHighlight) << "adding highlighting result" << token.line << token.column << token.length << int(styles.mainStyle); return TextEditor::HighlightingResult(token.line, token.column, token.length, styles); }; @@ -2350,7 +2353,8 @@ void ClangdClient::Private::handleSemanticTokens(TextEditor::TextDocument *doc, { qCDebug(clangdLog()) << "handling LSP tokens" << tokens.size(); for (const ExpandedSemanticToken &t : tokens) - qCDebug(clangdLog) << '\t' << t.line << t.column << t.length << t.type << t.modifiers; + qCDebug(clangdLogHighlight()) << '\t' << t.line << t.column << t.length << t.type + << t.modifiers; // TODO: Cache ASTs AstParams params(TextDocumentIdentifier(DocumentUri::fromFilePath(doc->filePath()))); @@ -2359,7 +2363,7 @@ void ClangdClient::Private::handleSemanticTokens(TextEditor::TextDocument *doc, if (!q->documentOpen(doc)) return; const Utils::optional ast = response.result(); - if (ast && clangdLog().isDebugEnabled()) + if (ast && clangdLogAst().isDebugEnabled()) ast->print(); const auto runner = [tokens, text = doc->document()->toPlainText(), From ae16958fd8395be79d471d693aac0ab6083c1851 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Fri, 16 Jul 2021 08:09:28 +0200 Subject: [PATCH 3/7] Docker: Improve marking daemon problems Small positive exit codes can result for different reasons. Real docker issues result in small negative exit codes. Change-Id: Ibd800b7806f3014ffccd39638c06b2dd93e8a5a1 Reviewed-by: hjk --- src/plugins/docker/dockerdevice.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index b355eb5d9b3..037d0c901c8 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -734,7 +734,9 @@ void DockerDevicePrivate::tryCreateLocalFileAccess() LOG("RES: " << m_shell->result() << " STDOUT: " << m_shell->readAllStandardOutput() << " STDERR: " << m_shell->readAllStandardError()); - if (m_shell->exitCode() != 0) { + // negative exit codes indicate problems like no docker daemon, missing permissions, + // no shell and seem to result in exit codes 125+ + if (m_shell->exitCode() > 120) { m_accessible = NoDaemon; LOG("DOCKER DAEMON NOT RUNNING?"); MessageManager::writeFlashing(tr("Docker Daemon appears to be not running. " From ec8f0ff7038d225b95925d2ae97795096bb58b32 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Thu, 15 Jul 2021 12:22:22 +0200 Subject: [PATCH 4/7] QmlDesigner: Fix testRewriterComponentId Only attach a single rewriter view. Change-Id: I5ee4e12c8939e6738803a1d50026ea8b143e9d3b Reviewed-by: Qt CI Bot Reviewed-by: Thomas Hartmann --- .../qmldesigner/coretests/tst_testcore.cpp | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp b/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp index c512b372cd0..0111b9f0a2e 100644 --- a/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp +++ b/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp @@ -2964,30 +2964,31 @@ void tst_TestCore::testRewriterAddNodeTransaction() void tst_TestCore::testRewriterComponentId() { char qmlString[] = "import QtQuick 2.0\n" - "Rectangle {\n" - " Component {\n" - " id: testComponent\n" - " Item {\n" - " }\n" - " }\n" - "}\n"; + "Rectangle {\n" + " Component {\n" + " id: testComponent\n" + " Item {\n" + " }\n" + " }\n" + "}\n"; QPlainTextEdit textEdit; textEdit.setPlainText(QLatin1String(qmlString)); NotIndentingTextEditModifier textModifier(&textEdit); - QScopedPointer model(createModel("QtQuick.Rectangle", 2, 1)); + QScopedPointer model(Model::create("QtQuick.Item", 2, 0)); QVERIFY(model.data()); - QVERIFY(model->hasNodeMetaInfo("QtQuick.Item", 2, 1)); QScopedPointer view(new TestView(model.data())); QVERIFY(view.data()); model->attachView(view.data()); QScopedPointer testRewriterView(new TestRewriterView()); - QVERIFY(model->rewriterView()); + QVERIFY(!model->rewriterView()); testRewriterView->setTextModifier(&textModifier); + model->attachView(testRewriterView.data()); + QVERIFY(model->rewriterView()); QVERIFY(model->hasNodeMetaInfo("QtQuick.Item", 2, 1)); @@ -3738,8 +3739,6 @@ void tst_TestCore::testCopyModelRewriter1() QVERIFY(insertedNode.isValid()); childNode.nodeListProperty("data").reparentHere(insertedNode); - - const QLatin1String expected( "\n" From 5c37fb1f6574eedf23d6b6708e5faa205518af50 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Fri, 16 Jul 2021 11:10:34 +0200 Subject: [PATCH 5/7] QmlProfiler/PerfProfiler: Restore support for Qt >= 6.2 First (try to) add the target as Qt Creator plugin, *then* check whether it exists. Amends: 5aff1419fa0ebee1e94e7a47b467a3dd289fec34 Change-Id: Ia7c318c0ffb7bbaa21159ddf9de88b80ad0033cb Reviewed-by: Eike Ziller --- src/plugins/perfprofiler/CMakeLists.txt | 8 ++++---- src/plugins/qmlprofiler/CMakeLists.txt | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/plugins/perfprofiler/CMakeLists.txt b/src/plugins/perfprofiler/CMakeLists.txt index d83e9e65523..e1ee249ed04 100644 --- a/src/plugins/perfprofiler/CMakeLists.txt +++ b/src/plugins/perfprofiler/CMakeLists.txt @@ -48,10 +48,6 @@ if(${Qt5_VERSION} VERSION_LESS "6.2.0") perfprofiler.qrc ) else() # < Qt 6.2 - if (NOT TARGET PerfProfiler) - return() - endif() - add_qtc_plugin(PerfProfiler DEPENDS Tracing Qt5::QuickWidgets PLUGIN_DEPENDS Core Debugger ProjectExplorer QtSupport @@ -59,6 +55,10 @@ else() # < Qt 6.2 ${TEST_SOURCES} ) + if (NOT TARGET PerfProfiler) + return() + endif() + qt_add_resources(PerfProfiler perfprofiler PREFIX "/perfprofiler" tracepoints.sh diff --git a/src/plugins/qmlprofiler/CMakeLists.txt b/src/plugins/qmlprofiler/CMakeLists.txt index c5fa5399f86..aee047a576d 100644 --- a/src/plugins/qmlprofiler/CMakeLists.txt +++ b/src/plugins/qmlprofiler/CMakeLists.txt @@ -79,10 +79,6 @@ if(${Qt5_VERSION} VERSION_LESS "6.2.0") qml/qmlprofiler.qrc ) else() # < Qt 6.2 - if (NOT TARGET QmlProfiler) - return() - endif() - add_qtc_plugin(QmlProfiler DEPENDS QmlDebug QmlJS Tracing Qt5::QuickWidgets PLUGIN_DEPENDS Core Debugger ProjectExplorer QtSupport TextEditor @@ -90,6 +86,10 @@ else() # < Qt 6.2 ${TEST_SOURCES} ) + if (NOT TARGET QmlProfiler) + return() + endif() + set(QMLPROFILER_QML_FILES qml/QmlProfilerFlameGraphView.qml ) From 67d85d1592fe40f8da5ac7b53db95e44e35d5a5f Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 16 Jul 2021 10:35:10 +0200 Subject: [PATCH 6/7] Bump version to 5.0 RC1 Skipping Beta 2 due to summer slothfulness. Change-Id: If3ee6c1c218b17d413d2f28023b9fb094a969cdd Reviewed-by: Eike Ziller --- cmake/QtCreatorIDEBranding.cmake | 6 +++--- qbs/modules/qtc/qtc.qbs | 6 +++--- qtcreator_ide_branding.pri | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cmake/QtCreatorIDEBranding.cmake b/cmake/QtCreatorIDEBranding.cmake index f2ca1e51f8d..e36186c12d4 100644 --- a/cmake/QtCreatorIDEBranding.cmake +++ b/cmake/QtCreatorIDEBranding.cmake @@ -1,6 +1,6 @@ -set(IDE_VERSION "4.83.0") # The IDE version. -set(IDE_VERSION_COMPAT "4.83.0") # The IDE Compatibility version. -set(IDE_VERSION_DISPLAY "5.0.0-beta2") # The IDE display version. +set(IDE_VERSION "4.84.0") # The IDE version. +set(IDE_VERSION_COMPAT "4.84.0") # The IDE Compatibility version. +set(IDE_VERSION_DISPLAY "5.0.0-rc1") # The IDE display version. set(IDE_COPYRIGHT_YEAR "2021") # The IDE current copyright year. set(IDE_SETTINGSVARIANT "QtProject") # The IDE settings variation. diff --git a/qbs/modules/qtc/qtc.qbs b/qbs/modules/qtc/qtc.qbs index e9153b715a0..14355e7f56e 100644 --- a/qbs/modules/qtc/qtc.qbs +++ b/qbs/modules/qtc/qtc.qbs @@ -3,15 +3,15 @@ import qbs.Environment import qbs.FileInfo Module { - property string qtcreator_display_version: '5.0.0-beta2' + property string qtcreator_display_version: '5.0.0-rc1' property string ide_version_major: '4' - property string ide_version_minor: '83' + property string ide_version_minor: '84' property string ide_version_release: '0' property string qtcreator_version: ide_version_major + '.' + ide_version_minor + '.' + ide_version_release property string ide_compat_version_major: '4' - property string ide_compat_version_minor: '83' + property string ide_compat_version_minor: '84' property string ide_compat_version_release: '0' property string qtcreator_compat_version: ide_compat_version_major + '.' + ide_compat_version_minor + '.' + ide_compat_version_release diff --git a/qtcreator_ide_branding.pri b/qtcreator_ide_branding.pri index eb4c98328d7..f5805a46a02 100644 --- a/qtcreator_ide_branding.pri +++ b/qtcreator_ide_branding.pri @@ -1,6 +1,6 @@ -QTCREATOR_VERSION = 4.83.0 -QTCREATOR_COMPAT_VERSION = 4.83.0 -QTCREATOR_DISPLAY_VERSION = 5.0.0-beta2 +QTCREATOR_VERSION = 4.84.0 +QTCREATOR_COMPAT_VERSION = 4.84.0 +QTCREATOR_DISPLAY_VERSION = 5.0.0-rc1 QTCREATOR_COPYRIGHT_YEAR = 2021 IDE_DISPLAY_NAME = Qt Creator From 842770b6b57d1326b23a83e99451ad4a3cde5f74 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 15 Jul 2021 17:11:53 +0200 Subject: [PATCH 7/7] TextEditor: Fix path to code styles Was broken by c1f90aeca2. Fixes: QTCREATORBUG-25989 Change-Id: I91879e0adb3cd90be8abddd6a1ca02364b8b9fce Reviewed-by: Eike Ziller --- src/plugins/texteditor/codestylepool.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/texteditor/codestylepool.cpp b/src/plugins/texteditor/codestylepool.cpp index 2a2fe260142..64a41be1706 100644 --- a/src/plugins/texteditor/codestylepool.cpp +++ b/src/plugins/texteditor/codestylepool.cpp @@ -92,9 +92,9 @@ QByteArray CodeStylePoolPrivate::generateUniqueId(const QByteArray &id) const } } -static QString customCodeStylesPath() +static Utils::FilePath customCodeStylesPath() { - return Core::ICore::userResourcePath("codestyles").toString(); + return Core::ICore::userResourcePath("codestyles"); } CodeStylePool::CodeStylePool(ICodeStylePreferencesFactory *factory, QObject *parent) @@ -112,7 +112,7 @@ CodeStylePool::~CodeStylePool() QString CodeStylePool::settingsDir() const { const QString suffix = d->m_factory ? d->m_factory->languageId().toString() : QLatin1String("default"); - return customCodeStylesPath().append(suffix); + return customCodeStylesPath().pathAppended(suffix).toString(); } Utils::FilePath CodeStylePool::settingsPath(const QByteArray &id) const @@ -261,7 +261,7 @@ void CodeStylePool::slotSaveCodeStyle() void CodeStylePool::saveCodeStyle(ICodeStylePreferences *codeStyle) const { - const QString codeStylesPath = customCodeStylesPath(); + const QString codeStylesPath = customCodeStylesPath().toString(); // Create the base directory when it doesn't exist if (!QFile::exists(codeStylesPath) && !QDir().mkpath(codeStylesPath)) {