Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disabling QComboBox in pyqt

Tags:

pyqt

qcombobox

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.

like image 572
prattom Avatar asked Dec 09 '13 10:12

prattom


2 Answers

I found the answer to my question,

QComboBox.setEnabled(False) # disable comboBox

and

QComboBox.setEnabled(True) # enable comboBox 
like image 182
prattom Avatar answered Nov 08 '22 19:11

prattom


You can also do :

QComboBox.setDisabled(True)
QComboBox.setDisabled(False)
like image 20
Dariusz Avatar answered Nov 08 '22 19:11

Dariusz