[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] List of childrens in QDialog by name?
From: Sergio Daniel Gomez <sergiogomez () tostado ! com ! ar>
Date: 2009-02-26 14:09:47
Message-ID: 49A6A2AB.5010603 () tostado ! com ! ar
[Download RAW message or body]
Sergio Daniel Gomez escribió:
> How can I access to children's attibutes of a QDialog?
>
> dlgBuscar = QtGui.QDialog()
> dlgGui = Ui_Dialog() # Made with QtDesigner and pyuic4
> dlgGui.setupUi(dlgBuscar)
>
> if dlgBuscar.exec_() == QtGui.QDialog.Accepted:
> for child in dlgBuscar.children():
> print child
> # Return the a object list, ok.
>
> print dlgBuscar.children()[1].text()
> #print the text in the QLineEdit, but access by index. I need access by
> object name. How?
>
> Thanks.
>
>
> Sergio D. Gómez
>
>
> _______________________________________________
> PyQt mailing list PyQt@riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
With
print dlgBuscar.findChildren(QtGui.QLineEdit, 'txtBuscar')[0].text()
Thanks!
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic