In some embedded device,there is no need to use standard PC keyboard and mouse.
In general,we connect a physical key pad,such as 8x8 matrix keypad.In this situation,we'd like to control the focus
move through the GUI's elements.
////////////////////////////////////////////////////////////////////////////////////////////
Beijing YanTai QingDao
Shanghai GuangDong ShenZhen
////////////////////////////////////////////////////////////////////////////////////////////
Here,the main interface has six buttons,we want to move cursor from top to bottom and from left to right,this action can choose the current item,then we press the 'Okay' key to enter next screen.
In such situation,we should to make the current item is highlight than others.In Qt,we use focusIn and focusOut event.
The button changes its background color when it has focusIn and changes back when it lost the focus.
Following pictures are shown this purpose,captured from web pages.
Enjoy them,guys!
By zhangshaoyan at May 20,2015.
本文介绍在没有标准PC键盘和鼠标的嵌入式设备上如何通过物理键盘(如8x8矩阵键盘)来控制GUI元素间的焦点移动。重点讨论了如何在Qt中实现按钮的高亮显示以指示当前焦点位置。

被折叠的 条评论
为什么被折叠?



