It's focus event,not hover!

本文介绍在没有标准PC键盘和鼠标的嵌入式设备上如何通过物理键盘(如8x8矩阵键盘)来控制GUI元素间的焦点移动。重点讨论了如何在Qt中实现按钮的高亮显示以指示当前焦点位置。

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.



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值