Change 'tab order' of elements in Qt Designer

Viewed 268

I'm creating my first widget app in Qt Creator on Linux with C++. I have a basic form shown here: Basic form:
Basic form

Watch the GIF to see how pressing TAB goes in the order I created the elements, not in the desired order from top to bottom. App GIF:
App GIF

This is because I created the lowest text edit first, then the button next to it, then the text edit above it, etc. By default, the tab order is in the same order as the elements were created.

In HTML and other languages/application IDEs you can change the tab index property to override the default. So the first element is selected and every time the user presses TAB it proceeds in the correct order. How can I do that in Qt Creator with C++?

I checked the properties and functions for each element but didn't find anything useful. I also did a quick search online that didn't yield anything promising.

1 Answers

I found a built-in way to do this after (too much) research. In the Qt-Designer one of the little breadcrumbs at the top of the designer is "Edit Tab Order". See the image here: Edit tab order:
Edit tab order.

This brings up a GUI where you can change the tab order for the entire form easily.

Related