Hi everyOne

I have a mainWindow : Authentication.qml that contains an instance of User.qml and Admin.qml

Authentication.qml
Qt Code:
  1. Window{
  2. id: root
  3. ...
  4.  
  5. TextInputMod{
  6. id: textinputmod1
  7. focus: true
  8. ... }
  9.  
  10. TextInputMod{
  11. id: textinputmod
  12. ...}
  13.  
  14. MouseArea{
  15. ...
  16. onClicked: {
  17. if(change.text=="ADMIN") stackId.push(pageAdmin)
  18. if(change.text=="USER") stackId.push(pageUser)
  19. }
  20.  
  21.  
  22. StackView{
  23. id: stackId
  24. ...
  25.  
  26. Component {
  27. id: pageAdmin
  28. Admin{
  29. }
  30. }
  31. Component {
  32. id: pageUser
  33. User{
  34. }
  35. }
To copy to clipboard, switch view to plain text mode 

Authentication.qml contains a TextInputMod (custom model) : TextInputMod{ focus: true ... } ---> focus works well
but for User.qml and Admin.qml that contain also a TextInputMod : TextInputMod{ focus: true ... } ---> focus don't work

Why? Because stackView !!!
Any solution?

Cheers,