From 3fe7f99fa5750a09dd5531b2a025e1b3f58e4b59 Mon Sep 17 00:00:00 2001 From: Lioncache Date: Sun, 14 Dec 2025 00:09:01 -0500 Subject: [PATCH] CStringEditor: Fix capture of keyboard shortcuts in CStringEditor Previously, these keyboard shortcuts didn't work. --- src/Editor/StringEditor/CStringEditor.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Editor/StringEditor/CStringEditor.cpp b/src/Editor/StringEditor/CStringEditor.cpp index bdff122c..1b78c643 100644 --- a/src/Editor/StringEditor/CStringEditor.cpp +++ b/src/Editor/StringEditor/CStringEditor.cpp @@ -98,14 +98,14 @@ void CStringEditor::InitUI() mpListModel = new CStringListModel(this); mpUI->StringNameListView->setModel(mpListModel); mpUI->StringNameListView->setItemDelegate(new CStringDelegate(this)); - mpUI->AddStringButton->setShortcut(QKeySequence(Qt::Key_Alt, Qt::Key_Equal)); - mpUI->RemoveStringButton->setShortcut(QKeySequence(Qt::Key_Alt, Qt::Key_Minus)); + mpUI->AddStringButton->setShortcut(QKeySequence(Qt::ALT | Qt::Key_Equal)); + mpUI->RemoveStringButton->setShortcut(QKeySequence(Qt::ALT | Qt::Key_Minus)); // Register shortcuts - new QShortcut(QKeySequence(Qt::Key_Alt, Qt::Key_Down), this, [this] { IncrementStringIndex(); }); - new QShortcut(QKeySequence(Qt::Key_Alt, Qt::Key_Up), this, [this] { DecrementStringIndex(); }); - new QShortcut(QKeySequence(Qt::Key_Alt, Qt::Key_Right), this, [this] { IncrementLanguageIndex(); }); - new QShortcut(QKeySequence(Qt::Key_Alt, Qt::Key_Left), this, [this] { DecrementLanguageIndex(); }); + new QShortcut(QKeySequence(Qt::ALT | Qt::Key_Down), this, this, &CStringEditor::IncrementStringIndex); + new QShortcut(QKeySequence(Qt::ALT | Qt::Key_Up), this, this, &CStringEditor::DecrementStringIndex); + new QShortcut(QKeySequence(Qt::ALT | Qt::Key_Right), this, this, &CStringEditor::IncrementLanguageIndex); + new QShortcut(QKeySequence(Qt::ALT | Qt::Key_Left), this, this, &CStringEditor::DecrementLanguageIndex); // Set up language tabs mpUI->EditLanguageTabBar->setExpanding(false);