mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-01 18:07:05 -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)
|
bool DialogyWidget::clickButton(QDialogButtonBox::StandardButton standardButton)
|
||||||
{
|
{
|
||||||
QPushButton* pb = qobject_cast<QPushButton*>(focusWidget());
|
QPushButton* pb;
|
||||||
if (pb && pb->isVisible() && pb->isEnabled() && pb->hasFocus()) {
|
|
||||||
pb->click();
|
if (standardButton == QDialogButtonBox::Ok) {
|
||||||
return true;
|
pb = qobject_cast<QPushButton*>(focusWidget());
|
||||||
|
if (pb && pb->isVisible() && pb->isEnabled() && pb->hasFocus()) {
|
||||||
|
pb->click();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QDialogButtonBox*> buttonBoxes = findChildren<QDialogButtonBox*>();
|
QList<QDialogButtonBox*> buttonBoxes = findChildren<QDialogButtonBox*>();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue