How to exclude a widget from tab-ordering list?

雨燕双飞 提交于 2019-12-10 01:54:36

问题


(This picture is from Qt official site, and I take it as an example.)

I'd like to escape some unimportant widgets from being tab-focused.

(This strategy is useful if you have a widget that you want to quickly rotate between some commonly used QLineEdit to enter data and escape those rarely used settings.)

Take the picture as an example, is it possible to exclude Width and Height from tab-ordering list so I can use Tab to rotate only between Name, Color depth, OK and Cancel? I've searched the document and didn't find the option to remove widgets from tab-ordering list.


回答1:


Change the focus policy of your widgets that you don't want in the tab order list.

The policy is Qt::TabFocus if the widget accepts keyboard focus by tabbing.

You will have to set it to Qt::ClickFocus or Qt::NoFocus to remove it from the tab order list.

See what different focus policies do here.



来源:https://stackoverflow.com/questions/23953143/how-to-exclude-a-widget-from-tab-ordering-list

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!