diff --git a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm index 5cdf6bf02cf..8e449f13dbc 100644 --- a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm @@ -14,6 +14,7 @@ #include "qcocoafontdialoghelper.h" #include "qcocoahelpers.h" #include "qcocoaeventdispatcher.h" +#include "qnsview.h" #if !CGFLOAT_DEFINED typedef float CGFloat; // Should only not be defined on 32-bit platforms @@ -255,6 +256,18 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSFontPanelDelegate); @end +@interface QNSView (FontPanel) +- (void)changeFont:(id)sender; +@end + +@implementation QNSView (FontPanel) +- (void)changeFont:(id)sender +{ + if (auto *delegate = qt_objc_cast(NSFontPanel.sharedFontPanel.delegate)) + [delegate changeFont:sender]; +} +@end + QT_BEGIN_NAMESPACE class QCocoaFontPanel