在pyqt4 python中以编程方式编辑选项卡顺序 [英] programmatically edit tab order in pyqt4 python

查看:53
本文介绍了在pyqt4 python中以编程方式编辑选项卡顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的表单中有多个文本字段.我的问题是选项卡顺序错误.有没有办法在代码中编辑 Tab 键顺序?就像在 QT Designer 中一样.

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.

谢谢.

推荐答案

使用 QWidget.setTabOrder 改变小部件的标签顺序:

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)

注意 Tab 键顺序是如何从一个小部件链接到下一个小部件的.

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

这篇关于在pyqt4 python中以编程方式编辑选项卡顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆