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

Discussion in 'Python' started by ulysses, Sep 16, 2003.

  1. ulysses

    ulysses Guest

    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
     
    ulysses, Sep 16, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ulysses
    Replies:
    4
    Views:
    454
    ulysses
    Sep 18, 2003
  2. ulysses
    Replies:
    5
    Views:
    403
    ulysses
    Oct 14, 2003
  3. ulysses
    Replies:
    4
    Views:
    820
    Werner Schiendl
    Oct 22, 2003
  4. QFileDialog

    , Aug 4, 2005, in forum: Python
    Replies:
    0
    Views:
    473
  5. Rincewind

    QFileDialog setFileMode blues

    Rincewind, Jul 29, 2009, in forum: Python
    Replies:
    2
    Views:
    672
    Rincewind
    Jul 29, 2009
Loading...

Share This Page