From f00394b371c1b5663971b853d22ebf54f0a175be Mon Sep 17 00:00:00 2001 From: David Schulz Date: Thu, 30 May 2024 13:41:30 +0200 Subject: [PATCH 1/2] TextEditor: avoid setting a null cursor on select all Change-Id: If7ccdf1e1d4846b279305e30d3a990754f942128 Reviewed-by: Christian Stenger --- src/plugins/texteditor/texteditor.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index bea58df3c88..7b066c7bdc7 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -986,6 +986,8 @@ void TextEditorWidgetFind::selectAll(const QString &txt, FindFlags findFlags) if (future.resultCount() <= 0) return; const SearchResultItems &results = future.result(); + if (results.isEmpty()) + return; const auto cursorForResult = [this](const SearchResultItem &item) { return selectRange(m_editor->document(), item.mainRange()); }; From 81aed65406a0b379ed28c970bc8ddc29355aae09 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 30 May 2024 14:40:07 +0200 Subject: [PATCH 2/2] Meson: Fix crash after adding first meson/ninja tools - start Qt Creator without any meson or ninja tools registered (also not auto-detected) - add meson and ninja in the settings and apply - open kit settings and select a kit This would crash, because the constructor of the meson ToolKitAspectWidget saw that there was no tool registered and triggered setting the default tool. Doing that in the widget constructor results in an endless loop because changing the tool triggers an update of the kit which triggers an update of the ToolKitAspectWidget which doesn't exist yet (because the constructor didn't finish yet), so it would be created again which results in the same situation and endless recursion. Do not change the selected value in the widget constructor. This is the same logic as for the CMakeKitAspect(Impl). Fixes: QTCREATORBUG-30698 Change-Id: I35d56018d8f02a2716dfac763fa86d4426393172 Reviewed-by: Christian Kandeler --- src/plugins/mesonprojectmanager/toolkitaspectwidget.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/plugins/mesonprojectmanager/toolkitaspectwidget.h b/src/plugins/mesonprojectmanager/toolkitaspectwidget.h index 252e351ff71..54e54388a41 100644 --- a/src/plugins/mesonprojectmanager/toolkitaspectwidget.h +++ b/src/plugins/mesonprojectmanager/toolkitaspectwidget.h @@ -49,11 +49,7 @@ private: return MesonToolKitAspect::mesonToolId(m_kit); return NinjaToolKitAspect::ninjaToolId(m_kit); }(); - if (id.isValid()) - m_toolsComboBox->setCurrentIndex(indexOf(id)); - else { - setToDefault(); - } + m_toolsComboBox->setCurrentIndex(indexOf(id)); } QComboBox *m_toolsComboBox;