From bb551f4b6065662a9c10835f6363a44a87f878fd Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Mon, 17 Apr 2023 06:36:31 +0200 Subject: [PATCH 01/31] Android: Fix compile with Qt6.2 Just removed redundant check. Amends 2d01003c4e37041efc63bd536d1cd06ce4928bf7. Change-Id: Ie7ce3836804199bcb561b8c34a70814856a4033a Reviewed-by: Alessandro Portale Reviewed-by: Zoltan Gera --- src/plugins/android/androidrunnerworker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/android/androidrunnerworker.cpp b/src/plugins/android/androidrunnerworker.cpp index 7567cc06183..2676fa6305c 100644 --- a/src/plugins/android/androidrunnerworker.cpp +++ b/src/plugins/android/androidrunnerworker.cpp @@ -122,7 +122,7 @@ static void findProcessPIDAndUser(QFutureInterface &fi, QStringList if (!out.isEmpty()) { QRegularExpressionMatch match; qsizetype matchPos = out.indexOf(userIdPattern, 0, &match); - if (matchPos >= 0 && match.hasCaptured(1) && match.capturedLength(1) > 0) { + if (matchPos >= 0 && match.capturedLength(1) > 0) { bool ok = false; processUser = match.captured(1).toInt(&ok); if (!ok) From 0c37fc356ede86e0e697ce3af5fb320cd7275019 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii Date: Mon, 17 Apr 2023 15:08:00 +0200 Subject: [PATCH 02/31] ClangFormat: Fix wrong indentation numbers with separator Fixes: QTCREATORBUG-29033 Change-Id: I70ba12828d3805cb8087a797d14e0ee24611418f Reviewed-by: Christian Kandeler --- src/plugins/clangformat/clangformatutils.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/clangformat/clangformatutils.cpp b/src/plugins/clangformat/clangformatutils.cpp index d1d6bee684b..ca6fea8f18e 100644 --- a/src/plugins/clangformat/clangformatutils.cpp +++ b/src/plugins/clangformat/clangformatutils.cpp @@ -177,6 +177,7 @@ clang::format::FormatStyle qtcStyle() style.Standard = FormatStyle::LS_Cpp11; style.TabWidth = 4; style.UseTab = FormatStyle::UT_Never; + style.Standard = FormatStyle::LS_Auto; return style; } From f2c6af064b73c25ca11816d054e7d1318068b391 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 18 Apr 2023 09:57:47 +0200 Subject: [PATCH 03/31] Update qbs submodule to HEAD of 2.0 branch Fixes build with Qt 6.5 Change-Id: I9aaae5ade6b9165e54c248d246d20dd0665967bf Reviewed-by: Qt CI Bot Reviewed-by: Christian Stenger Reviewed-by: Christian Kandeler --- src/shared/qbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/qbs b/src/shared/qbs index 978448ddfe8..e002680feb4 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit 978448ddfe8aac9c4cc895f6c93429e0f9f689bc +Subproject commit e002680feb415ee7d26e3a31d70afeef0d50dea2 From 178c0abbd3e71660ec0d808df97e5620e126a709 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii Date: Mon, 17 Apr 2023 14:14:22 +0200 Subject: [PATCH 04/31] ClangFormat: Fix preview updating Fixed the behavior when the preview does not update when the Override checkbox was not enabled initially. Currently, the preview is updating when Override the checkbox is enabled. Fixes: QTCREATORBUG-29043 Change-Id: I8a2a6f3cd5890b66d4bffd0c84aeafb5a29fba48 Reviewed-by: Christian Kandeler --- src/plugins/clangformat/clangformatglobalconfigwidget.cpp | 6 ++++++ src/plugins/clangformat/clangformatglobalconfigwidget.h | 1 + src/plugins/clangformat/clangformatutils.cpp | 7 ++++--- src/plugins/texteditor/codestyleeditor.cpp | 3 +++ 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/plugins/clangformat/clangformatglobalconfigwidget.cpp b/src/plugins/clangformat/clangformatglobalconfigwidget.cpp index 1b57403f32c..a0344e14eda 100644 --- a/src/plugins/clangformat/clangformatglobalconfigwidget.cpp +++ b/src/plugins/clangformat/clangformatglobalconfigwidget.cpp @@ -196,4 +196,10 @@ void ClangFormatGlobalConfigWidget::apply() settings.write(); } +void ClangFormatGlobalConfigWidget::finish() +{ + m_codeStyle->currentPreferences()->setTemporarilyReadOnly( + !ClangFormatSettings::instance().overrideDefaultFile()); +} + } // namespace ClangFormat diff --git a/src/plugins/clangformat/clangformatglobalconfigwidget.h b/src/plugins/clangformat/clangformatglobalconfigwidget.h index 989aa58a925..063c82852a3 100644 --- a/src/plugins/clangformat/clangformatglobalconfigwidget.h +++ b/src/plugins/clangformat/clangformatglobalconfigwidget.h @@ -28,6 +28,7 @@ public: QWidget *parent = nullptr); ~ClangFormatGlobalConfigWidget() override; void apply() override; + void finish() override; private: void initCheckBoxes(); diff --git a/src/plugins/clangformat/clangformatutils.cpp b/src/plugins/clangformat/clangformatutils.cpp index ca6fea8f18e..7ba6229db37 100644 --- a/src/plugins/clangformat/clangformatutils.cpp +++ b/src/plugins/clangformat/clangformatutils.cpp @@ -215,9 +215,10 @@ bool getCurrentOverriddenSettings(const Utils::FilePath &filePath) const ProjectExplorer::Project *project = ProjectExplorer::SessionManager::projectForFile( filePath); - return getProjectUseGlobalSettings(project) - ? ClangFormatSettings::instance().overrideDefaultFile() - : getProjectOverriddenSettings(project); + return getProjectUseGlobalSettings(project) ? !TextEditor::TextEditorSettings::codeStyle("Cpp") + ->currentPreferences() + ->isTemporarilyReadOnly() + : getProjectOverriddenSettings(project); } ClangFormatSettings::Mode getProjectIndentationOrFormattingSettings( diff --git a/src/plugins/texteditor/codestyleeditor.cpp b/src/plugins/texteditor/codestyleeditor.cpp index 6aaf5ae9483..ac75f1ad6d3 100644 --- a/src/plugins/texteditor/codestyleeditor.cpp +++ b/src/plugins/texteditor/codestyleeditor.cpp @@ -108,6 +108,9 @@ void CodeStyleEditor::finish() { if (m_widget) m_widget->finish(); + + if (m_additionalGlobalSettingsWidget) + m_additionalGlobalSettingsWidget->finish(); } } // TextEditor From 610c0fee8787c3c3908630e5142036ffe13553a8 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 18 Apr 2023 08:03:17 +0200 Subject: [PATCH 05/31] QtSupport: Fix handling of tutorials Amends ac17e0e2ad47f16c80eb233725c4a603f6053acb. Change-Id: I9c0ffdb01ef446a76bfcbbdb8b5c560dd9f26e8d Reviewed-by: Eike Ziller --- src/plugins/qtsupport/examplesparser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/qtsupport/examplesparser.cpp b/src/plugins/qtsupport/examplesparser.cpp index bdde8e66a0f..5fd3161777c 100644 --- a/src/plugins/qtsupport/examplesparser.cpp +++ b/src/plugins/qtsupport/examplesparser.cpp @@ -211,9 +211,9 @@ static QList parseTutorials(QXmlStreamReader *reader, const FileP item->type = Tutorial; QXmlStreamAttributes attributes = reader->attributes(); item->name = attributes.value(QLatin1String("name")).toString(); - item->projectPath = projectsOffset - / attributes.value(QLatin1String("projectPath")).toString(); - item->hasSourceCode = !item->projectPath.isEmpty(); + const QString projectPath = attributes.value(QLatin1String("projectPath")).toString(); + item->projectPath = projectsOffset / projectPath; + item->hasSourceCode = !projectPath.isEmpty(); item->imageUrl = Utils::StyleHelper::dpiSpecificImageFile( attributes.value(QLatin1String("imageUrl")).toString()); QPixmapCache::remove(item->imageUrl); From c3715883ee6223d8bc4d7ca10b0783d629e68577 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Mon, 17 Apr 2023 13:02:51 +0200 Subject: [PATCH 06/31] AutoTest: Improve handling of Qt Quick Tests Qml files must not get declared inside the project files which makes it hard to correctly determine the correct project part they might belong to. The recommended and correct way of using Quick Tests is to have QUICK_TEST_SOURCE_DIR defined which is used internally anyhow to find the respective qml files. Make use of this fact also when determining the correct project part. Fixes: QTCREATORBUG-28716 Change-Id: I45371242ce931ee83b7bfbdd07a0848c7fd86abb Reviewed-by: David Schulz --- src/plugins/autotest/quick/quicktesttreeitem.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/plugins/autotest/quick/quicktesttreeitem.cpp b/src/plugins/autotest/quick/quicktesttreeitem.cpp index 49358f49ebd..f721ce3bc0d 100644 --- a/src/plugins/autotest/quick/quicktesttreeitem.cpp +++ b/src/plugins/autotest/quick/quicktesttreeitem.cpp @@ -375,8 +375,14 @@ QSet internalTargets(const FilePath &proFile) for (const CppEditor::ProjectPart::ConstPtr &projectPart : projectInfo->projectParts()) { if (projectPart->buildTargetType != ProjectExplorer::BuildTargetType::Executable) continue; - if (projectPart->projectFile == proFile.toString()) + if (projectPart->projectFile != proFile.toString()) + continue; + if (Utils::anyOf(projectPart->projectMacros, [](const ProjectExplorer::Macro ¯o){ + return macro.type == ProjectExplorer::MacroType::Define && + macro.key == "QUICK_TEST_SOURCE_DIR"; + })) { result.insert(projectPart->buildSystemTarget); + } } return result; } From f3166144500427ccc528e35686361350d576dfbf Mon Sep 17 00:00:00 2001 From: David Schulz Date: Mon, 17 Apr 2023 10:52:45 +0200 Subject: [PATCH 07/31] Editor: fix selection path for empty selections Especially targets the painting of empty snippet replacement placeholder like in the default "if" snippet. Change-Id: I42d9fb901c66cddf4eab9dd7275b42a8f4e81282 Reviewed-by: Christian Stenger --- src/plugins/texteditor/texteditoroverlay.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/texteditor/texteditoroverlay.cpp b/src/plugins/texteditor/texteditoroverlay.cpp index bf320549de1..4a6eda6c2c4 100644 --- a/src/plugins/texteditor/texteditoroverlay.cpp +++ b/src/plugins/texteditor/texteditoroverlay.cpp @@ -134,8 +134,10 @@ QPainterPath TextEditorOverlay::createSelectionPath(const QTextCursor &begin, co int x = line.cursorToX(pos); lineRect.setLeft(x - borderWidth); lineRect.setRight(x + borderWidth); + lineRect.setBottom(lineRect.bottom() + borderWidth); QPainterPath path; path.addRect(lineRect); + path.translate(offset); return path; } From aa0c9bc741091f2212955bc3f9dc7d20116c6f9c Mon Sep 17 00:00:00 2001 From: David Schulz Date: Mon, 17 Apr 2023 10:53:32 +0200 Subject: [PATCH 08/31] Editor: skip painting selection path out of clip rect Change-Id: Ieec7afbec729708884c24d8de2b4a6c488220a69 Reviewed-by: Christian Stenger --- src/plugins/texteditor/texteditoroverlay.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/texteditor/texteditoroverlay.cpp b/src/plugins/texteditor/texteditoroverlay.cpp index 4a6eda6c2c4..52ab8709de6 100644 --- a/src/plugins/texteditor/texteditoroverlay.cpp +++ b/src/plugins/texteditor/texteditoroverlay.cpp @@ -252,6 +252,8 @@ void TextEditorOverlay::paintSelection(QPainter *painter, return; QPainterPath path = createSelectionPath(begin, end, clip); + if (path.isEmpty()) + return; painter->save(); QColor penColor = fg; @@ -307,6 +309,8 @@ void TextEditorOverlay::fillSelection(QPainter *painter, return; QPainterPath path = createSelectionPath(begin, end, clip); + if (path.isEmpty()) + return; painter->save(); painter->translate(-.5, -.5); From e441648259889725040d07d1368d7c491252d156 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Tue, 18 Apr 2023 17:08:46 +0200 Subject: [PATCH 09/31] Doc: Replace libSM-dev with libsm-dev Which is the correct way to write the name of the package. Fixes: QTCREATORBUG-29031 Change-Id: I860051b8e5f94a800d6f7b448daf02ae01611f9d Reviewed-by: Eike Ziller --- doc/qtcreator/src/howto/creator-only/qtcreator-faq.qdoc | 4 ++-- .../src/overview/creator-only/creator-desktop-platforms.qdoc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/qtcreator/src/howto/creator-only/qtcreator-faq.qdoc b/doc/qtcreator/src/howto/creator-only/qtcreator-faq.qdoc index 6a1d6a12277..b2dc857e458 100644 --- a/doc/qtcreator/src/howto/creator-only/qtcreator-faq.qdoc +++ b/doc/qtcreator/src/howto/creator-only/qtcreator-faq.qdoc @@ -1,4 +1,4 @@ -// Copyright (C) 2021 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! @@ -219,7 +219,7 @@ Ubuntu or Debian?} \code - sudo apt-get install libglib2.0-dev libSM-dev libxrender-dev libfontconfig1-dev libxext-dev + sudo apt-get install libglib2.0-dev libsm-dev libxrender-dev libfontconfig1-dev libxext-dev \endcode If you use QtOpenGL, you also need: diff --git a/doc/qtcreator/src/overview/creator-only/creator-desktop-platforms.qdoc b/doc/qtcreator/src/overview/creator-only/creator-desktop-platforms.qdoc index 4cdf397d1fb..d97f7073cd6 100644 --- a/doc/qtcreator/src/overview/creator-only/creator-desktop-platforms.qdoc +++ b/doc/qtcreator/src/overview/creator-only/creator-desktop-platforms.qdoc @@ -1,4 +1,4 @@ -// Copyright (C) 2020 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! @@ -30,7 +30,7 @@ \li g++ \li make \li libglib2.0-dev - \li libSM-dev + \li libsm-dev \li libxrender-dev \li libfontconfig1-dev \li libxext-dev From 1d364880f911f6f7466637ddf2b6693072a0f373 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 18 Apr 2023 15:24:48 +0200 Subject: [PATCH 10/31] ClangTools: Do not abort a running build when starting to analyze Task-number: QTCREATORBUG-29044 Change-Id: Iec6259d1734f809aba9da00f3f6a63fea2b93967 Reviewed-by: Qt CI Bot Reviewed-by: David Schulz --- src/plugins/clangtools/clangtoolruncontrol.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/clangtools/clangtoolruncontrol.cpp b/src/plugins/clangtools/clangtoolruncontrol.cpp index 7881b53916f..e583a6269de 100644 --- a/src/plugins/clangtools/clangtoolruncontrol.cpp +++ b/src/plugins/clangtools/clangtoolruncontrol.cpp @@ -55,7 +55,8 @@ private: connect(BuildManager::instance(), &BuildManager::buildQueueFinished, this, &ProjectBuilder::onBuildFinished, Qt::QueuedConnection); - BuildManager::buildProjectWithDependencies(target->project()); + if (!BuildManager::isBuilding(target)) + BuildManager::buildProjectWithDependencies(target->project()); } void onBuildFinished(bool success) From ba3299f0d2ea814cc6534919b6b8b4a5cbfde861 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 18 Apr 2023 15:38:11 +0200 Subject: [PATCH 11/31] ProjectExplorer: Do not treat a starting run control as finished ... when assigning tabs in the app output pane. Task-number: QTCREATORBUG-29044 Change-Id: I49e3d3ac3822692ffacd9821a0dd61377aae02cd Reviewed-by: Qt CI Bot Reviewed-by: David Schulz Reviewed-by: --- src/plugins/projectexplorer/appoutputpane.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/appoutputpane.cpp b/src/plugins/projectexplorer/appoutputpane.cpp index 3e1927faeb7..6f7e22bacd2 100644 --- a/src/plugins/projectexplorer/appoutputpane.cpp +++ b/src/plugins/projectexplorer/appoutputpane.cpp @@ -397,7 +397,7 @@ void AppOutputPane::createNewOutputWindow(RunControl *rc) const Environment thisEnvironment = rc->environment(); const auto tab = std::find_if(m_runControlTabs.begin(), m_runControlTabs.end(), [&](const RunControlTab &tab) { - if (!tab.runControl || tab.runControl->isRunning()) + if (!tab.runControl || tab.runControl->isRunning() || tab.runControl->isStarting()) return false; return thisCommand == tab.runControl->commandLine() && thisWorkingDirectory == tab.runControl->workingDirectory() From a37b0f0e6c7dcdc663b20b2767c7c7165a3d2443 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Tue, 18 Apr 2023 16:58:26 +0200 Subject: [PATCH 12/31] CMakePM: Add .h header files to .c source files Utils::mimeTypesForFileName would only return "text/x-c++hdr" for .h files. This is perfectly fine for C++ source files. The ancestor "text/x-chdr" is required for C source files though. Fixes: QTCREATORBUG-28991 Change-Id: I21f038787e48e88b5e4b9e8ca386b3af80d098ea Reviewed-by: Eike Ziller --- src/plugins/cmakeprojectmanager/fileapidataextractor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp index 9293831fdcf..13a1510ebd6 100644 --- a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp +++ b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp @@ -391,7 +391,7 @@ RawProjectParts generateRawProjectParts(const PreprocessedData &input, continue; const auto mimeTypes = Utils::mimeTypesForFileName(si.path); for (const auto &mime : mimeTypes) - if (mime.name() == headerMimeType) + if (mime.inherits(headerMimeType)) sources.push_back(sourceDir.absoluteFilePath(si.path)); } } From b57971a9cd262a3c01938e9f0e3d79de842e806c Mon Sep 17 00:00:00 2001 From: Jussi Witick Date: Wed, 19 Apr 2023 10:44:53 +0300 Subject: [PATCH 13/31] Fix namespace usage in QSR project wizard template Consistently use namespaces with different feature if/def's in main.cpp Task-number: QSR-2079 Change-Id: I0609f7eb8cb18d270e59c11025850e6369e5db87 Reviewed-by: Teemu Holappa (cherry picked from commit f98a03a28d823a1bdffc57009ebef2637811aebb) Reviewed-by: Alessandro Portale Reviewed-by: Eike Ziller --- src/plugins/saferenderer/wizards/qsrapp/main.cpp.tpl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/saferenderer/wizards/qsrapp/main.cpp.tpl b/src/plugins/saferenderer/wizards/qsrapp/main.cpp.tpl index 4f36c6f6fa3..c491bee9aeb 100644 --- a/src/plugins/saferenderer/wizards/qsrapp/main.cpp.tpl +++ b/src/plugins/saferenderer/wizards/qsrapp/main.cpp.tpl @@ -28,23 +28,23 @@ int main(int argc, char *argv[]) static SafeRenderer::QSafeLayoutResourceReader layout("/layoutData/main/main.srl"); #if defined(USE_OUTPUTVERIFIER) - static OutputVerifier outputVerifier; + static SafeRenderer::OutputVerifier outputVerifier; #if defined(HOST_BUILD) //In host environment the TestVerifier must be explicitly created. //In OpeWFD adaptation the MISRVerifier instance is created in the SafeWindow adaptation. - static TestVerifier testVerifier(outputVerifier); + static SafeRenderer::TestVerifier testVerifier(outputVerifier); #endif - SafeWindow telltaleWindow(layout.size(), QSafePoint(0U, 0U), outputVerifier); + SafeRenderer::SafeWindow telltaleWindow(layout.size(), SafeRenderer::QSafePoint(0U, 0U), outputVerifier); #else - SafeWindow telltaleWindow(layout.size(), QSafePoint(0U, 0U)); + SafeRenderer::SafeWindow telltaleWindow(layout.size(), SafeRenderer::QSafePoint(0U, 0U)); #endif static SafeRenderer::StateManager stateManager(telltaleWindow, layout); telltaleWindow.requestUpdate(); //Request is required because eventHandler is not running yet. #if defined(USE_OUTPUTVERIFIER) - EventHandler msgHandler(stateManager, telltaleWindow, outputVerifier); + SafeRenderer::EventHandler msgHandler(stateManager, telltaleWindow, outputVerifier); #else - EventHandler msgHandler(stateManager, telltaleWindow); + SafeRenderer::EventHandler msgHandler(stateManager, telltaleWindow); #endif #if defined(HOST_BUILD) From 7879d8403375373ff99ac54a975b092ade1f0ecd Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 22 Mar 2023 09:38:48 +0100 Subject: [PATCH 14/31] deployqt: Support elfutils from Linux distribution Which can be in a more complicated directory than just /usr/lib, like /usr/lib/aarch64-linux-gnu . So, recursively look for the elf library to determine the right directory. Change-Id: I58ed8a045fbde50dea8851f63409a5a0863c3b16 Reviewed-by: David Schulz Reviewed-by: Qt CI Bot --- scripts/deployqt.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/deployqt.py b/scripts/deployqt.py index 05113e43e77..79aea111bdd 100755 --- a/scripts/deployqt.py +++ b/scripts/deployqt.py @@ -273,13 +273,20 @@ def deploy_elfutils(qtc_install_dir, chrpath_bin, args): if common.is_mac_platform(): return + libs = ['elf', 'dw'] + version = '1' + def lib_name(name, version): return ('lib' + name + '.so.' + version if common.is_linux_platform() else name + '.dll') - version = '1' - libs = ['elf', 'dw'] - elfutils_lib_path = os.path.join(args.elfutils_path, 'lib') + def find_elfutils_lib_path(path): + for root, _, files in os.walk(path): + if lib_name('elf', version) in files: + return root + return path + + elfutils_lib_path = find_elfutils_lib_path(os.path.join(args.elfutils_path, 'lib')) if common.is_linux_platform(): install_path = os.path.join(qtc_install_dir, 'lib', 'elfutils') backends_install_path = install_path From d1d893f0984ca806e576b52ff46252d69fc3cc83 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 18 Apr 2023 09:54:27 -0700 Subject: [PATCH 15/31] Fix dangling references, found by GCC 13 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lifetime extension via const-ref only applies to functions that return by value. For those that already return by reference (such as QList::constLast()), no extension happens and we end up with a dangling reference. cmakebuildconfiguration.cpp:1473:25: warning: possibly dangling reference to a temporary [-Wdangling-reference] cmakebuildconfiguration.cpp:1473:61: note: the temporary was destroyed at the end of the full expression ‘ProjectExplorer::BuildStepList::steps() const().QList::constLast()’ Change-Id: I3b169860d8bd41e9be6bfffd1757167b7348be9b Reviewed-by: Eike Ziller Reviewed-by: hjk Reviewed-by: Ville Voutilainen --- src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp | 2 +- src/plugins/texteditor/texteditor.cpp | 4 ++-- src/plugins/texteditor/textmark.cpp | 2 +- src/plugins/valgrind/callgrindvisualisation.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 3c0e89fcbdb..c6d6a624cfb 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -1476,7 +1476,7 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id) // Android magic: if (DeviceTypeKitAspect::deviceTypeId(k) == Android::Constants::ANDROID_DEVICE_TYPE) { buildSteps()->appendStep(Android::Constants::ANDROID_BUILD_APK_ID); - const auto &bs = buildSteps()->steps().constLast(); + const auto bs = buildSteps()->steps().constLast(); cmd.addArg("-DANDROID_PLATFORM:STRING=" + bs->data(Android::Constants::AndroidNdkPlatform).toString()); auto ndkLocation = bs->data(Android::Constants::NdkLocation).value(); diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 3b8f5505d64..bed196a76c6 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -2905,9 +2905,9 @@ void TextEditorWidget::insertCodeSnippet(const QTextCursor &cursor_arg, d->m_document->autoIndent(cursor); cursor.endEditBlock(); - const QColor &occurrencesColor + const QColor occurrencesColor = textDocument()->fontSettings().toTextCharFormat(C_OCCURRENCES).background().color(); - const QColor &renameColor + const QColor renameColor = textDocument()->fontSettings().toTextCharFormat(C_OCCURRENCES_RENAME).background().color(); for (const CursorPart &part : cursorParts) { diff --git a/src/plugins/texteditor/textmark.cpp b/src/plugins/texteditor/textmark.cpp index 4eadb4b4c63..ddf354ea92c 100644 --- a/src/plugins/texteditor/textmark.cpp +++ b/src/plugins/texteditor/textmark.cpp @@ -132,7 +132,7 @@ void TextMark::paintAnnotation(QPainter &painter, const QColor &markColor = annotationColor(); const FontSettings &fontSettings = m_baseTextDocument->fontSettings(); - const AnnotationColors &colors = AnnotationColors::getAnnotationColors( + const AnnotationColors colors = AnnotationColors::getAnnotationColors( markColor.isValid() ? markColor : painter.pen().color(), fontSettings.toTextCharFormat(C_TEXT).background().color()); diff --git a/src/plugins/valgrind/callgrindvisualisation.cpp b/src/plugins/valgrind/callgrindvisualisation.cpp index c06664d3ab4..a850f47a331 100644 --- a/src/plugins/valgrind/callgrindvisualisation.cpp +++ b/src/plugins/valgrind/callgrindvisualisation.cpp @@ -155,7 +155,7 @@ void FunctionGraphicsItem::paint(QPainter *painter, painter->save(); QRectF rect = this->rect(); - const QColor &color = brush().color(); + const QColor color = brush().color(); if (option->state & QStyle::State_Selected) { QLinearGradient gradient(0, 0, rect.width(), 0); gradient.setColorAt(0, color.darker(100)); From 8ac826a1a0d15673f3527d513fb54e9d40ca76a4 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 20 Apr 2023 17:17:18 +0200 Subject: [PATCH 16/31] qbs build: Fix pluginjson module The "product" qualification was missing for "sourceDirectory". This currently happens to work due to scope pollution in the qbs implementation. Change-Id: I61758023d39d00505c586c1e5ad78185a69c0db1 Reviewed-by: Reviewed-by: Christian Stenger --- qbs/modules/pluginjson/pluginjson.qbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qbs/modules/pluginjson/pluginjson.qbs b/qbs/modules/pluginjson/pluginjson.qbs index eccd53c85bd..e210731f0bf 100644 --- a/qbs/modules/pluginjson/pluginjson.qbs +++ b/qbs/modules/pluginjson/pluginjson.qbs @@ -19,7 +19,7 @@ Module { // TODO: Could something like this be incorporated into the vcs module? // Currently, the default repo dir is project.sourceDirectory, which // does not make sense for Qt Creator. - var dir = sourceDirectory; + var dir = product.sourceDirectory; while (true) { if (File.exists(FileInfo.joinPaths(dir, ".git"))) return dir; From 94c9e6cbac54d6fe4daf362a7bb048c624e0b85f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6hning?= Date: Fri, 31 Mar 2023 11:09:16 +0200 Subject: [PATCH 17/31] SquishTests: Add possible location of cdb Change-Id: I72c3f1b5bdcceeca2764d4a77229c45655187376 Reviewed-by: Christian Stenger Reviewed-by: --- tests/system/suite_general/tst_default_settings/test.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/system/suite_general/tst_default_settings/test.py b/tests/system/suite_general/tst_default_settings/test.py index 866720b27b8..f710dd1375a 100644 --- a/tests/system/suite_general/tst_default_settings/test.py +++ b/tests/system/suite_general/tst_default_settings/test.py @@ -275,7 +275,9 @@ def __getCDB__(): "C:\\Program Files\\Windows Kits\\8.1\\Debuggers\\x86", "C:\\Program Files\\Windows Kits\\8.1\\Debuggers\\x64", "C:\\Program Files (x86)\\Windows Kits\\10\\Debuggers\\x86", - "C:\\Program Files (x86)\\Windows Kits\\10\\Debuggers\\x64"] + "C:\\Program Files (x86)\\Windows Kits\\10\\Debuggers\\x64", + "C:\\Program Files\\Windows Kits\\10\\Debuggers\\x86", + "C:\\Program Files\\Windows Kits\\10\\Debuggers\\x64"] for cdbPath in possibleLocations: cdb = os.path.join(cdbPath, "cdb.exe") if os.path.exists(cdb): From 440541da232eb8dc9a6ceca566d9a56daee6bc17 Mon Sep 17 00:00:00 2001 From: Haowei Hsu Date: Tue, 28 Mar 2023 15:52:27 +0800 Subject: [PATCH 18/31] l10n(zh_TW): Fix translations of 'Toolchain' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Toolchain: 工具鍊 -> 工具鏈 Change-Id: Ia58d3c58ec46169abfc51036131be5572e7c242e Reviewed-by: Reviewed-by: 林博仁(Buo-ren, Lin) Reviewed-by: Eike Ziller --- .../qtcreator/translations/qtcreator_zh_TW.ts | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/share/qtcreator/translations/qtcreator_zh_TW.ts b/share/qtcreator/translations/qtcreator_zh_TW.ts index 3c1beded9e6..bf09c6b901e 100644 --- a/share/qtcreator/translations/qtcreator_zh_TW.ts +++ b/share/qtcreator/translations/qtcreator_zh_TW.ts @@ -246,7 +246,7 @@ The directory %1 already contains a cbp file, which is recent enough. You can pass special arguments or change the used tool chain here and rerun CMake. Or simply finish the wizard directly. - 目錄 %1 已存在一份足夠新的 cbp 檔。您可以在此傳送特殊引數,或是變更所使用的工具鍊,然後重新執行 CMake。或者您也可以直接結束此精靈。 + 目錄 %1 已存在一份足夠新的 cbp 檔。您可以在此傳送特殊引數,或是變更所使用的工具鏈,然後重新執行 CMake。或者您也可以直接結束此精靈。 The directory %1 does not contain a cbp file. Qt Creator needs to create this file by running CMake. Some projects require command line arguments to the initial CMake call. @@ -315,7 +315,7 @@ <b>Unknown tool chain</b> - <b>未知的工具鍊</b> + <b>未知的工具鏈</b> Please enter the directory in which you want to build your project. @@ -3292,7 +3292,7 @@ at debugger startup. &Tool chain: - 工具鍊(&T): + 工具鏈(&T): Break at '&main': @@ -3304,7 +3304,7 @@ at debugger startup. Tool &chain: - 工具鍊(&C): + 工具鏈(&C): &Host and port: @@ -4480,11 +4480,11 @@ Reason: %3 Tool chain: - 工具鍊: + 工具鏈: <Invalid tool chain> - <無效的工具鍊> + <無效的工具鏈> Generic Manager @@ -7385,11 +7385,11 @@ Preselects a desktop Qt for building the application if available. using Qt version: <b>%1</b><br>with tool chain <b>%2</b><br>building in <b>%3</b> - 使用 Qt 版本:<b>%1</b><br>和工具鍊 <b>%2</b><br>在目錄 <b>%3</b> 中建置 + 使用 Qt 版本:<b>%1</b><br>和工具鏈 <b>%2</b><br>在目錄 <b>%3</b> 中建置 <Invalid tool chain> - <無效的工具鍊> + <無效的工具鏈> General @@ -7426,7 +7426,7 @@ Preselects a desktop Qt for building the application if available. <No tool chain selected> - <沒有選擇工具鍊> + <沒有選擇工具鏈> An incompatible build exists in %1, which will be overwritten. @@ -7443,7 +7443,7 @@ Preselects a desktop Qt for building the application if available. Tool chain: - 工具鍊: + 工具鏈: Shadow build: @@ -7592,11 +7592,11 @@ Preselects a desktop Qt for building the application if available. Qt Creator needs a build configuration set up to build. Configure a tool chain in Project mode. - Qt Creator 需要先設定建置組態才能執行建置。請在專案模式下組態工具鍊。 + Qt Creator 需要先設定建置組態才能執行建置。請在專案模式下組態工具鏈。 Qt Creator needs a tool chain set up to build. Configure a tool chain in Project mode. - Qt Creator 需要設置一個工具鍊才能建置。請在專案模式下組態工具鍊。 + Qt Creator 需要設置一個工具鏈才能建置。請在專案模式下組態工具鏈。 Cannot find Makefile. Check your build settings. @@ -7685,7 +7685,7 @@ Preselects a desktop Qt for building the application if available. <b>Warning:</b> The tool chain suggests using another mkspec. - <b>警告:</b> 工具鍊建議使用另一個 mkspec。 + <b>警告:</b> 工具鏈建議使用另一個 mkspec。 Enable QML debugging: @@ -13411,7 +13411,7 @@ Requires <b>Qt 4.7.4</b> or newer. ABI detection failed: Make sure to use a matching tool chain when building. - ABI 偵測失敗:請確認使用的工具鍊是否正確。 + ABI 偵測失敗:請確認使用的工具鏈是否正確。 No qmlscene installed. @@ -13466,7 +13466,7 @@ Requires <b>Qt 4.7.4</b> or newer. Building helper(s) with toolchain '%1'... - 正在使用工具鍊 '%1' 建置小助手... + 正在使用工具鏈 '%1' 建置小助手... @@ -13769,11 +13769,11 @@ with a password, which you can enter below. The Symbian tool chain does not handle spaces in the project path '%1'. - Symbian 工具鍊不能處理在專案路徑 '%1' 中的空白。 + Symbian 工具鏈不能處理在專案路徑 '%1' 中的空白。 The Symbian tool chain does not handle special characters in the project name '%1' well. - Symbian 的工具鍊不能處理專案名稱 '%1' 中的特殊字元。 + Symbian 的工具鏈不能處理專案名稱 '%1' 中的特殊字元。 @@ -18977,15 +18977,15 @@ Do you want to retry? The following tool chain was already configured:<br>&nbsp;%1<br>It was not configured again. - 已組態以下工具鍊:<br>&nbsp;%1<br>因此未再次組態。 + 已組態以下工具鏈:<br>&nbsp;%1<br>因此未再次組態。 Duplicate Tool Chains detected - 偵測到工具鍊有重複 + 偵測到工具鏈有重複 The following tool chains were already configured:<br>&nbsp;%1<br>They were not configured again. - 已組態以下工具鍊:<br>&nbsp;%1<br>因此未再次組態。 + 已組態以下工具鏈:<br>&nbsp;%1<br>因此未再次組態。 @@ -20328,7 +20328,7 @@ if (a && Tool chain: - 工具鍊: + 工具鏈: Compiler: @@ -21416,7 +21416,7 @@ Do you want to retry? No valid tool chain has been detected.<br>Define a correct tool chain in "Options > Tool Chains" - 沒有偵測到有效的工具鍊。<br>請在「選項」─「工具鍊」中定義一個正確的工具鍊 + 沒有偵測到有效的工具鏈。<br>請在「選項」─「工具鏈」中定義一個正確的工具鏈 Choose a build configuration: @@ -21424,7 +21424,7 @@ Do you want to retry? Choose a tool chain: - 選擇一個工具鍊: + 選擇一個工具鏈: Launching @@ -21562,11 +21562,11 @@ Do you want to retry? No tool chain can produce code for this Qt version. Please define one or more tool chains. - 沒有這個 Qt 版本使用的工具鍊。請定義一個或更多工具鍊。 + 沒有這個 Qt 版本使用的工具鏈。請定義一個或更多工具鏈。 Not all possible target environments can be supported due to missing tool chains. - 因為缺少工具鍊,所以不是所有的目標平台都能被支援。 + 因為缺少工具鏈,所以不是所有的目標平台都能被支援。 The following ABIs are currently not supported:<ul><li>%1</li></ul> @@ -26093,11 +26093,11 @@ should a repository require SSH-authentication (see documentation on SSH and the Tool chain: - 工具鍊: + 工具鏈: <Invalid tool chain> - <無效的工具鍊> + <無效的工具鏈> Failed opening project '%1': Project file does not exist @@ -26174,7 +26174,7 @@ should a repository require SSH-authentication (see documentation on SSH and the <b>Unknown tool chain</b> - <b>未知的工具鍊</b> + <b>未知的工具鏈</b> @@ -26650,7 +26650,7 @@ references to elements in other files, loops, etc.) <p>The project <b>%1</b> is not yet configured.</p><p>Qt Creator uses the Qt version: <b>%2</b> and the tool chain: <b>%3</b> to parse the project. You can edit these in the <b><a href="edit">options.</a></b></p> - <p>專案 <b>%1</b>還沒組態。</p><p>Qt Creator 使用的 Qt 版本: <b>%2</b> 和工具鍊: <b>%3</b> 來解析專案。 你可以編輯這些 <b><a href="edit">選項.</a></b></p> + <p>專案 <b>%1</b>還沒組態。</p><p>Qt Creator 使用的 Qt 版本: <b>%2</b> 和工具鏈: <b>%3</b> 來解析專案。 你可以編輯這些 <b><a href="edit">選項.</a></b></p> Qt Version: @@ -26658,7 +26658,7 @@ references to elements in other files, loops, etc.) Tool Chain: - 工具鍊: + 工具鏈: From 1e02f6bf987d4690695b49c0ac0358778d4e78c8 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Fri, 21 Apr 2023 11:30:18 +0200 Subject: [PATCH 19/31] Resuscitate the "legacy" Qt Quick Application wizard Users still want to create new Qt Quick Application applications targeting Qt 5 and with other build systems than cmake. Fixes: QTCREATORBUG-28964 Change-Id: Ib87b7128f0b34eb4126ec771f324c70a960b2a03 Reviewed-by: Eike Ziller --- .../CMakeLists.6.x.txt | 33 +++ .../qtquickapplication_compat/CMakeLists.txt | 79 ++++++ .../qtquickapplication_compat/app.pro | 40 +++ .../qtquickapplication_compat/app.qbs | 48 ++++ .../qtquickapplication_compat/empty/icon.png | Bin 0 -> 228 bytes .../empty/icon@2x.png | Bin 0 -> 392 bytes .../empty/main.qml.tpl | 48 ++++ .../qtquickapplication_compat/empty/qml.qrc | 5 + .../empty/wizard.json | 230 ++++++++++++++++++ .../qtquickapplication_compat/main.cpp | 58 +++++ .../qtquickcontrols2.conf | 25 ++ 11 files changed, 566 insertions(+) create mode 100644 share/qtcreator/templates/wizards/projects/qtquickapplication_compat/CMakeLists.6.x.txt create mode 100644 share/qtcreator/templates/wizards/projects/qtquickapplication_compat/CMakeLists.txt create mode 100644 share/qtcreator/templates/wizards/projects/qtquickapplication_compat/app.pro create mode 100644 share/qtcreator/templates/wizards/projects/qtquickapplication_compat/app.qbs create mode 100644 share/qtcreator/templates/wizards/projects/qtquickapplication_compat/empty/icon.png create mode 100644 share/qtcreator/templates/wizards/projects/qtquickapplication_compat/empty/icon@2x.png create mode 100644 share/qtcreator/templates/wizards/projects/qtquickapplication_compat/empty/main.qml.tpl create mode 100644 share/qtcreator/templates/wizards/projects/qtquickapplication_compat/empty/qml.qrc create mode 100644 share/qtcreator/templates/wizards/projects/qtquickapplication_compat/empty/wizard.json create mode 100644 share/qtcreator/templates/wizards/projects/qtquickapplication_compat/main.cpp create mode 100644 share/qtcreator/templates/wizards/projects/qtquickapplication_compat/qtquickcontrols2.conf diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication_compat/CMakeLists.6.x.txt b/share/qtcreator/templates/wizards/projects/qtquickapplication_compat/CMakeLists.6.x.txt new file mode 100644 index 00000000000..9d2fc4a82cc --- /dev/null +++ b/share/qtcreator/templates/wizards/projects/qtquickapplication_compat/CMakeLists.6.x.txt @@ -0,0 +1,33 @@ +cmake_minimum_required(VERSION 3.16) + +project(%{ProjectName} VERSION 0.1 LANGUAGES CXX) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(Qt6 6.2 COMPONENTS Quick REQUIRED) + +qt_add_executable(%{TargetName} + main.cpp +) + +qt_add_qml_module(%{TargetName} + URI %{ProjectName} + VERSION 1.0 + QML_FILES main.qml %{AdditionalQmlFiles} +) + +set_target_properties(%{TargetName} PROPERTIES + MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com + MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} + MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} + MACOSX_BUNDLE TRUE + WIN32_EXECUTABLE TRUE +) + +target_link_libraries(%{TargetName} + PRIVATE Qt6::Quick) + +install(TARGETS %{TargetName} + BUNDLE DESTINATION . + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication_compat/CMakeLists.txt b/share/qtcreator/templates/wizards/projects/qtquickapplication_compat/CMakeLists.txt new file mode 100644 index 00000000000..3b5806eb093 --- /dev/null +++ b/share/qtcreator/templates/wizards/projects/qtquickapplication_compat/CMakeLists.txt @@ -0,0 +1,79 @@ +cmake_minimum_required(VERSION 3.14) + +project(%{ProjectName} VERSION 0.1 LANGUAGES CXX) + +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +@if %{HasTranslation} +find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Quick LinguistTools) +find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Quick LinguistTools) + +set(TS_FILES %{TsFileName}) +@else +find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Quick) +find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Quick) +@endif + +set(PROJECT_SOURCES + %{MainCppFileName} + qml.qrc + @if %{HasTranslation} + ${TS_FILES} + @endif +) + +if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) + qt_add_executable(%{ProjectName} + MANUAL_FINALIZATION + ${PROJECT_SOURCES} + ) +# Define target properties for Android with Qt 6 as: +# set_property(TARGET %{ProjectName} APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR +# ${CMAKE_CURRENT_SOURCE_DIR}/android) +# For more information, see https://doc.qt.io/qt-6/qt-add-executable.html#target-creation +@if %{HasTranslation} + + qt_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES}) +@endif +else() + if(ANDROID) + add_library(%{ProjectName} SHARED + ${PROJECT_SOURCES} + ) +# Define properties for Android with Qt 5 after find_package() calls as: +# set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android") + else() + add_executable(%{ProjectName} + ${PROJECT_SOURCES} + ) + endif() +@if %{HasTranslation} + + qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES}) +@endif +endif() + +target_link_libraries(%{ProjectName} + PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Quick) + +set_target_properties(%{ProjectName} PROPERTIES + MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com + MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} + MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} + MACOSX_BUNDLE TRUE + WIN32_EXECUTABLE TRUE +) + +install(TARGETS %{ProjectName} + BUNDLE DESTINATION . + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +if(QT_VERSION_MAJOR EQUAL 6) + qt_import_qml_plugins(%{ProjectName}) + qt_finalize_executable(%{ProjectName}) +endif() diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication_compat/app.pro b/share/qtcreator/templates/wizards/projects/qtquickapplication_compat/app.pro new file mode 100644 index 00000000000..1e0811386ab --- /dev/null +++ b/share/qtcreator/templates/wizards/projects/qtquickapplication_compat/app.pro @@ -0,0 +1,40 @@ +@if "%{UseVirtualKeyboard}" == "true" +QT += quick virtualkeyboard +@else +QT += quick +@endif +@if !%{IsQt6} + +# You can make your code fail to compile if it uses deprecated APIs. +# In order to do so, uncomment the following line. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 +@endif + +SOURCES += \\ + %{MainCppFileName} + +@if %{IsQt6} +resources.files = main.qml %{AdditionalQmlFiles} +resources.prefix = /$${TARGET} +RESOURCES += resources +@else +RESOURCES += qml.qrc +@endif +@if %{HasTranslation} + +TRANSLATIONS += \\ + %{TsFileName} +CONFIG += lrelease +CONFIG += embed_translations +@endif + +# Additional import path used to resolve QML modules in Qt Creator's code model +QML_IMPORT_PATH = + +# Additional import path used to resolve QML modules just for Qt Quick Designer +QML_DESIGNER_IMPORT_PATH = + +# Default rules for deployment. +qnx: target.path = /tmp/$${TARGET}/bin +else: unix:!android: target.path = /opt/$${TARGET}/bin +!isEmpty(target.path): INSTALLS += target diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication_compat/app.qbs b/share/qtcreator/templates/wizards/projects/qtquickapplication_compat/app.qbs new file mode 100644 index 00000000000..14025b37b82 --- /dev/null +++ b/share/qtcreator/templates/wizards/projects/qtquickapplication_compat/app.qbs @@ -0,0 +1,48 @@ +import qbs + +CppApplication { +@if "%{UseVirtualKeyboard}" == "true" + Depends { name: "Qt"; submodules: ["quick", "virtualkeyboard"] } +@else + Depends { name: "Qt.quick" } +@endif + + install: true + + // Additional import path used to resolve QML modules in Qt Creator's code model + property pathList qmlImportPaths: [] +@if !%{IsQt6} + + cpp.defines: [ + // You can make your code fail to compile if it uses deprecated APIs. + // In order to do so, uncomment the following line. + //"QT_DISABLE_DEPRECATED_BEFORE=0x060000" // disables all the APIs deprecated before Qt 6.0.0 + ] +@endif + + files: [ + "%{MainCppFileName}", +@if !%{IsQt6} + "main.qml", + "qml.qrc", +@endif +@if %{HasTranslation} + "%{TsFileName}", +@endif + ] + @if %{HasTranslation} + + Group { + fileTagsFilter: "qm" + Qt.core.resourcePrefix: "/i18n" + fileTags: "qt.core.resource_data" + } +@endif +@if %{IsQt6} + Group { + files: ["main.qml"%{AdditionalQmlFilesQbs}] + Qt.core.resourcePrefix: "%{ProjectName}/" + fileTags: ["qt.qml.qml", "qt.core.resource_data"] + } +@endif +} diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication_compat/empty/icon.png b/share/qtcreator/templates/wizards/projects/qtquickapplication_compat/empty/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..cb0a6d3b6027dac7c2982bf6f1bc201e0de15b25 GIT binary patch literal 228 zcmeAS@N?(olHy`uVBq!ia0y~yU@!n-4h9AWhN8@6(F_a>t36#DLp+YZy|$6}kby|c z!__tnvL4?@Up6tf4|SbL3=W2TLi7qYNx+e-vhHx%1VCLFbpnhxxYKZge;7PgZ4? z^H6AH5&EI;Ai^G7ZY_S9PcR^0Zp#CU6AnNBByHMpv$k+^_L9SSrOvVK-RpK12R*%F fdGpGf*@EBL(u58kJ9+6>8OZsbu6{1-oD!M<8f;q| literal 0 HcmV?d00001 diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication_compat/empty/icon@2x.png b/share/qtcreator/templates/wizards/projects/qtquickapplication_compat/empty/icon@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..7b0df0dfa5f74b693ea1f6a0d519a8c0301a8bf5 GIT binary patch literal 392 zcmeAS@N?(olHy`uVBq!ia0y~yU`POA4h9AWhU1?#o-i;l`g^)KhGg7(d&}C(*-@n7 z;s30e)th@8nmnf^tmeGwF17Y^!vZ#)QqHK>>^lx}Q>P{@-CLShqw=<3;zogJWA!4H zLqEj}>}Dh`n|VM8tzOoXnVTgXJ+)Zb1bbf^@n>1C6h6t4X83&P0=v$P zsTmhfxL$qH(O|pGD8a{-<%mw|0qcz%4KWfD2?y*M!eVw>yZ5hR*l@LE7sDIt)P`sI z4BwO29~Rp1cL|%t^r;QWt_PMLSf}=ZNo7_;^ZUmc4UB9O2^hp|{+6vL4;&6J-+OiL zTK+rzddv;oTN~mkw%LG0=3=d#Wzp$Pz{o1yjq literal 0 HcmV?d00001 diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication_compat/empty/main.qml.tpl b/share/qtcreator/templates/wizards/projects/qtquickapplication_compat/empty/main.qml.tpl new file mode 100644 index 00000000000..36607ad82e9 --- /dev/null +++ b/share/qtcreator/templates/wizards/projects/qtquickapplication_compat/empty/main.qml.tpl @@ -0,0 +1,48 @@ +import QtQuick %{QtQuickVersion} +@if !%{IsQt6} +import QtQuick.Window %{QtQuickWindowVersion} +@endif +@if %{UseVirtualKeyboard} +import %{QtQuickVirtualKeyboardImport} +@endif + +Window { +@if %{UseVirtualKeyboard} + id: window +@endif + width: 640 + height: 480 + visible: true + title: qsTr("Hello World") +@if %{UseVirtualKeyboard} + + InputPanel { + id: inputPanel + z: 99 + x: 0 + y: window.height + width: window.width + + states: State { + name: "visible" + when: inputPanel.active + PropertyChanges { + target: inputPanel + y: window.height - inputPanel.height + } + } + transitions: Transition { + from: "" + to: "visible" + reversible: true + ParallelAnimation { + NumberAnimation { + properties: "y" + duration: 250 + easing.type: Easing.InOutQuad + } + } + } + } +@endif +} diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication_compat/empty/qml.qrc b/share/qtcreator/templates/wizards/projects/qtquickapplication_compat/empty/qml.qrc new file mode 100644 index 00000000000..5f6483ac33f --- /dev/null +++ b/share/qtcreator/templates/wizards/projects/qtquickapplication_compat/empty/qml.qrc @@ -0,0 +1,5 @@ + + + main.qml + + diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication_compat/empty/wizard.json b/share/qtcreator/templates/wizards/projects/qtquickapplication_compat/empty/wizard.json new file mode 100644 index 00000000000..c2365108daa --- /dev/null +++ b/share/qtcreator/templates/wizards/projects/qtquickapplication_compat/empty/wizard.json @@ -0,0 +1,230 @@ +{ + "version": 1, + "supportedProjectTypes": [ "CMakeProjectManager.CMakeProject", "Qbs.QbsProject", "Qt4ProjectManager.Qt4Project" ], + "id": "V.QtQuickApplicationEmptyCompat", + "category": "D.ApplicationQt", + "trDescription": "Creates a Qt Quick application that contains an empty window.\n\nUse this \"compat\" version if you want to use other build systems than CMake or Qt versions lower than 6.", + "trDisplayName": "Qt Quick Application (compat)", + "trDisplayCategory": "Application (Qt)", + "icon": "icon.png", + "iconKind": "Themed", + "featuresRequired": [ "QtSupport.Wizards.FeatureQt.5.6" ], + "enabled": "%{JS: value('Plugins').indexOf('QmakeProjectManager') >= 0 || value('Plugins').indexOf('QbsProjectManager') >= 0 || value('Plugins').indexOf('CMakeProjectManager') >= 0}", + + "options": + [ + { "key": "ProjectFile", "value": "%{JS: value('BuildSystem') === 'qmake' ? value('ProFile') : (value('BuildSystem') === 'cmake' ? value('CMakeFile') : value('QbsFile'))}" }, + { "key": "ProFile", "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'pro')}" }, + { "key": "QbsFile", "value": "%{JS: Util.fileName(value('ProjectDirectory') + '/' + value('ProjectName'), 'qbs')}" }, + { "key": "CMakeFile", "value": "%{ProjectDirectory}/CMakeLists.txt" }, + { "key": "IsQt6", "value": "%{JS: value('QtVersion').IsQt6}" }, + { "key": "MainCppFileName", "value": "%{JS: 'main.' + Util.preferredSuffix('text/x-c++src')}" }, + { "key": "QtQuickVersion", "value": "%{JS: value('QtVersion').QtQuickVersion}" }, + { "key": "QtQuickWindowVersion", "value": "%{JS: value('QtVersion').QtQuickWindowVersion}" }, + { "key": "QtQuickVirtualKeyboardImport", "value": "%{JS: value('QtVersion').QtQuickVirtualKeyboardImport}" }, + { "key": "QtQuickFeature", "value": "%{JS: (value('QtQuickVersion')=='') ? 'QtSupport.Wizards.FeatureQt.6.2' : 'QtSupport.Wizards.FeatureQtQuick.%{QtQuickVersion}'}" }, + { "key": "UseVirtualKeyboardByDefault", "value": "%{JS: value('Plugins').indexOf('Boot2Qt') >= 0 || value('Plugins').indexOf('Boot2QtQdb') >= 0}" }, + { "key": "HasTranslation", "value": "%{JS: value('TsFileName') !== ''}" }, + { "key": "SetQPAPhysicalSize", "value": "%{UseVirtualKeyboardByDefault}" }, + { "key": "AdditionalQmlFiles", "value": "" }, + { "key": "AdditionalQmlFilesQbs", "value": "" }, + { "key": "TargetName", "value": "%{JS: 'app' + value('ProjectName')}" } + ], + + "pages": + [ + { + "trDisplayName": "Project Location", + "trShortTitle": "Location", + "typeId": "Project" + }, + { + "trDisplayName": "Define Build System", + "trShortTitle": "Build System", + "typeId": "Fields", + "enabled": "%{JS: !value('IsSubproject')}", + "data": + [ + { + "name": "BuildSystem", + "trDisplayName": "Build system:", + "type": "ComboBox", + "persistenceKey": "BuildSystemType", + "data": + { + "index": 1, + "items": + [ + { + "trKey": "qmake", + "value": "qmake", + "condition": "%{JS: value('Plugins').indexOf('QmakeProjectManager') >= 0}" + }, + { + "trKey": "CMake", + "value": "cmake", + "condition": "%{JS: value('Plugins').indexOf('CMakeProjectManager') >= 0}" + }, + { + "trKey": "Qbs", + "value": "qbs", + "condition": "%{JS: value('Plugins').indexOf('QbsProjectManager') >= 0}" + } + ] + } + } + ] + }, + { + "trDisplayName": "Define Project Details", + "trShortTitle": "Details", + "typeId": "Fields", + "data": + [ + { + "name": "QtVersion", + "trDisplayName": "Minimum required Qt version:", + "type": "ComboBox", + "persistenceKey": "QtQuick.minimumQtVersion", + "data": + { + "index": 1, + "items": + [ + { + "trKey": "Qt 6.2", + "value": + { + "QtQuickVersion": "", + "QtQuickWindowVersion": "", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard", + "IsQt6": true + } + }, + { + "trKey": "Qt 5.15", + "value": + { + "QtQuickVersion": "2.15", + "QtQuickWindowVersion": "2.15", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.15", + "IsQt6": false + } + }, + { + "trKey": "Qt 5.14", + "value": + { + "QtQuickVersion": "2.14", + "QtQuickWindowVersion": "2.14", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.14", + "IsQt6": false + } + }, + { + "trKey": "Qt 5.13", + "value": + { + "QtQuickVersion": "2.13", + "QtQuickWindowVersion": "2.13", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.4", + "IsQt6": false + } + }, + { + "trKey": "Qt 5.12", + "value": + { + "QtQuickVersion": "2.12", + "QtQuickWindowVersion": "2.12", + "QtQuickVirtualKeyboardImport": "QtQuick.VirtualKeyboard 2.4", + "IsQt6": false + } + } + ] + } + }, + { + "name": "UseVirtualKeyboard", + "trDisplayName": "Use Qt Virtual Keyboard", + "type": "CheckBox", + "persistenceKey": "QtQuick.UseVirtualKeyboard.%{UseVirtualKeyboardByDefault}", + "data": + { + "checked": "%{UseVirtualKeyboardByDefault}" + } + } + ] + }, + { + "trDisplayName": "Translation File", + "trShortTitle": "Translation", + "typeId": "QtTranslation" + }, + { + "trDisplayName": "Kit Selection", + "trShortTitle": "Kits", + "typeId": "Kits", + "enabled": "%{JS: !value('IsSubproject')}", + "data": { + "projectFilePath": "%{ProjectFile}", + "requiredFeatures": [ "QtSupport.Wizards.FeatureQt", "%{QtQuickFeature}" ] + } + }, + { + "trDisplayName": "Project Management", + "trShortTitle": "Summary", + "typeId": "Summary" + } + ], + "generators": + [ + { + "typeId": "File", + "data": + [ + { + "source": "../app.pro", + "target": "%{ProFile}", + "openAsProject": true, + "condition": "%{JS: value('BuildSystem') === 'qmake'}" + }, + { + "source": "%{JS: value('QtVersion').IsQt6 ? '../CMakeLists.6.x.txt' : '../CMakeLists.txt'}", + "target": "CMakeLists.txt", + "openAsProject": true, + "condition": "%{JS: value('BuildSystem') === 'cmake'}" + }, + { + "source": "../app.qbs", + "target": "%{QbsFile}", + "openAsProject": true, + "condition": "%{JS: value('BuildSystem') === 'qbs'}" + }, + { + "source": "../main.cpp", + "target": "%{MainCppFileName}" + }, + { + "source": "main.qml.tpl", + "target": "main.qml", + "openInEditor": true + }, + { + "source": "qml.qrc", + "condition": "%{JS: !value('QtVersion').IsQt6}" + }, + { + "source": "../../translation.ts", + "target": "%{TsFileName}", + "condition": "%{HasTranslation}" + }, + { + "source": "../../git.ignore", + "target": ".gitignore", + "condition": "%{JS: !value('IsSubproject') && value('VersionControl') === 'G.Git'}" + } + ] + } + ] +} diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication_compat/main.cpp b/share/qtcreator/templates/wizards/projects/qtquickapplication_compat/main.cpp new file mode 100644 index 00000000000..08698bb6bea --- /dev/null +++ b/share/qtcreator/templates/wizards/projects/qtquickapplication_compat/main.cpp @@ -0,0 +1,58 @@ +%{Cpp:LicenseTemplate}\ +%{JS: QtSupport.qtIncludes([], ["QtGui/QGuiApplication", "QtQml/QQmlApplicationEngine"])} +@if %{HasTranslation} +#include +#include +@endif + +int main(int argc, char *argv[]) +{ +@if %{UseVirtualKeyboard} + qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard")); + +@endif +@if !%{IsQt6} +@if %{SetQPAPhysicalSize} + if (qEnvironmentVariableIsEmpty("QTGLESSTREAM_DISPLAY")) { + qputenv("QT_QPA_EGLFS_PHYSICAL_WIDTH", QByteArray("213")); + qputenv("QT_QPA_EGLFS_PHYSICAL_HEIGHT", QByteArray("120")); + +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); +#endif + } +@else +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); +#endif +@endif +@endif + QGuiApplication app(argc, argv); +@if %{HasTranslation} + + QTranslator translator; + const QStringList uiLanguages = QLocale::system().uiLanguages(); + for (const QString &locale : uiLanguages) { + const QString baseName = "%{JS: value('ProjectName') + '_'}" + QLocale(locale).name(); + if (translator.load(":/i18n/" + baseName)) { + app.installTranslator(&translator); + break; + } + } +@endif + + QQmlApplicationEngine engine; +@if %{IsQt6} + const QUrl url(u"qrc:/%{JS: value('ProjectName')}/main.qml"_qs); +@else + const QUrl url(QStringLiteral("qrc:/main.qml")); +@endif + QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, + &app, [url](QObject *obj, const QUrl &objUrl) { + if (!obj && url == objUrl) + QCoreApplication::exit(-1); + }, Qt::QueuedConnection); + engine.load(url); + + return app.exec(); +} diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication_compat/qtquickcontrols2.conf b/share/qtcreator/templates/wizards/projects/qtquickapplication_compat/qtquickcontrols2.conf new file mode 100644 index 00000000000..fd44f05995d --- /dev/null +++ b/share/qtcreator/templates/wizards/projects/qtquickapplication_compat/qtquickcontrols2.conf @@ -0,0 +1,25 @@ +; This file can be edited to change the style of the application +; Read "Qt Quick Controls 2 Configuration File" for details: +; https://doc.qt.io/qt/qtquickcontrols2-configuration.html +@if '%{QtQuickControlsStyle}' != 'Default' + +[Controls] +Style=%{QtQuickControlsStyle} +@if '%{QtQuickControlsStyle}' == 'Universal' + +[Universal] +Theme=%{QtQuickControlsStyleTheme} +;Accent=Steel +;Foreground=Brown +;Background=Steel +@endif +@if '%{QtQuickControlsStyle}' == 'Material' + +[Material] +Theme=%{QtQuickControlsStyleTheme} +;Accent=BlueGrey +;Primary=BlueGray +;Foreground=Brown +;Background=Grey +@endif +@endif From 646f95811dd6e7dccf78678cc9f83d33797240df Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 19 Apr 2023 16:24:41 +0200 Subject: [PATCH 20/31] German translation: Python MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I86e11626122c88a307134ae352331845fa4b394d Reviewed-by: Robert Löhning Reviewed-by: Christian Stenger Reviewed-by: --- share/qtcreator/translations/qtcreator_de.ts | 84 ++++++++++---------- 1 file changed, 44 insertions(+), 40 deletions(-) diff --git a/share/qtcreator/translations/qtcreator_de.ts b/share/qtcreator/translations/qtcreator_de.ts index 0125854d3a9..a49b915b5a2 100644 --- a/share/qtcreator/translations/qtcreator_de.ts +++ b/share/qtcreator/translations/qtcreator_de.ts @@ -40138,11 +40138,11 @@ fails because Clang does not understand the target architecture. Buffered output - + Ausgabe puffern Enabling improves output performance, but results in delayed output. - + Aktivieren dieser Option verbessert die Leistung der Anwendung, resultiert aber in verzögerter Ausgabe. Script: @@ -40162,15 +40162,15 @@ fails because Clang does not understand the target architecture. Executable is empty. - + Ausführbare Datei ist leer. %1 does not exist. - + %1 existiert nicht. %1 is not an executable file. - + %1 ist keine ausführbare Datei. &Add @@ -40186,11 +40186,11 @@ fails because Clang does not understand the target architecture. &Clean Up - + &Bereiningen Remove all Python interpreters without a valid executable. - + Entfernt alle Python-Interpreter ohne gültige ausführbare Datei. Interpreters @@ -40202,43 +40202,43 @@ fails because Clang does not understand the target architecture. Plugins: - + Plugins: Use Python Language Server - + Python Language Server benutzen For a complete list of available options, consult the <a href="https://github.com/python-lsp/python-lsp-server/blob/develop/CONFIGURATION.md">Python LSP Server configuration documentation</a>. - + Für eine vollständige Liste der verfügbaren Optionen siehe auch die <a href="https://github.com/python-lsp/python-lsp-server/blob/develop/CONFIGURATION.md">Dokumentation zur Python LSP-Server-Konfiguration</a>. Advanced - Erweitert + Erweitert Language Server Configuration - + Language Server-Konfiguration (Windowed) - + (mit Fenster) Removing Python - + Entferne Python Python: - + Python: %1 installation missing for %2 (%3) - + %1-Installation fehlt für %2 (%3) Install %1 for %2 using pip package installer. - + Installiere %1 für %2 mit dem pip Paket-Installationsprogramm. Install @@ -40246,95 +40246,99 @@ fails because Clang does not understand the target architecture. Install %1 - + This is the header of a progress bar + Installiere %1 Running "%1" to install %2. - + Führe "%1" aus, um %2 zu installieren. The %1 installation was canceled by %2. - + %2 can be "user" or "time out" which doesn't work in non-english... so working around that. + Die Installation von %1 wurde abgebrochen: %2. user - + Used as %2 in "Die Installation von %1 wurde abgebrochen: %2." + Der Nutzer hat den Prozess abgebrochen time out - + Used as %2 in "Die Installation von %1 wurde abgebrochen: %2." + Zeitüberschreitung Installing the %1 failed with exit code %2 - + Installation von %1 ist mit dem Rückgabewert %2 fehlgeschlagen Run PySide6 project tool - + PySide6 Projektwerkzeug ausführen PySide project tool: - + PySide Projektwerkzeug: Enter location of PySide project tool. - + Geben Sie den Ort des PySide Projektwerkzeugs ein. General - Allgemein + Allgemein REPL - + REPL Open interactive Python. - + Interaktives Python öffnen. REPL Import File - + REPL mit Datei-Import Open interactive Python and import file. - + Interaktives Python öffnen und Datei importieren. REPL Import * - + REPL mit *-Import Open interactive Python and import * from file. - + Interaktives Python öffnen und alles (*) aus der Datei importieren. Open interactive Python. Either importing nothing, importing the current file, or importing everything (*) from the current file. - + Interaktives Python öffnen. Importiert entweder nichts, die aktuelle Datei oder alles (*) aus der aktuellen Datei. No Python Selected - + Kein Python ausgewählt Manage Python Interpreters - + Python-Interpreter verwalten Python Language Server (%1) - + Python Language Server (%1) Install Python language server (PyLS) for %1 (%2). The language server provides Python specific completion and annotation. - + Python Language Server (PyLS) für %1 (%2) installieren. Der Language Server stellt Code-Vervollständigung und Annotationen für Python zur Verfügung. Searching Python binaries... - + Suche ausführbare Python-Dateien... Found "%1" (%2) - + "%1" (%2) gefunden From b794e982335a9b9dbb986900ca44c84d40da2566 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Mon, 24 Apr 2023 07:37:49 +0200 Subject: [PATCH 21/31] QMLLS: fix crash on opening non existing qml files The automatic handling of the document inside the language client manager is normally done after a document was opened successfully. Since the QML document registers the document manually on construction before the file was tried to be opened the automatic cleanup inside the manager does not work. Postpone the document registration like in the PythonDocument after the document was opened successfully. Fixes: QTCREATORBUG-29021 Change-Id: I2dd9e2da9c9ed6d38414ad991df3c03b62e9d611 Reviewed-by: Eike Ziller --- src/plugins/qmljseditor/qmljseditordocument.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/qmljseditor/qmljseditordocument.cpp b/src/plugins/qmljseditor/qmljseditordocument.cpp index 0575e2dbbba..a5b7687a2ac 100644 --- a/src/plugins/qmljseditor/qmljseditordocument.cpp +++ b/src/plugins/qmljseditor/qmljseditordocument.cpp @@ -505,7 +505,6 @@ QmlJSEditorDocumentPrivate::QmlJSEditorDocumentPrivate(QmlJSEditorDocument *pare this, &QmlJSEditorDocumentPrivate::updateOutlineModel); modelManager->updateSourceFiles(Utils::FilePaths({parent->filePath()}), false); - settingsChanged(); } QmlJSEditorDocumentPrivate::~QmlJSEditorDocumentPrivate() @@ -818,6 +817,8 @@ QmlJSEditorDocument::QmlJSEditorDocument(Utils::Id id) setId(id); connect(this, &TextEditor::TextDocument::tabSettingsChanged, d, &Internal::QmlJSEditorDocumentPrivate::invalidateFormatterCache); + connect(this, &TextEditor::TextDocument::openFinishedSuccessfully, + d, &Internal::QmlJSEditorDocumentPrivate::settingsChanged); setSyntaxHighlighter(new QmlJSHighlighter(document())); setCodec(QTextCodec::codecForName("UTF-8")); // qml files are defined to be utf-8 setIndenter(new Internal::Indenter(document())); From 2e384d9c125864b6893464e445041591dd56d9aa Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Mon, 24 Apr 2023 16:31:22 +0200 Subject: [PATCH 22/31] Utils: Fix line ending conversion in FileReader FilePath::fileContents always uses "binary" mode when reading files. FileReader::fetch previously used QFile with QIODevice::Text mode to read (local) files, which converts \r\n to \n. This patch re-introduces the conversion. Fixes: QTCREATORBUG-29040 Change-Id: I0a16b056bea456512e6526497b725c73b0a1bd11 Reviewed-by: Christian Kandeler --- src/libs/utils/fileutils.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libs/utils/fileutils.cpp b/src/libs/utils/fileutils.cpp index 69c31729149..1f6d89c43ae 100644 --- a/src/libs/utils/fileutils.cpp +++ b/src/libs/utils/fileutils.cpp @@ -62,6 +62,10 @@ bool FileReader::fetch(const FilePath &filePath, QIODevice::OpenMode mode) return false; } m_data = *contents; + + if (mode & QIODevice::Text) + m_data = m_data.replace("\r\n", "\n"); + return true; } From fa5c352668b497e626fe74c50e33250404d06960 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Tue, 25 Apr 2023 13:03:06 +0200 Subject: [PATCH 23/31] CMakePM: Fix boolean cacheVariables parsing Fixes: QTCREATORBUG-29078 Change-Id: I652343d6d688e36b6d5ecc23e91243b4cecbb87d Reviewed-by: Alessandro Portale --- .../cmakeprojectmanager/presetsparser.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/presetsparser.cpp b/src/plugins/cmakeprojectmanager/presetsparser.cpp index eed174e2b42..ad4ab07fcb5 100644 --- a/src/plugins/cmakeprojectmanager/presetsparser.cpp +++ b/src/plugins/cmakeprojectmanager/presetsparser.cpp @@ -215,12 +215,24 @@ bool parseConfigurePresets(const QJsonValue &jsonValue, item.key = cacheKey.toUtf8(); item.type = CMakeConfigItem::typeStringToType( cacheVariableObj.value("type").toString().toUtf8()); - item.value = cacheVariableObj.value("type").toString().toUtf8(); + item.value = cacheVariableObj.value("value").toString().toUtf8(); preset.cacheVariables.value() << item; } else { - preset.cacheVariables.value() - << CMakeConfigItem(cacheKey.toUtf8(), cacheValue.toString().toUtf8()); + if (cacheValue.isBool()) { + preset.cacheVariables.value() + << CMakeConfigItem(cacheKey.toUtf8(), + CMakeConfigItem::BOOL, + cacheValue.toBool() ? "ON" : "OFF"); + } else if (CMakeConfigItem::toBool(cacheValue.toString()).has_value()) { + preset.cacheVariables.value() + << CMakeConfigItem(cacheKey.toUtf8(), + CMakeConfigItem::BOOL, + cacheValue.toString().toUtf8()); + } else { + preset.cacheVariables.value() + << CMakeConfigItem(cacheKey.toUtf8(), cacheValue.toString().toUtf8()); + } } } From fff4ab8b3db31d201c7db05920898db036d21b28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6hning?= Date: Fri, 7 Apr 2023 01:27:04 +0200 Subject: [PATCH 24/31] SquishTests: Update tst_CSUP06 Change-Id: Icbe7cae9b282dd125de46f8ba8bd265b9aa1054d Reviewed-by: Christian Stenger Reviewed-by: --- tests/system/suite_CSUP/tst_CSUP06/test.py | 41 +++++++++++++--------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/tests/system/suite_CSUP/tst_CSUP06/test.py b/tests/system/suite_CSUP/tst_CSUP06/test.py index 56e934db407..7682d1a6723 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') From 183cf3adc5da12702966ad3ff1a2a18014ed0acd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6hning?= Date: Thu, 20 Apr 2023 23:39:21 +0200 Subject: [PATCH 25/31] SquishTests: Make workaround permanent for Creator 10 The bug is fixed in master branch only. Task-number: QTCREATORBUG-28985 Change-Id: I5b1648e89a2ae61ce651ce6d2061fea58559d145 Reviewed-by: Reviewed-by: Christian Stenger --- tests/system/suite_QMLS/tst_QMLS04/test.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tests/system/suite_QMLS/tst_QMLS04/test.py b/tests/system/suite_QMLS/tst_QMLS04/test.py index 351b59ac638..2c96939151d 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 From 1fe7b77393d18f6ba0829d9ea640ef50017d4b4f Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Wed, 26 Apr 2023 13:39:41 +0200 Subject: [PATCH 26/31] SquishTests: Remove workarounds for closed issues Change-Id: If5f62b0f9013223643f016ce4e04932cca53397c Reviewed-by: Christian Stenger --- tests/system/suite_CSUP/tst_CSUP03/test.py | 4 ---- tests/system/suite_HELP/tst_HELP04/test.py | 3 +-- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/tests/system/suite_CSUP/tst_CSUP03/test.py b/tests/system/suite_CSUP/tst_CSUP03/test.py index 8667f3c2ac9..4e6f3e20995 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_HELP/tst_HELP04/test.py b/tests/system/suite_HELP/tst_HELP04/test.py index e4c0500d234..3fd63309ad3 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, "") 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), From 8482e2405e23c6ee65a8f4f60c10e05851396cf5 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Wed, 26 Apr 2023 14:47:02 +0200 Subject: [PATCH 27/31] FileInProjectFinder: Fix path analysis The previous code let to all possible paths to be accepted with maximum confidence. Fixes: QTCREATORBUG-29090 Change-Id: I3e0876d2fd1a5636dbe45cf152c8a251316185ff Reviewed-by: hjk Reviewed-by: Artem Sokolovskii Reviewed-by: Tim Jenssen --- src/libs/utils/fileinprojectfinder.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libs/utils/fileinprojectfinder.cpp b/src/libs/utils/fileinprojectfinder.cpp index f92cb70fa78..6ee3c34becd 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)) { From 65a1637d61b1c6432eec0ebd99094569911ede90 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Tue, 25 Apr 2023 17:01:11 +0200 Subject: [PATCH 28/31] CMakePM: Fix presets transitive inheritance Fixes: QTCREATORBUG-29076 Change-Id: Ibe4c3eebb3fcebeabafc485949a19e696ecad2de Reviewed-by: Reviewed-by: Alessandro Portale --- src/plugins/cmakeprojectmanager/cmakeproject.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index ecf3228d318..ae6e26f9e32 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -100,7 +100,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; }); From 7c1f2ea16d4b9050b3c15bf1ea2221daa0815902 Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii Date: Tue, 25 Apr 2023 16:04:30 +0200 Subject: [PATCH 29/31] ClangFormat: Fix autoindentation for QML_ and Q_ macros Fixes: QTCREATORBUG-29086 Change-Id: Ie23e46baf2c802799818cb724aacd71776480b06 Reviewed-by: Reviewed-by: Christian Kandeler --- src/plugins/clangformat/clangformatutils.cpp | 43 ++++++++++++++++--- .../clangformat/tests/clangformat-test.cpp | 10 ++++- 2 files changed, 46 insertions(+), 7 deletions(-) diff --git a/src/plugins/clangformat/clangformatutils.cpp b/src/plugins/clangformat/clangformatutils.cpp index 7ba6229db37..120e27fde7b 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 macros = {"Q_OBJECT", + static const std::vector 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 c5f77072e4b..80d2cc4da90 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{"class test {", " Q_OBJECT", "public:", "};"})); + (std::vector{"class test {", + " Q_OBJECT", + " QML_ELEMENT", + " QML_SINGLETON", + "public:", + "};"})); } void ClangFormatTest::testIndentInitializeVector() From 3aec6b776c163be922ebd22f6e07671962c118d8 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Tue, 25 Apr 2023 14:52:03 +0200 Subject: [PATCH 30/31] CMakePM: Fix presets condition with a const value Fixes: QTCREATORBUG-29077 Change-Id: If1ebaa22c07eaa39fb8d4f24c33f26249f17d793 Reviewed-by: Reviewed-by: Alessandro Portale --- src/plugins/cmakeprojectmanager/presetsparser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/presetsparser.cpp b/src/plugins/cmakeprojectmanager/presetsparser.cpp index ad4ab07fcb5..5ebd17fd630 100644 --- a/src/plugins/cmakeprojectmanager/presetsparser.cpp +++ b/src/plugins/cmakeprojectmanager/presetsparser.cpp @@ -82,7 +82,7 @@ std::optional parseCondition(const QJsonValue &jsonVa if (type == "const") { condition->type = type; - condition->constValue = object.value("const").toBool(); + condition->constValue = object.value("value").toBool(); return condition; } From 927c34df2f9a1acb9da12b41aff9ca28f1843df1 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 27 Apr 2023 08:03:48 +0200 Subject: [PATCH 31/31] Core: Fix item flag on locator settingspage Do not make the 'included by default' column editable as this would make the column act strange on double clicks. Instead of providing a non-functional change opportunity for the checkstate's value this is now handled similar to the double click on other columns. Change-Id: Id2851b2bfe2b7cda8c3231f58bf436196a533171 Reviewed-by: Eike Ziller --- src/plugins/coreplugin/locator/locatorsettingspage.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/coreplugin/locator/locatorsettingspage.cpp b/src/plugins/coreplugin/locator/locatorsettingspage.cpp index 9940680aa25..0193a791c37 100644 --- a/src/plugins/coreplugin/locator/locatorsettingspage.cpp +++ b/src/plugins/coreplugin/locator/locatorsettingspage.cpp @@ -85,7 +85,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: @@ -102,7 +102,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; }