[PyQt] Problem on connecting signals

Luca Bedogni me at lucabedogni.it
Mon Nov 26 20:24:49 GMT 2007


On Monday 26 November 2007, Phil Thompson wrote:
> On Monday 26 November 2007, Luca Bedogni wrote:
> > Hi
> > 	I made a qt4 app with designer-qt, then converted with
> >      pyuic4 interface.ui -o interface.py
> > Then, from my app, I do:
> > #!/usr/bin/env python
> >
> > import sys
> > import os
> > from interface import Ui_Dialog
> > from PyQt4 import QtGui,QtCore
> >
> > if __name__ == "__main__":
> >
> >   app = QtGui.QApplication(sys.argv)
> >
> >   MainForm = QtGui.QWidget()
> >   form = Ui_Dialog()
> >   form.setupUi(MainForm)
> >   MainForm.show()
> >
> >   app.exec_()
> >
> > but when i ran it I got:
> > bedo at blackmamba:~/pyqt$ ./prova.py
> > Traceback (most recent call last):
> >   File "./prova.py", line 15, in ?
> >     form.setupUi(MainForm)
> >   File "/home/bedo/pyqt/interface.py", line 36, in setupUi
> >
> > QtCore.QObject.connect(Dialog,QtCore.SIGNAL("accepted()"),Dialog.accept)
> > AttributeError: accept
> > bedo at blackmamba:~/pyqt$
> >
> > Where am I wrong?
> >
> > TIA
>
> Shouldn't MainForm be a QDialog?

Yes it could be, but I got the same problem with QDialog too.

> Phil

Thanks
-- 
Debian Powered GNU/Linux User #373118
Bedogni Luca - 	Blog | http://blog.lucabedogni.it
		        Site | http://www.lucabedogni.it
Debianizzati - www.debianizzati.org | Founder Member
--
All undetectable errors will be treated as if no error occured. (IBM)  
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20071126/94a242df/attachment-0001.bin


More information about the PyQt mailing list