PyQt: Can't show QFileDialog.getExistingDirectory in Python Thread, bug or not?

U

ulysses

Hi,

I use QT nc,PyQt NC 3.8 in Win32 platform. python 2.3.
I need show getExistingDirectory in my program. I catch a question.

When I show a Dialog in a python function.it's ok. exp:

def showDirectory:
dl=QFileDialog.getExistingDirectory('',None,
'get directory',
'choose directory',1)
print str(dl)

When I call this function in a python thread. the whole program halted
at once. It's seem a infinite loop. exp:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Main function start.....
thread = Thread(target = next, args = [params, frmMain, doneflag])
thread.setDaemon(false)
thread.start()


def next(params, d, doneflag):
dow = Download ()
d.dow = dow
dow.download(params, d.chooseFile, d.updateStatus, d.finished, d.error,
doneflag, 100, d.newpath)
if not d.fin:
d.failed()

def onChooseFile(self, default, bucket, f, size, dir, saveas):
if saveas != '':
dl = saveas
else:
if dir:
dl=QFileDialog.getExistingDirectory('',None,
'get directory',
'choose directory',1)
else:
dl = QFileDialog.getSaveFileName(tempShow, "*.*",
self, "FileDialog")

It's very cute I can use QFileDialog.getSaveFileName. Why I can't use
dl=QFileDialog.getExistingDirectory.

It's a Qt small bug???

Ulysses
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top