【发布时间】:2016-09-13 05:08:45
【问题描述】:
如何从QlineEdit 获得String(Text)?
我试过这样。
myArea.getList() 函数是获取字符串值并用字符串值检查数据库并返回列表
self.a = QLineEdit()
self.b = QlineEdit()
....
self.b = self.myArea.getList(str(self.a.textChanged.connect(self.textchanged)))
def textchanged(self, text):
self.my_edit = text
在a 中输入文本,然后a 更改。读取a,通过a检查数据,b创建的数据,在b输入文本,读取b,通过b检查数据
首先,我不知道如何获取QLineEdit() 的值。
print QLineEdit 文本有效但返回字符串。
【问题讨论】:
-
我不明白。什么是“my_edit”和“myArea”?您只需要在 textchanged 函数中返回值。
def textchanged(self, text):return text
标签: python pyqt pyside qlineedit