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

Reply via email to