Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > using QFtp class in PyQT

Reply
Thread Tools

using QFtp class in PyQT

 
 
Kim
Guest
Posts: n/a
 
      04-19-2004
Hi everybody,
I tried to write simple FTP program using PyQt version 3.11. The
document say that QFtp has been implemented, but i keep getting error
message from my simple program :

My Program:

from qt import *
from qtnetwork import *

def gotSignalStart(*arg):
print "start ",arg

def gotSignalState(*arg):
print "state ",arg

def gotListInfo(*arg):
print "List info ",arg

def doFTP():
fh = QFtp()
QObject.connect(fh,SIGNAL("start()"),gotSignalStar t);
QObject.connect(fh,SIGNAL("stateChanged()"),gotSig nalState);
QObject.connect(fh,SIGNAL("listInfo()"),gotListInf o);
fh.connectToHost("ftp.trolltech.com")
fh.login()
print fh.state()
if fh.state() != QFtp.Unconnected : fh.close()

doFTP();

Error messages:

QObject::connect: No such signal QFtp::start()
QObject::connect: (sender name: 'unnamed')
QObject::connect: (receiver name: 'unnamed')
QObject::connect: No such signal QFtp::stateChanged()
QObject::connect: (sender name: 'unnamed')
QObject::connect: (receiver name: 'unnamed')
QObject::connect: No such signal QFtp::listInfo()
QObject::connect: (sender name: 'unnamed')
QObject::connect: (receiver name: 'unnamed')
0
QSocket::writeBlock: Socket is not open


Can anyone help?
Thanks very much
Kim
 
Reply With Quote
 
 
 
 
Phil Thompson
Guest
Posts: n/a
 
      04-19-2004
On Monday 19 April 2004 2:59 pm, Kim wrote:
> Hi everybody,
> I tried to write simple FTP program using PyQt version 3.11. The
> document say that QFtp has been implemented, but i keep getting error
> message from my simple program :
>
> My Program:
>
> from qt import *
> from qtnetwork import *
>
> def gotSignalStart(*arg):
> print "start ",arg
>
> def gotSignalState(*arg):
> print "state ",arg
>
> def gotListInfo(*arg):
> print "List info ",arg
>
> def doFTP():
> fh = QFtp()
> QObject.connect(fh,SIGNAL("start()"),gotSignalStar t);
> QObject.connect(fh,SIGNAL("stateChanged()"),gotSig nalState);
> QObject.connect(fh,SIGNAL("listInfo()"),gotListInf o);
> fh.connectToHost("ftp.trolltech.com")
> fh.login()
> print fh.state()
> if fh.state() != QFtp.Unconnected : fh.close()
>
> doFTP();
>
> Error messages:
>
> QObject::connect: No such signal QFtp::start()
> QObject::connect: (sender name: 'unnamed')
> QObject::connect: (receiver name: 'unnamed')
> QObject::connect: No such signal QFtp::stateChanged()
> QObject::connect: (sender name: 'unnamed')
> QObject::connect: (receiver name: 'unnamed')
> QObject::connect: No such signal QFtp::listInfo()
> QObject::connect: (sender name: 'unnamed')
> QObject::connect: (receiver name: 'unnamed')
> 0


You must give the full (C++) signature of the signal, eg...

SIGNAL("listInfo(const QUrlInfo &)")

> QSocket::writeBlock: Socket is not open


QFtp is asynchronous. You need an event loop to make sure things actually
happen.

Phil

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Nested Class, Member Class, Inner Class, Local Class, Anonymous Class E11 Java 1 10-12-2005 03:34 PM
Class B using Class C, and Class A using both B and C jd C++ 3 11-27-2004 12:13 AM
Implementing a QFilePreview Class with PyQt Christopher Stone Python 1 06-27-2004 08:58 AM
PyQt, main window can't have reference to application class Sibylle Koczian Python 2 05-25-2004 06:26 AM
[PY GUI] interest function in python GUI(wxpython,pyqt) program.wxpython,pyqt ulysses Python 4 10-22-2003 03:28 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57