Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt focus changing order

Tags:

focus

qt

For example we have a groupbox with some amount of lineEdits.
When user press Tab focus from one lineEdit changed to other.
How to make focus change in the specific order?
In my Dialog focus changed in a very strange way.
For example cursor jumps this way 1 3 2 4 lineEdits. I want to make it jumping 1 2 3 4 lineEdits
I think that the order is such because I added this line edits in such order...but remaking all GUI is not a solution for me...

like image 643
Ruslan F. Avatar asked Oct 30 '25 16:10

Ruslan F.


1 Answers

In the designer you should select Edit->Edit Tab Order (blue numbers will appear). Then you should click on your widgets in the order you want them to be (numbers will change). After you are done, you should select Edit->Edit Widgets (or press F3).

If you are not using designer, use:

void QWidget::setTabOrder ( QWidget *first, QWidget *second );
like image 119
Amartel Avatar answered Nov 01 '25 13:11

Amartel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!