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>
bb10
Liang Qi 2013-07-30 18:42:00 +02:00 committed by The Qt Project
parent 0bbc32a0cb
commit 25fc7a3068
1 changed files with 4 additions and 1 deletions

View File

@ -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.