
Originally Posted by
anda_skoa
What does "focus don't work" mean in this context?
_
TextInputMod doesn't focus, I want to focus It when I push pageUser or pageAdmin
All Authentication.qml, User.qml and Admin.qml contain some TextInputMod
I want to focus the 1st TextInputMod in each .qml
Authentication.qml
Window{
id: root
...
TextInputMod{
id: textinputmod1
focus: true // FOCUS OK
... }
TextInputMod{
id: textinputmod
...}
MouseArea{
...
onClicked: {
if(change.text=="ADMIN") stackId.push(pageAdmin)
if(change.text=="USER") stackId.push(pageUser)
}
StackView{
id: stackId
...
Component {
id: pageAdmin
Admin{
}
}
Component {
id: pageUser
User{
}
}
Window{
id: root
...
TextInputMod{
id: textinputmod1
focus: true // FOCUS OK
... }
TextInputMod{
id: textinputmod
...}
MouseArea{
...
onClicked: {
if(change.text=="ADMIN") stackId.push(pageAdmin)
if(change.text=="USER") stackId.push(pageUser)
}
StackView{
id: stackId
...
Component {
id: pageAdmin
Admin{
}
}
Component {
id: pageUser
User{
}
}
To copy to clipboard, switch view to plain text mode
When I push User or Admin.qml ---> TextInputMod doesn't focus
User.qml
TextInputMod{
id: input1
width: 167
height: 30
focus: true // FOCUS FAILS
KeyNavigation.tab: input2
}
TextInputMod{
id: input1
width: 167
height: 30
focus: true // FOCUS FAILS
KeyNavigation.tab: input2
}
To copy to clipboard, switch view to plain text mode
Cheers,
Bookmarks