password prompt: input focus, accept on enter

This commit is contained in:
Dag Heyman 2017-03-13 15:37:40 +01:00
parent 0bc6c65397
commit f6af80c3e3
No known key found for this signature in database
GPG Key ID: 06FC004369E7D338

View File

@ -19,7 +19,9 @@ DefaultDialog {
TextField {
id: password
echoMode: TextInput.Password
focus: true
Layout.fillWidth: true
onAccepted: promptAccepted()
}
}
RowLayout {
@ -33,7 +35,7 @@ DefaultDialog {
Button {
text: qsTr("Ok")
Layout.alignment: Qt.AlignRight | Qt.AlignBottom
onClicked: {close(); accepted()}
onClicked: promptAccepted()
}
Button {
text: qsTr("Cancel")
@ -42,6 +44,11 @@ DefaultDialog {
}
}
function promptAccepted() {
close();
accepted()
}
function clear() {
password.text = ''
}