Auto-set focus on keybind dialog

This commit is contained in:
=
2025-04-19 20:04:00 -07:00
parent f199fa5ce4
commit 34620f3246
5 changed files with 7 additions and 4 deletions

View File

@@ -65,6 +65,7 @@ KeyBinder::KeyBinder(QWidget *parent)
singleKeySequenceEdit *seq = new singleKeySequenceEdit();
ui->formLayout->addRow(seq);
seq->setObjectName("keySequence");
this->setTabOrder(seq, ui->buttonBox);
}
KeyBinder::~KeyBinder()
@@ -72,6 +73,11 @@ KeyBinder::~KeyBinder()
delete ui;
}
void
KeyBinder::showEvent( QShowEvent* event ) {
QWidget::showEvent( event );
this->findChild<QKeySequenceEdit*>()->setFocus();
}
bool KeyBinder::eventFilter(QObject *obj, QEvent *event)
{

View File

@@ -27,6 +27,7 @@ public:
private:
Ui::KeyBinder *ui;
bool eventFilter(QObject *obj, QEvent *event);
void showEvent( QShowEvent* event );
};
#endif // QT_KeyBinder_HPP

View File

@@ -1079,7 +1079,6 @@ MainWindow::on_actionSettings_triggered()
case QDialog::Accepted:
settings.save();
config_changed = 2;
printf("about to try\n");
updateShortcuts();
pc_reset_hard();
break;

View File

@@ -74,7 +74,6 @@ SettingsInput::SettingsInput(QWidget *parent)
// Make a working copy of acc_keys so we can check for dupes later without getting
// confused
printf("Instantiating list\n");
for(int x=0;x<NUM_ACCELS;x++) {
strcpy(acc_keys_t[x].name, acc_keys[x].name);
strcpy(acc_keys_t[x].desc, acc_keys[x].desc);