mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-22 22:40:55 -04: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
1 changed files with 8 additions and 4 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue