QFileDialog::getOpenFileName - dialog not closing on file select under OS X
-
in using the QFileDialog::getOpenFileName dialog to select a file under OS X, when clicking on OK (or double clicking the file) to select the name, the file name is passed correctly and the code continues execution, however the actual dialog remains on the screen and unresponsive. This same code works fine under windows and Linux:
QString filename = QFileDialog::getOpenFileName(this, "Open Study", settings.value("GeneralSettings/SavePath").toString(), "Study File (*.ssd);;All Files(*)"); if(!filename.isEmpty()) { OpenFile(filename); }
Any thoughts as to why this may be happening?
Rob
-
@Magnum A valid observation... obviously tired by the end of the day yesterday. I have updated everything and am still receiving the same results.
Of note: the OpenFile function opens a file in an MDISubWindow. I have since noticed that the dialog closes if another system dialog overrides it from the main form.
-
I am using Qt 5.4.0 on Yosemite and have not seen this problem. I use 'getOpenFileName()' on lots of projects.
QMake Version: 3.0
G++ Version: 6.0 (clang-600-0.57)
Target: x86_64The MDISubWindow doesn't sound right (I assume this means it opens in a child window of the parent and not a typical modal dialog). Maybe some window flags are being inherited from the parent widget?
-
@mcosta It is a standard QT application with a (mostly) unaltered main loop:
int main(int argc, char *argv[]) { QApplication a(argc, argv); QCoreApplication::setOrganizationName("###########"); QCoreApplication::setOrganizationDomain("############"); QCoreApplication::setApplicationName("##########"); QCoreApplication::setApplicationVersion("############"); frmMain w; w.show(); return a.exec(); }