9

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.

AAEM
  • 1,837
  • 2
  • 18
  • 26
prattom
  • 1,625
  • 11
  • 42
  • 67

2 Answers2

14

I found the answer to my question,

QComboBox.setEnabled(False) # disable comboBox

and

QComboBox.setEnabled(True) # enable comboBox 
eyllanesc
  • 235,170
  • 19
  • 170
  • 241
prattom
  • 1,625
  • 11
  • 42
  • 67
2

You can also do :

QComboBox.setDisabled(True)
QComboBox.setDisabled(False)
Dariusz
  • 960
  • 13
  • 36