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.
Re: QFileDialog::getExistingDirectory locks up the application
What is "this" pointing to? Is it a QWidget of some sort?
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::DirectoryOnly);
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.