prattom
prattom

Reputation: 1743

Disabling QComboBox in pyqt

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.

Upvotes: 11

Views: 18028

Answers (2)

prattom
prattom

Reputation: 1743

I found the answer to my question,

QComboBox.setEnabled(False) # disable comboBox

and

QComboBox.setEnabled(True) # enable comboBox 

Upvotes: 15

Dariusz
Dariusz

Reputation: 1054

You can also do :

QComboBox.setDisabled(True)
QComboBox.setDisabled(False)

Upvotes: 3

Related Questions