[PyQt] get list of object

Paul Du Bois dubois at doublefine.com
Tue Oct 11 19:08:17 BST 2011


for i,txt in enumerate(lst):
  edit = getattr(self, 'lineEdit_%d' % i)
  edit.settext(txt)

> -----Original Message-----
> From: pyqt-bounces at riverbankcomputing.com [mailto:pyqt-bounces at riverbankcomputing.com] On Behalf Of
> lucaberto at libero.it
> Sent: Tuesday, October 11, 2011 8:49 AM
> To: pyqt at riverbankcomputing.com
> Subject: [PyQt] get list of object
> 
> Hello i have create a simple project useng eric
> i have 10 line edit called self.lineEdit, self.lineEdit_2 etc....
> now i have a list with 20 string to put in the lineedit
> for each item in the list i have to do self.lineEdit.settext(list[0]), self.
> lineEdit_2.settext(list[2])
> or there is a easy way?
> 
> Thanks Luca
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt


More information about the PyQt mailing list