summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@digia.com>2013-07-30 18:42:00 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-07-31 23:48:47 +0200
commit25fc7a3068741807fb15eefb2fe57618a1b1fb84 (patch)
treeecd2ea8de84d09b1c9d81b05ab6cbe685686480c /src/plugins/platforms/cocoa
parent0bbc32a0cb3b71012a9245b84f69cdc8405ce5fc (diff)
Cocoa: emit currentFontChanged signal in font dialog helper
* changeFont is a delegate method of NSFontManager. * exec() will not be called in Qt Quick. Task-number: QTBUG-32450 Change-Id: I05e43ce84d28ff32c88d75bd6ee60653de6ca4f0 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/plugins/platforms/cocoa')
-rw-r--r--src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
index 0a13c9deb5..91fb52eb6d 100644
--- a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
@@ -149,6 +149,9 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSFontPanelDelegate);
[mFontPanel setRestorable:NO];
#endif
+ [mFontPanel setDelegate:self];
+ [[NSFontManager sharedFontManager] setDelegate:self];
+
[mFontPanel retain];
return self;
}
@@ -157,6 +160,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSFontPanelDelegate);
{
[self restoreOriginalContentView];
[mFontPanel setDelegate:nil];
+ [[NSFontManager sharedFontManager] setDelegate:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self];
[super dealloc];
@@ -319,7 +323,6 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSFontPanelDelegate);
- (BOOL)runApplicationModalPanel
{
mDialogIsExecuting = true;
- [mFontPanel setDelegate:self];
// Call processEvents in case the event dispatcher has been interrupted, and needs to do
// cleanup of modal sessions. Do this before showing the native dialog, otherwise it will
// close down during the cleanup.