buttons: first focus, than emit clicked() signal
Otherwise a client wanting to give another QML component the focus in reaction to a clicked button has no chance doing so because the button will steal the focus again right after the event handler has finished executing. REVIEW: 104893
This commit is contained in:
parent
26e1276738
commit
5b567230e6
@ -123,8 +123,8 @@ Item {
|
||||
button.checked = !button.checked
|
||||
}
|
||||
|
||||
button.clicked()
|
||||
button.forceActiveFocus()
|
||||
button.clicked()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -128,7 +128,6 @@ Item {
|
||||
button.checked = !button.checked
|
||||
}
|
||||
|
||||
button.clicked()
|
||||
if (button.KeyNavigation.tab || button.KeyNavigation.backtab) {
|
||||
// Only focus the button if it is set up for keyboard
|
||||
// navigation. This avoid getting a strange focus frame around
|
||||
@ -136,6 +135,7 @@ Item {
|
||||
// a toolbar.
|
||||
button.forceActiveFocus();
|
||||
}
|
||||
button.clicked()
|
||||
|
||||
if (defaultAction) {
|
||||
defaultAction.trigger()
|
||||
|
Loading…
Reference in New Issue
Block a user