Skip to content

Commit 9fd1171

Browse files
author
Morten Johan Sørvig
committed
Fix crash in QFontDialog::getFont() on Mac 10.4
[NSFontManager setTarget] is not available on 10.4. Rev-by: Richard Moe Gustavsen
1 parent 970f19b commit 9fd1171

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/gui/dialogs/qfontdialog_mac.mm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,9 @@ - (void)cleanUpAfterMyself
394394
}
395395
[mFontPanel setDelegate:nil];
396396
[[NSFontManager sharedFontManager] setDelegate:nil];
397+
#ifdef QT_MAC_USE_COCOA
397398
[[NSFontManager sharedFontManager] setTarget:nil];
399+
#endif
398400
}
399401
@end
400402

@@ -518,7 +520,9 @@ and with buttons (OK and Cancel).
518520
extraHeight:dialogExtraHeight];
519521
[ourPanel setDelegate:delegate];
520522
[[NSFontManager sharedFontManager] setDelegate:delegate];
523+
#ifdef QT_MAC_USE_COCOA
521524
[[NSFontManager sharedFontManager] setTarget:delegate];
525+
#endif
522526
setFont(delegate, initial);
523527

524528
// hack to get correct initial layout

0 commit comments

Comments
 (0)