Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/358.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 有没有办法锁定组合框PyQt?_Python_Combobox_Pyqt5 - Fatal编程技术网

Python 有没有办法锁定组合框PyQt?

Python 有没有办法锁定组合框PyQt?,python,combobox,pyqt5,Python,Combobox,Pyqt5,我目前正在使用GUI,我想锁定一个组合框,直到激活一个单选按钮。 我阅读了这个链接中的函数:但是我还没有找到任何东西 下面是我已经制作的屏幕: 基本上我想要的是:在选中“Jusqu'au…”之前,我们不能在两个组合框中选择任何内容 编辑: 以下是我已经写过的: class主窗口(qtw.QMainWindow,Ui\u主窗口): 定义初始化(自): super()。\uuuu init\uuuuu() ''' 一些代码 ''' self.totalChronique.clicked.conne

我目前正在使用GUI,我想锁定一个组合框,直到激活一个单选按钮。 我阅读了这个链接中的函数:但是我还没有找到任何东西

下面是我已经制作的屏幕:

基本上我想要的是:在选中“Jusqu'au…”之前,我们不能在两个组合框中选择任何内容

编辑: 以下是我已经写过的:

class主窗口(qtw.QMainWindow,Ui\u主窗口):
定义初始化(自):
super()。\uuuu init\uuuuu()
'''
一些代码
'''
self.totalChronique.clicked.connect(self.lock_组合框)#按钮“toute la chronique”
self.selectTime.clicked.connect(self.unlock#u组合框)#按钮“Jusqu'au…”
def unlock_组合框(自):
self.comboDay.setEnabled(True)#组合框“jours”
self.comboMonth.setEnabled(True)#组合框“mois”
def lock_组合框(自):
self.comboDay.setEnabled(False)
self.comboMonth.setEnabled(False)

谢谢你的提示

使用setEnabled(False)效果很好

你就不能使用
setEnabled(False)
吗?我已经试过了,但没用了,我做过了,没用,我又写了一次,我想我写错了。。谢谢