Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to exclude a widget from tab-ordering list?

enter image description here

(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.

like image 436
Tay2510 Avatar asked May 30 '14 11:05

Tay2510


1 Answers

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.

like image 150
thuga Avatar answered Sep 20 '22 00:09

thuga