From 3a27603e3d7c05b8223416181cb4e5603de5d5c0 Mon Sep 17 00:00:00 2001 From: Steveice10 <1269164+Steveice10@users.noreply.github.com> Date: Tue, 9 May 2023 02:30:06 -0700 Subject: [PATCH] qt: Clear finishing key combinations for hot key entry on Qt 6.5+ (#6509) --- src/citra_qt/util/sequence_dialog/sequence_dialog.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/citra_qt/util/sequence_dialog/sequence_dialog.cpp b/src/citra_qt/util/sequence_dialog/sequence_dialog.cpp index 0bba5348e7..72d99b6bb8 100644 --- a/src/citra_qt/util/sequence_dialog/sequence_dialog.cpp +++ b/src/citra_qt/util/sequence_dialog/sequence_dialog.cpp @@ -11,6 +11,10 @@ SequenceDialog::SequenceDialog(QWidget* parent) : QDialog(parent) { setWindowTitle(tr("Enter a hotkey")); key_sequence = new QKeySequenceEdit; +#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) + key_sequence->setMaximumSequenceLength(1); + key_sequence->setFinishingKeyCombinations({}); +#endif auto* const buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); buttons->setCenterButtons(true); @@ -26,8 +30,12 @@ SequenceDialog::SequenceDialog(QWidget* parent) : QDialog(parent) { SequenceDialog::~SequenceDialog() = default; QKeySequence SequenceDialog::GetSequence() { +#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) + return key_sequence->keySequence(); +#else // Only the first key is returned. The other 3, if present, are ignored. return QKeySequence(key_sequence->keySequence()[0]); +#endif } bool SequenceDialog::focusNextPrevChild(bool next) {