以单行文本框为例 # 获取文本框中的内容 self.lineEdit.text() #设置内容 self.lineEdit.setText() # 清空文本框中的内容就可以通过设置内容为空就行了 self.lineEdit.setText("")
以单行文本框为例