From 322dcd2c456dffeac1bf24496af77030776893f7 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 13 Feb 2024 17:00:04 +0100 Subject: [PATCH] CppEditor: Re-add function decl/def switch handler Was accidentally removed in 3771eb196b066314d427d7343cb1d4c6e2c5d6a4. Fixes: QTCREATORBUG-30363 Change-Id: Ifef1266b144d2eb5b7b69ff3e721f781b4455e96 Reviewed-by: hjk --- src/plugins/cppeditor/cppeditorplugin.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/cppeditor/cppeditorplugin.cpp b/src/plugins/cppeditor/cppeditorplugin.cpp index b68c739f82e..c9185e372c1 100644 --- a/src/plugins/cppeditor/cppeditorplugin.cpp +++ b/src/plugins/cppeditor/cppeditorplugin.cpp @@ -323,6 +323,10 @@ void CppEditorPlugin::addPerSymbolActions() switchDeclDef.setTouchBarText(Tr::tr("Decl/Def", "text on macOS touch bar")); switchDeclDef.addToContainers(menus, Constants::G_SYMBOL); switchDeclDef.addToContainer(Core::Constants::TOUCH_BAR, Core::Constants::G_TOUCHBAR_NAVIGATION); + switchDeclDef.addOnTriggered(this, [] { + if (CppEditorWidget *editorWidget = currentCppEditorWidget()) + editorWidget->switchDeclarationDefinition(/*inNextSplit*/ false); + }); ActionBuilder openDeclDefSplit(this, Constants::OPEN_DECLARATION_DEFINITION_IN_NEXT_SPLIT); openDeclDefSplit.setText(Tr::tr("Open Function Declaration/Definition in Next Split"));