summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios/qiostheme.mm
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-08-12 13:05:02 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-08-12 13:05:02 +0200
commitca524e5b70ccfeb6386cf0c5df83ffb86a8771fe (patch)
tree245c471373516ccda2b0c91943a42cd74674f2da /src/plugins/platforms/ios/qiostheme.mm
parentb08cc0ec6f096d0e6764486c81264c24a406bee1 (diff)
parentc2badc7423b63824902d1f44a4b804de3335c20b (diff)
Merge remote-tracking branch 'origin/5.3' into 5.4
Manually included changes from 3a347a4e70e5a10ee92dd2578316c926a399e894 in src/opengl/qgl.cpp. Conflicts: src/opengl/qgl_qpa.cpp src/plugins/platforms/android/androidjnimain.cpp Change-Id: Ic26b58ee587d4884c9d0fba45c5a94b5a45ee929
Diffstat (limited to 'src/plugins/platforms/ios/qiostheme.mm')
-rw-r--r--src/plugins/platforms/ios/qiostheme.mm19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/plugins/platforms/ios/qiostheme.mm b/src/plugins/platforms/ios/qiostheme.mm
index e7093185aa..e51e97bd5a 100644
--- a/src/plugins/platforms/ios/qiostheme.mm
+++ b/src/plugins/platforms/ios/qiostheme.mm
@@ -46,6 +46,10 @@
#include <QtGui/QFont>
+#include <QtPlatformSupport/private/qcoretextfontdatabase_p.h>
+#include <QtGui/private/qguiapplication_p.h>
+#include <qpa/qplatformintegration.h>
+
#include <UIKit/UIFont.h>
#include <UIKit/UIInterface.h>
@@ -75,19 +79,8 @@ QVariant QIOSTheme::themeHint(ThemeHint hint) const
const QFont *QIOSTheme::font(Font type) const
{
if (m_fonts.isEmpty()) {
- // The real system font on iOS is '.Helvetica Neue UI', as returned by both [UIFont systemFontOfSize]
- // and CTFontCreateUIFontForLanguage(kCTFontSystemFontType, ...), but this font is not included when
- // populating the available fonts in QCoreTextFontDatabase::populateFontDatabase(), since the font
- // is internal to iOS and not supposed to be used by applications. We could potentially add this
- // font to the font-database, but it would then show up when enumerating user fonts from Qt
- // applications since we don't have a flag in Qt to mark a font as a private system font.
- // For now we hard-code the font to Helvetica, which should be very close to the actual
- // system font.
- QLatin1String systemFontFamilyName("Helvetica");
- m_fonts.insert(QPlatformTheme::SystemFont, new QFont(systemFontFamilyName, [UIFont systemFontSize]));
- m_fonts.insert(QPlatformTheme::SmallFont, new QFont(systemFontFamilyName, [UIFont smallSystemFontSize]));
- m_fonts.insert(QPlatformTheme::LabelFont, new QFont(systemFontFamilyName, [UIFont labelFontSize]));
- m_fonts.insert(QPlatformTheme::PushButtonFont, new QFont(systemFontFamilyName, [UIFont buttonFontSize]));
+ QCoreTextFontDatabase *ctfd = static_cast<QCoreTextFontDatabase *>(QGuiApplicationPrivate::platformIntegration()->fontDatabase());
+ m_fonts = ctfd->themeFonts();
}
return m_fonts.value(type, 0);