0

我有一个带有 2 个窗口的 PyQt5 应用程序。在窗口 #1 中的某个事件之后,如果可能的话,我想使用 pyqtSignal 取消选中窗口 #2 中的复选框。这是我到目前为止所拥有的:第二个窗口:

class AnotherWindow(QWidget):
    def __init__(self):
        super().__init__()
        self.setFixedSize(600, 600)
        self.box = QCheckBox('some text', self)

    def disable_box(self):
        self.box.setChecked(False)

在主窗口中:

win2 = AnotherWindow()
worker.box_update.connect(win2.disable_box())

在此之后出现错误:TypeError: argument 1 has unexpected type 'NoneType'

4

0 回答 0