Question

Is it possible to disable QComboBox in pyqt like we can do it in Win Forms(C#) since I could not find any option in the QComboBox manual. I want to enable QcomboBox only when admin logins.

Était-ce utile?

La solution

I found the answer to my question,

QComboBox.setEnabled(False) # disable comboBox

and

QComboBox.setEnabled(True) # enable comboBox 

Autres conseils

You can also do :

QComboBox.setDisabled(True)
QComboBox.setDisabled(False)
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top