On 25 Jun 2014, at 21:10, John Weeks <j...@wavemetrics.com> wrote: > We use QFileDialog::getOpenFileName() to get the native file dialog on > Macintosh. If you hit Escape, the dialog closes (as it should). > > If I call QDialog::reject() or even if I use this code: > > QFileDialog * dialog = qobject_cast<QFileDialog > *>(activeModalWidget); > QKeyEvent * event = new QKeyEvent(QEvent::KeyPress, > Qt::Key_Escape, Qt::NoModifier, QString(),0,0); > QApplication::postEvent(dialog, event); > event = new QKeyEvent(QEvent::KeyRelease, > Qt::Key_Escape, Qt::NoModifier, QString(),0,0); > QApplication::postEvent(dialog, event); > the dialog closes, but with Qt 5.3 it leaves the application in some sort of > modal state. This puzzles me- hitting the Escape key works fine. What's the > difference? > > By the way, this works as I expect with Qt 4.8.6.
That sounds like a bug. What do you mean about the modal state, the window is active but you can’t interact with anything in it? Or it’s not active? _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest