fix: genKey binding and focus

This commit is contained in:
Jonathan Rainville 2020-06-01 10:36:06 -04:00 committed by Iuri Matias
parent 545bb751c1
commit 9fc93b8db2
2 changed files with 5 additions and 5 deletions

View File

@ -7,12 +7,14 @@ import "../shared"
import "../imports" import "../imports"
SwipeView { SwipeView {
property alias btnGenKey: btnGenKey
id: swipeView id: swipeView
anchors.fill: parent anchors.fill: parent
currentIndex: 0 currentIndex: 0
onCurrentItemChanged: { onCurrentItemChanged: {
currentItem.txtPassword.focus = true currentItem.txtPassword.textField.focus = true
} }
Item { Item {
@ -135,9 +137,8 @@ SwipeView {
anchors.leftMargin: Theme.padding anchors.leftMargin: Theme.padding
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
otherProps: {
this.textField.focus = true Component.onCompleted: {
this.textField.focus
this.textField.echoMode = TextInput.Password this.textField.echoMode = TextInput.Password
} }
Keys.onReturnPressed: { Keys.onReturnPressed: {

View File

@ -17,7 +17,6 @@ Item {
inputValue.forceActiveFocus(Qt.MouseFocusReason) inputValue.forceActiveFocus(Qt.MouseFocusReason)
} }
readonly property int labelMargin: 7 readonly property int labelMargin: 7
property var otherProps // Only used to assign stuff to textField
id: inputBox id: inputBox
height: inputRectangle.height + (hasLabel ? inputLabel.height + labelMargin : 0) height: inputRectangle.height + (hasLabel ? inputLabel.height + labelMargin : 0)