Results 1 to 3 of 3

Thread: QFileDialog::getExistingDirectory locks up the application

  1. #1
    Join Date
    Dec 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Question QFileDialog::getExistingDirectory locks up the application

    Hello,

    I am having a bizarre issue with QFileDialog::getExistingDirectory.

    My application locks-up on this line:

    QString path = QFileDialog::getExistingDirectory(this, tr("Select Folder"));

    I stepped inside this function with a debugger and traced the execution all the way to qt_win_CID_get_existing_directory() function in qfiledialog_win.cpp

    It locks up trying to show the dialog window on line 615:

    hr = pfd->Show(parentWindow ? parentWindow->winId() : 0);

    I am running a Qt app on Windows 7 64-bit system.

    Any ideas what may be going on?

    Thanks.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QFileDialog::getExistingDirectory locks up the application

    What is "this" pointing to? Is it a QWidget of some sort?

  3. #3
    Join Date
    Dec 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QFileDialog::getExistingDirectory locks up the application

    Yes, 'this' is a QWidget.

    I actually found this workaround using Qt dialog instead of the native dialog:


    QFileDialog dlg(this);
    dlg.setFileMode(QFileDialog:irectoryOnly);
    dlg.setOptions(QFileDialog::ShowDirsOnly);

    int result = dlg.exec();

    Works great. However, it would still be nice to know what is gong on with the native dialog.

    Thanks.

Similar Threads

  1. Replies: 5
    Last Post: 7th December 2010, 21:02
  2. Replies: 0
    Last Post: 31st March 2010, 12:40
  3. Replies: 2
    Last Post: 16th April 2009, 07:51
  4. QThread locks my gui ??
    By LordQt in forum Qt Programming
    Replies: 8
    Last Post: 8th December 2008, 19:53
  5. Simple Question on getExistingDirectory
    By Naveen in forum Qt Programming
    Replies: 6
    Last Post: 3rd March 2006, 09:44

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.