diff options
author | Norwegian Rock Cat <qt-info@nokia.com> | 2009-04-20 07:49:55 (GMT) |
---|---|---|
committer | Norwegian Rock Cat <qt-info@nokia.com> | 2009-04-20 07:49:55 (GMT) |
commit | 9d9889682c79bacb803ef5613502e7307c1d16bd (patch) | |
tree | 5ee43a513d16e40c8e99b9f8fad5762b5ce57303 /src | |
parent | 10194aafd10824fe1919aa44083224e8bea442ca (diff) | |
download | Qt-9d9889682c79bacb803ef5613502e7307c1d16bd.zip Qt-9d9889682c79bacb803ef5613502e7307c1d16bd.tar.gz Qt-9d9889682c79bacb803ef5613502e7307c1d16bd.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
Diffstat (limited to 'src')
-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 2c3f7f1..37dc79c 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -4627,8 +4627,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. |