[PyQt] QFtp

Baz Walter bazwal at ftml.net
Tue Oct 12 14:44:42 BST 2010


On 12/10/10 13:53, lucaberto at libero.it wrote:
> Hello i have made a small test using qftp, but i make some error:
>
> class Form(QWidget, Ui_Form):
>      """
>      Class documentation goes here.
>      """
>      def __init__(self, parent = None):
>          """
>          Constructor
>          """
>          super(Form, self). __init__(parent)
>          self.connessione = QtNetwork.QFtp()
>          self.connect(self.connessione, QtCore.SIGNAL("stateChanged()"), self.
> risultato_connessione)
>          QWidget.__init__(self, parent)
>          self.setupUi(self)
>
>      @pyqtSignature("")
>      def on_pushButton_clicked(self):
>         self.connetto()
>
>      def connetto(self):
>          luca = self.connessione.connectToHost('host', 21)
>
>
>      def risultato_connessione(self):
>          print 'sig received'
>
> so if i understand right when the state of the connection change the signal
> "stateChanged()" is emitted and it is emitted also for HostLookup but i never
> get this signal why?

you're using the wrong signature. it should be:

     QtCore.SIGNAL("stateChanged(int)")


More information about the PyQt mailing list