0

I have a PyQt5 application with 2 windows. After a certain event in window #1 I want to uncheck a checkbox in window #2 using a pyqtSignal if it is possible. This is what I have so far: 2nd window:

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) 

in the main window:

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

I get an error after this: TypeError: argument 1 has unexpected type 'NoneType'

3
  • use worker.box_update.connect(win2.disable_box) Commented May 12, 2021 at 23:39
  • thanks error is gone, and if put print("test") in the disable_box function, it prints fine, but the checkbox is not reacting to anything. setChecked, setDisable I tried these so far and nothing. Commented May 13, 2021 at 0:04
  • Without a minimal reproducible example it is impossible to help you. Commented May 13, 2021 at 0:17

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.