eco*_*eco 1 python qt pyside qlineedit qpushbutton
我有一个 QLineEdit 字段和一个 QPushButton。只要 QLineEdit 为空,就应该禁用该按钮。
怎么做?
well, i'll just conclude what they said in the comments, some code like
self.btnButton.setDisable(True)
self.leInput.textChanged.connect(self.disableButton)
def disableButton(self):
if len(self.leInput.text()) > 0:
self.btnButton.setDisable(False)
Run Code Online (Sandbox Code Playgroud)
and yes, the signals / function names are obvious, you need to check more on the docs / tutor
| 归档时间: |
|
| 查看次数: |
6284 次 |
| 最近记录: |