diff options
author | Norwegian Rock Cat <qt-info@nokia.com> | 2009-04-20 07:49:55 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2009-04-20 08:35:17 (GMT) |
commit | 8179c72a4ae999bd9a2aaf59fdf568acc9662c2d (patch) | |
tree | 9e43d31283bc610610f982ad81051428def5f91c | |
parent | 87257b41b6fb4313c713648b05a07d7835d13d24 (diff) | |
download | Qt-8179c72a4ae999bd9a2aaf59fdf568acc9662c2d.zip Qt-8179c72a4ae999bd9a2aaf59fdf568acc9662c2d.tar.gz Qt-8179c72a4ae999bd9a2aaf59fdf568acc9662c2d.tar.bz2 |
BT: Fix a crash when using Q(File)Dialog::open() in QCocoa.
If we don't have a sheet, we need to recreate it in Cocoa.
Unfortunately, we neglected to reassign the NSWindow pointer in that
case, so the program would crash.
Reviewed-by: Richard Moe Gustavsen
(cherry picked from commit 9d9889682c79bacb803ef5613502e7307c1d16bd)
-rw-r--r-- | src/gui/kernel/qwidget_mac.mm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 43f6725..e416b43 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -4610,8 +4610,11 @@ void QWidgetPrivate::setModal_sys() if (windowParent && q->windowModality() == Qt::WindowModal){ // Window should be window-modal, which implies a sheet. - if (!alreadySheet) + if (!alreadySheet) { + // NB: the following call will call setModal_sys recursivly: recreateMacWindow(); + windowRef = qt_mac_window_for(q); + } if ([windowRef isKindOfClass:[NSPanel class]]){ // If the primary window of the sheet parent is a child of a modal dialog, // the sheet parent should not be modally shaddowed. |