I do not understand why it does not work properly. I want to set TextEdit focus to true when the window pops out. TextEdit can receive key events only after a click has been performed on its area.
main.qml
ApplicationWindow {
id:aplWin
visible: true
minimumWidth: 1280
minimumHeight: 1024
StackView {
id: stackView
anchors.fill: parent
initialItem: SignInWin {}
}
}
SignInWin.qml
Page {
id: root
width: parent.width + 500
height: parent.height
Rectangle {
border.color: "black"
y: 200
width: 50
height: 20
z: 1
TextEdit {
anchors.fill: parent
color: "black"
focus: true
}
}
}
forceActiveFocus()whenComponent.onComplete- derM