From d74a246cc9ea801b08a9b9ad6b09c0cb2abfe6c6 Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Tue, 22 May 2012 14:36:25 +0200 Subject: [PATCH] Fix font rendering gamma correction on Mac MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It needs a 2.0 gamma (as in Qt 4) in platform plugin styleHint. Change-Id: I2286532c607554c41baee4fa348cd7899bf010e1 Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/cocoa/qcocoaintegration.h | 1 + src/plugins/platforms/cocoa/qcocoaintegration.mm | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.h b/src/plugins/platforms/cocoa/qcocoaintegration.h index da84969f00..fa0c25a1a2 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.h +++ b/src/plugins/platforms/cocoa/qcocoaintegration.h @@ -101,6 +101,7 @@ public: QStringList themeNames() const; QPlatformTheme *createPlatformTheme(const QString &name) const; QPlatformServices *services() const; + QVariant styleHint(StyleHint hint) const; private: diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm index 9b575afbb2..ab159da260 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.mm +++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm @@ -245,4 +245,11 @@ QPlatformServices *QCocoaIntegration::services() const return mServices.data(); } +QVariant QCocoaIntegration::styleHint(StyleHint hint) const +{ + if (hint == QPlatformIntegration::FontSmoothingGamma) + return 2.0; + return QPlatformIntegration::styleHint(hint); +} + QT_END_NAMESPACE