Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/347.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/6.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 如何确定信号是否连接到任何东西_Python_Qt_Pyqt_Signals_Slot - Fatal编程技术网

Python 如何确定信号是否连接到任何东西

Python 如何确定信号是否连接到任何东西,python,qt,pyqt,signals,slot,Python,Qt,Pyqt,Signals,Slot,有没有办法判断信号是否已连接到函数 i、 e我想看看signals.siSelectionChange是否连接到任何东西 signals.siSelectionChange.connect( self.SelAsSiAssets ) 可以使用获取连接函数的计数。我使用它如下,在QWidget的closeEvent()中,我使用它作为窗口: receiversCount = self.receivers(QtCore.SIGNAL("siSelectionChanged()"))

有没有办法判断信号是否已连接到函数

i、 e我想看看signals.siSelectionChange是否连接到任何东西

signals.siSelectionChange.connect( self.SelAsSiAssets )
可以使用获取连接函数的计数。我使用它如下,在QWidget的
closeEvent()
中,我使用它作为窗口:

    receiversCount = self.receivers(QtCore.SIGNAL("siSelectionChanged()"))
    if receiversCount > 0:
        self.sigChanged.disconnect()
请注意,参数字符串中的签名必须与实际签名匹配