Unfocus field and hide keyboard when click in blank part of dialog

This commit is contained in:
David Rowe 2016-09-24 17:34:02 +12:00
parent 52137cb3c1
commit 8663455d01
2 changed files with 9 additions and 2 deletions

View file

@ -109,8 +109,13 @@ Column {
}
MouseArea {
// Events are propogated so that any active control is defocussed.
anchors.fill: parent
onClicked: toggleCollapsed()
propagateComposedEvents: true
onClicked: {
toggleCollapsed();
mouse.accepted = false;
}
}
}

View file

@ -133,7 +133,9 @@ Fadable {
hoverEnabled: true
acceptedButtons: Qt.AllButtons
enabled: window.visible
onClicked: {}
onClicked: {
frame.forceActiveFocus(); // Defocus any current field so that the keyboard gets hidden.
}
onDoubleClicked: {}
onPressAndHold: {}
onReleased: {}