Fix shortcuts editor clear buttons

This commit is contained in:
GriffinR 2024-01-05 00:29:36 -05:00
parent 941174d0ea
commit db1aabe3c2
2 changed files with 9 additions and 0 deletions

View file

@ -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

View file

@ -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<QAction*>();
if (!actions.isEmpty()) {
connect(actions.first(), &QAction::triggered, this, [this, keySequenceEdit]() {
removeOne(keySequenceEdit->keySequence());
});
}
layout()->addWidget(keySequenceEdit);
keySequenceEdit_vec.append(keySequenceEdit);
}