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
Life of a programmer with business major, with no formal programming education experience at all. :P
Qt Quick에서 뭔 짓을 해도 컨트롤이 키보드 포커스를 가져오지 못한다면......
forceActiveFocus() method를 사용하면 됩니다.
원래 키보드 포커스는 visual parent에서 해당 컨트롤의 모든 부모계통 컨트롤이 속성을 focus: true로 놓도록 설정되어야 잡히는데, 구조가 복잡해지면 어느게 어느거고 어떻게 영향을 받는지 감이 안 잡히는 상황이 발생합니다. 이때 forceActiveFocus()를 사용하면 필요한 부분을 다 알아서 자동으로 바꿔줍니다.
......이거 몰라서 어제 하루 날려먹었네요. OTL
원래 키보드 포커스는 visual parent에서 해당 컨트롤의 모든 부모계통 컨트롤이 속성을 focus: true로 놓도록 설정되어야 잡히는데, 구조가 복잡해지면 어느게 어느거고 어떻게 영향을 받는지 감이 안 잡히는 상황이 발생합니다. 이때 forceActiveFocus()를 사용하면 필요한 부분을 다 알아서 자동으로 바꿔줍니다.
......이거 몰라서 어제 하루 날려먹었네요. OTL
Subscribe to:
Posts (Atom)
PostgreSQL vs. SQLite: read & write in multithreaded environment
The start was humble. I needed to cache some data, and I thought just push them to database table and give index, and the rest will be datab...
Popular in Code{nested}
-
Unlike libssh, which uses cmake, libssh2 forces you to use Linux-like environment even in Windows, which eventually makes you to install MSY...
-
Net-SNMP는 거의 모든 리눅스 배포본에서 표준 SNMP 관리자로 사용되고 있는, 사실상의 표준이라고 할 수 있는 범용적인 도구입니다. 이번에 기회가 있어서 SNMP Trap 메시지를 받아서 처리는 도구를 만들게 되었는데, 개발중 중요하다고 생각되...
-
2019년 6월 19일부로 Qt 5.13.0이 발표 되었습니다. Qt 5.13.0의 새로운 기능 중에서 제 눈길을 꽤 끈 신기능이 하나 있었는데요....... Qt for WebAssembly 입니다. 그러니까...... Emscripten 을 사용해...