Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

programmatically edit tab order in pyqt4 python

Tags:

python

pyqt4

I have a multiple textfield in my form. My problem is the tab order is wrong. Is there a way to edit tab order in code? Just like in QT Designer.

thanks.

like image 964
unice Avatar asked Feb 21 '12 01:02

unice


1 Answers

Use QWidget.setTabOrder to change the tab order of widgets:

self.setTabOrder(self.textboxA, self.textboxB)
self.setTabOrder(self.textboxB, self.textboxC)
self.setTabOrder(self.textboxC, self.textboxD)

Note how the tab order is linked from one widget to the next.

like image 99
ekhumoro Avatar answered Nov 15 '22 05:11

ekhumoro