Qt: tab definition programmatically

I created 2 widgets with Desinger (Widget1 and Widget2), each of which has a specific tab order. The third widget (Widget3) is defined programmatically and contains the above 2 widgets in a vertical layout. In on a symbian not touching the device. When I focus on widget3, I want to focus on widget1. Then go from widget1 to widget2 with the phone arrow when I get to the end of the widget1 tab chain. What is the right way to do this?

+4
source share
2 answers

From Qt Documentation to,

void QWidget::setTabOrder ( QWidget * first, QWidget * second ) [static] 

which states that after the <<strong> first widget in focus order it places the second widget .

So, for you, the first widget will be your Widget3 , and the second widget will be your Widget1 . (if I understood the question correctly)

In addition, there are examples of using this function in the link above. You can use it.

Hope this helps.

+4
source

You can also use the default tab order specified in the element construction order. So just edit the .ui XML file:

 <item> ... //Automatically assign with tab order X </item> <item> ... //Automatically assign with tab order X+1 </item> 

In the order you want the tab order to be.

0
source

Source: https://habr.com/ru/post/1316526/


All Articles