By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,764 Members | 1,379 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,764 IT Pros & Developers. It's quick & easy.

using QFtp class in PyQT

P: n/a
Kim
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
Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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

Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.