mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-15 17:27:43 -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)
|
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…
Reference in New Issue
Block a user