From db1aabe3c22debb6e0240ad2d9f7ae953764c4e5 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 5 Jan 2024 00:29:36 -0500 Subject: [PATCH] Fix shortcuts editor clear buttons --- CHANGELOG.md | 1 + src/ui/multikeyedit.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c54f13de..ebdcd6f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ The **"Breaking Changes"** listed below are changes that have been made in the d ### Fixed - Fix the metatile selector rectangle jumping when selecting up or left of the origin. - Fix the event group tabs sometimes showing an event from the wrong group +- Fix the clear buttons in the Shortcuts Editor not actually removing shortcuts. - Fix API error reporting ## [5.2.0] - 2024-01-02 diff --git a/src/ui/multikeyedit.cpp b/src/ui/multikeyedit.cpp index 09943861..fcf38480 100644 --- a/src/ui/multikeyedit.cpp +++ b/src/ui/multikeyedit.cpp @@ -140,6 +140,14 @@ void MultiKeyEdit::addNewKeySequenceEdit() { connect(lineEdit, &QLineEdit::customContextMenuRequested, this, &MultiKeyEdit::customContextMenuRequested); + // Gross way to connect the line edit's clear button. + auto actions = lineEdit->findChildren(); + if (!actions.isEmpty()) { + connect(actions.first(), &QAction::triggered, this, [this, keySequenceEdit]() { + removeOne(keySequenceEdit->keySequence()); + }); + } + layout()->addWidget(keySequenceEdit); keySequenceEdit_vec.append(keySequenceEdit); }