mirror of
https://git.h3cjp.net/H3cJP/citra.git
synced 2024-12-26 05:06:43 +00:00
qt: Clear finishing key combinations for hot key entry on Qt 6.5+ (#6509)
This commit is contained in:
parent
b9d644b777
commit
3a27603e3d
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue