I wanted to simulate an installer situation where the user checks the I agree checkbox and then the next button will be active to push.
I thought that if I created a def that outputs a boolean data then I can use that data to change the QChechBox.setDisable(bool data), but I think I chose the wrong method to do such things.
This is my code:
layout = QHBoxLayout()
self.q = QCheckBox("I AGREE" , self)
self.q.setFont(QFont("Sofia Pro" , 22 , 600))
self.b = QPushButton("Next")
self.boolResult = self.boolFunc(self.q)
self.b.setDisabled(self.boolResult)
layout.addWidget(self.q)
layout.addWidget(self.b)
self.setLayout(layout)
def boolFunc(self , input):
temp = input.isChecked()
if temp == False:
return True
else:
return False
isChecked() function is not live, the function just checks the QCheckBox once.