I'm a beginner in PyQt and I made a FORMULAR. self.tName1, self.tlName1, self.tCel, self.tCel1,self.tcc1, self.tEmail, self.tTel are QLineEdit and I put all these variables in a list. Then, I made a for loop in order to evaluate each QLineEdit value and fill them if they are empty with 'NULL'. The loop works well but I'm trying to print all the values inside the list. For example: ['NULL','NULL','3176797100','NULL','NULL','1098685161','mm@gmail.com', 'NULL'] but it doesn't work.
self.tName1 = QtGui.QLineEdit(self)
self.tName1.move(85,176)
self.tName1.resize(199,30)
self.tlName1 = QtGui.QLineEdit(self)
self.tlName1.move(95,210)
self.tlName1.resize(190,30)
def eval(self):
var=[self.tName1, self.tlName1, self.tCel, self.tCel1,self.tcc1, self.tEmail, self.tTel]
i=0
for i in range(len(var)):
if var[i]=="":
var[i]='NULL'
else:
pass
print var
print self.tName1.text()
print self.tName1
If I print self.variable.text() nothing appears. On the other hand, if I print self.Name1 appears he posotion of the QLineEdit: <PyQt4.QtGui.QLineEdit object at 0x7fb1046cc180>
. I appreciate your help!! :P