在 pyqt 中禁用 QComboBox [英] Disabling QComboBox in pyqt
本文介绍了在 pyqt 中禁用 QComboBox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以在 pyqt 中禁用 QComboBox
,就像我们可以在 Win Forms(C#) 中那样,因为我在 QComboBox
手册中找不到任何选项.我只想在管理员登录时启用 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.
推荐答案
我找到了问题的答案,
QComboBox.setEnabled(False) # disable comboBox
和
QComboBox.setEnabled(True) # enable comboBox
这篇关于在 pyqt 中禁用 QComboBox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文