If your control can't fetch keyboard focus in Qt Quick......

Use forceActiveFocus() method.

To get the keyboard focus, you have to set focus:true from the very root of all visual parents the control is attached. If the structure becomes complicated, you have no idea on where to "power on" and where not. In that case, use forceActiveFocus() to make any necessary attribute changes at once.

Man I had to throw away yesterday not knowing this. OTL

No comments:

Post a Comment

블로그를 이전합니다

뭐, 이런 작은 변방의 블로그에 관심있으신 분들은 아무도 없으시리라 생각합니다만...... (웃음) 블로그 플랫폼을 블로거에서 dev.to로 옮겼습니다. 새 URL은 아래와 같습니다: https://dev.to/teminian 새로운 거처에서 뵙겠습니...

Popular in Code{nested}