summaryrefslogtreecommitdiffstats
path: root/src/gui/dialogs/qfontdialog_mac.mm
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dietrich-de@nokia.com>2011-01-07 10:16:57 (GMT)
committerGabriel de Dietrich <gabriel.dietrich-de@nokia.com>2011-01-07 10:16:57 (GMT)
commitba8c96ee48cbad70f83919c4dcfc133566442bea (patch)
tree5089c5fe3abad2da60e3956c3cf1cb498ada43f2 /src/gui/dialogs/qfontdialog_mac.mm
parent9cc21c043238dc7576a465c9d236e8968fd8c549 (diff)
parent8c4a4293a0995b9b37bd59863c3e2fb902ec3dc7 (diff)
downloadQt-ba8c96ee48cbad70f83919c4dcfc133566442bea.zip
Qt-ba8c96ee48cbad70f83919c4dcfc133566442bea.tar.gz
Qt-ba8c96ee48cbad70f83919c4dcfc133566442bea.tar.bz2
Merge branch 'review-4.7' into staging-4.7
Diffstat (limited to 'src/gui/dialogs/qfontdialog_mac.mm')
-rw-r--r--src/gui/dialogs/qfontdialog_mac.mm9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gui/dialogs/qfontdialog_mac.mm b/src/gui/dialogs/qfontdialog_mac.mm
index 9c63dfa..e2c0ef5 100644
--- a/src/gui/dialogs/qfontdialog_mac.mm
+++ b/src/gui/dialogs/qfontdialog_mac.mm
@@ -116,6 +116,7 @@ const int StyleMask = NSTitledWindowMask | NSClosableWindowMask | NSResizableWin
- (void)showModelessPanel;
- (void)showWindowModalSheet:(QWidget *)docWidget;
- (void)runApplicationModalPanel;
+- (BOOL)isAppModal;
- (void)changeFont:(id)sender;
- (void)changeAttributes:(id)sender;
- (BOOL)windowShouldClose:(id)window;
@@ -226,6 +227,7 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont)
QBoolBlocker nativeDialogOnTop(QApplicationPrivate::native_modal_dialog_active);
mAppModal = true;
NSWindow *ourPanel = [mStolenContentView window];
+ [ourPanel setReleasedWhenClosed:NO];
[NSApp runModalForWindow:ourPanel];
QAbstractEventDispatcher::instance()->interrupt();
@@ -235,6 +237,11 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont)
mPriv->fontDialog()->reject();
}
+- (BOOL)isAppModal
+{
+ return mAppModal;
+}
+
- (void)showWindowModalSheet:(QWidget *)docWidget
{
#ifdef QT_MAC_USE_COCOA
@@ -485,6 +492,8 @@ void QFontDialogPrivate::closeCocoaFontPanel()
QT_MANGLE_NAMESPACE(QCocoaFontPanelDelegate) *theDelegate = static_cast<QT_MANGLE_NAMESPACE(QCocoaFontPanelDelegate) *>(delegate);
NSWindow *ourPanel = [theDelegate actualPanel];
[ourPanel close];
+ if ([theDelegate isAppModal])
+ [ourPanel release];
[theDelegate cleanUpAfterMyself];
[theDelegate release];
this->delegate = 0;