[PyKDE] Re: newbie: QFileDialog

Eli Carter eli.carter at inet.com
Fri Aug 30 16:36:00 BST 2002


Paul Felix wrote:
>>From: Eli Carter <eli.carter at inet.com>
[snip]
>>I want to use QFileDialog to let a user pick files on a remote system,
>>such as over an ftp connection.  I'm not really sure where to start.  I
>>expect to subclass it, but I don't know what internals would need to be
>>overridden, where to find that out, or if that is possible in pyqt.
[snip]
> I believe the answer is QUrlOperator.  Try this:
> 
> from qt import *
> from qtnetwork import *
> 
> qInitNetworkProtocols()
> 
> op = QUrlOperator("ftp://ftp.trolltech.com")
> 
> fd = QFileDialog()
> fd.setUrl(op)
> fd.exec_loop()

Yeah, that looks like what I want. :)  Particularly the ::copy() 
operator (http://doc.trolltech.com/2.3/qurloperator.html) and the fact 
that it can give a progress signal, which is something else I wanted to 
do but hadn't gotten to.  Thanks for the excellent lead! :)

Hrmm... RedHat 7.2 doesn't seem to have qtnetwork available, though 
Mandrake 8.2 does.  I wonder if RH7.3 does...  *mutter* Oh bother.

Thanks again,

Eli
--------------------. "If it ain't broke now,
Eli Carter           \                  it will be soon." -- crypto-gram
eli.carter(a)inet.com `-------------------------------------------------




More information about the PyQt mailing list