作者MAGICXX (逢甲阿法)
看板Python
标题[问题] PyQt ComboBox连动问题
时间Sun Apr 21 22:53:59 2013
大家好 我有一点小问题想要请问一下大家
就是现在自己设计了一个UI
类似下面这个图
http://i.imgur.com/Dkaqu1B.jpg
然後我的type只要动的话 下面会有可以选 或者是不能选的情况发生
可是 我现在遇到的问题是
我在type=A的时候 把long跟point那两个Combobox Disable之後
当我的type改成B或者是C的时候 B跟C的long 跟point都会变成Disable的状况Orz
可是 我想要让他当type=B or C的时候可以选 long 跟 point(就是Enable的意思)
请问 我要从哪个地方去修改呢??
或者是 我该下哪个关键字 才可以在GOOGLE上找到答案呢= =?
感谢先进们的帮忙m(_ _ )m
--
◢███◣ 真是太令我兴奋了,教授BOY~~
█████
█▉◥█◤ 覆盖一张空白考卷在桌上 结束这学期
██ ◤ \
◤◤╲╰┤ ㊣ justlasai
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 36.231.16.137
1F:推 ya790206:去抓 combobox 的 currentIndexChanged signal吧 04/21 23:15
2F:→ uranusjr:要注意一个小问题, currentIndexChanged 有 overloading 04/21 23:41
3F:→ uranusjr:所以 connect 的时候要注意连到哪一个 04/21 23:45
所以是 我在UI转出来的.py下面去让他抓这个signal吗?
类似
def Signal_change:
if self.combobox_type.currentIndexChanged(0):
self.combobox_num.enable()
self.combobox_long.enable()
self.combobox_point.enable()
esif self.combobox_type.currentIndexChanged(1):
self.combobox_num.enable()
self.combobox_long.disable()
self.combobox_point.disable()
esif self.combobox_type.currentIndexChanged(2):
self.combobox_num.enable()
self.combobox_long.disable()
self.combobox_point.disable()
这样吗?因为不是很懂 所以先假设是这样写~@@
还是我可以在Designer下面的哪里设定
combobox_num
combobox_long
combobox_point
去抓combobox_type的index??
感谢回答的大大~@@
※ 编辑: MAGICXX 来自: 36.231.16.137 (04/21 23:59)
4F:→ uranusjr:你可能要有个人教你怎麽用 Qt Designer, 用写的很难解释 04/22 00:59
5F:→ uranusjr:如果你是纯用 code 倒是比较容易教你怎麽写... 04/22 01:00
6F:推 ck574b027:咦那个有overloading?有文件提到吗? 04/22 01:41