[PyKDE] connectSlotsByName do that really works in python?
Miguel Angel Cañedo
mcanedo at grupogcm.com
Mon Dec 18 15:49:38 GMT 2006
El Domingo, 17 de Diciembre de 2006 16:16, Carles Pina i Estany escribió:
> I send a test that I have done now to learn to use Eric but I think that
> it can help him (if he hasn't finished it :-) )
Thanks, I already got to the same coclusion thanks to the Andreas comment.
I think that some sample code like yours should be included in the PyQt
reference, I did not find a place telling where should that autoconect defs
be declared it only talks about the decorators.
>
> without use eric should be:
> designer-qt test.ui
> pyuic -o Ui_test.py test.ui
Can you use pyuic(4) from inside Eric?, where?
>
> then, hvae this file:
> from Ui_test import *
>
> class main(QtGui.QMainWindow):
> def __init__(self):
> QtGui.QDialog.__init__(self)
> self.ui = Ui_MainWindow()
> self.ui.setupUi(self)
>
> @QtCore.pyqtSignature("")
> def on_pushButton_clicked(self):
> self.ui.label.setText("hola")
>
> if __name__ == "__main__":
> app=QtGui.QApplication(sys.argv)
> window=main()
> window.show()
> sys.exit(app.exec_())
>
> This works fine. I have not looked deeply Miguel code, since I understood
> that he has everything in same file... and then is bad to change the UI :-)
>
More information about the PyQt
mailing list