문제

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.

도움이 되었습니까?

해결책

I found the answer to my question,

QComboBox.setEnabled(False) # disable comboBox

and

QComboBox.setEnabled(True) # enable comboBox 

다른 팁

You can also do :

QComboBox.setDisabled(True)
QComboBox.setDisabled(False)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top