mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-15 09:17:28 -05:00
Only try to click the focused button when pressing enter.
It makes no sense when pressing the escape button.
This commit is contained in:
parent
0cbf59209b
commit
41162ea2e8
@ -60,10 +60,14 @@ void DialogyWidget::keyPressEvent(QKeyEvent* e)
|
||||
|
||||
bool DialogyWidget::clickButton(QDialogButtonBox::StandardButton standardButton)
|
||||
{
|
||||
QPushButton* pb = qobject_cast<QPushButton*>(focusWidget());
|
||||
if (pb && pb->isVisible() && pb->isEnabled() && pb->hasFocus()) {
|
||||
pb->click();
|
||||
return true;
|
||||
QPushButton* pb;
|
||||
|
||||
if (standardButton == QDialogButtonBox::Ok) {
|
||||
pb = qobject_cast<QPushButton*>(focusWidget());
|
||||
if (pb && pb->isVisible() && pb->isEnabled() && pb->hasFocus()) {
|
||||
pb->click();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
QList<QDialogButtonBox*> buttonBoxes = findChildren<QDialogButtonBox*>();
|
||||
|
Loading…
Reference in New Issue
Block a user