I want to enable a combobox - which is disabled from the properties editor in Qt Designer - but, only if the user checks the checkbox. I wrote the following, but it is not working. It is put inside the __init__
method of my mainclass. Could you please help me to understand why?
if self.dlg.checkBox.isChecked():
self.dlg.cmbvectorLayer6.setEnabled(True)
EDIT:
I now have the following in the __init__
method of my main class:
self.dlg.checkBox.stateChanged[int].connect(self.enablecombo)
with enablecombo
being:
def enablecombo(self):
self.dlg.cmbvectorLayer6.setEnabled(True)
and it works fine in order to activate the comboboxes. But I am not sure how to do the equivalent in order to disactivate the comboboxes when the checkbox is unchecked...