diff options
author | Sergio Ahumada <sergio.ahumada@digia.com> | 2013-04-10 15:41:47 +0200 |
---|---|---|
committer | Sergio Ahumada <sergio.ahumada@digia.com> | 2013-04-10 15:42:22 +0200 |
commit | 90297a64f203959f90041887ea31f4bd04bc059a (patch) | |
tree | 86f8ad6a5af26fd618cdb2e20601e6df89ac94d6 /src/plugins/platforms/ios | |
parent | 537a4bc4011d32de193dc31caf09a44c1810ab33 (diff) | |
parent | f273d6fbc02055ff3999adc0df76360ca0670435 (diff) |
Merge branch 'stable' into dev
Change-Id: Icff019d74ae04c628a80f66aa478e4db40fae464
Diffstat (limited to 'src/plugins/platforms/ios')
-rw-r--r-- | src/plugins/platforms/ios/qioscontext.mm | 2 | ||||
-rw-r--r-- | src/plugins/platforms/ios/qiosscreen.mm | 2 | ||||
-rw-r--r-- | src/plugins/platforms/ios/qiostheme.h | 4 | ||||
-rw-r--r-- | src/plugins/platforms/ios/qiostheme.mm | 14 | ||||
-rw-r--r-- | src/plugins/platforms/ios/qiosviewcontroller.mm | 2 | ||||
-rw-r--r-- | src/plugins/platforms/ios/qioswindow.mm | 2 |
6 files changed, 15 insertions, 11 deletions
diff --git a/src/plugins/platforms/ios/qioscontext.mm b/src/plugins/platforms/ios/qioscontext.mm index d3966964e0..e2a6113010 100644 --- a/src/plugins/platforms/ios/qioscontext.mm +++ b/src/plugins/platforms/ios/qioscontext.mm @@ -44,7 +44,7 @@ #include <dlfcn.h> -#include <QtGui/QOpenGlContext> +#include <QtGui/QOpenGLContext> #import <OpenGLES/EAGL.h> #import <QuartzCore/CAEAGLLayer.h> diff --git a/src/plugins/platforms/ios/qiosscreen.mm b/src/plugins/platforms/ios/qiosscreen.mm index 3265ed8e37..d86ed5f090 100644 --- a/src/plugins/platforms/ios/qiosscreen.mm +++ b/src/plugins/platforms/ios/qiosscreen.mm @@ -142,7 +142,7 @@ QIOSScreen::QIOSScreen(unsigned int screenIndex) if (isQtApplication()) { // When in a non-mixed environment, let QScreen follow the current interface orientation: - setPrimaryOrientation(toQtScreenOrientation(rootViewController().interfaceOrientation)); + setPrimaryOrientation(toQtScreenOrientation(UIDeviceOrientation(rootViewController().interfaceOrientation))); } [pool release]; diff --git a/src/plugins/platforms/ios/qiostheme.h b/src/plugins/platforms/ios/qiostheme.h index 5ccbcac710..b03f65f556 100644 --- a/src/plugins/platforms/ios/qiostheme.h +++ b/src/plugins/platforms/ios/qiostheme.h @@ -42,6 +42,7 @@ #ifndef QIOSTHEME_H #define QIOSTHEME_H +#include <QtCore/QHash> #include <qpa/qplatformtheme.h> QT_BEGIN_NAMESPACE @@ -57,6 +58,9 @@ public: const QFont *font(Font type = SystemFont) const; static const char *name; + +private: + mutable QHash<QPlatformTheme::Font, QFont *> m_fonts; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/ios/qiostheme.mm b/src/plugins/platforms/ios/qiostheme.mm index f98781f8a7..e7093185aa 100644 --- a/src/plugins/platforms/ios/qiostheme.mm +++ b/src/plugins/platforms/ios/qiostheme.mm @@ -59,6 +59,7 @@ QIOSTheme::QIOSTheme() QIOSTheme::~QIOSTheme() { + qDeleteAll(m_fonts); } QVariant QIOSTheme::themeHint(ThemeHint hint) const @@ -73,8 +74,7 @@ QVariant QIOSTheme::themeHint(ThemeHint hint) const const QFont *QIOSTheme::font(Font type) const { - static QHash<QPlatformTheme::Font, QFont *> fonts; - if (fonts.isEmpty()) { + 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 @@ -84,13 +84,13 @@ const QFont *QIOSTheme::font(Font type) const // For now we hard-code the font to Helvetica, which should be very close to the actual // system font. QLatin1String systemFontFamilyName("Helvetica"); - fonts.insert(QPlatformTheme::SystemFont, new QFont(systemFontFamilyName, [UIFont systemFontSize])); - fonts.insert(QPlatformTheme::SmallFont, new QFont(systemFontFamilyName, [UIFont smallSystemFontSize])); - fonts.insert(QPlatformTheme::LabelFont, new QFont(systemFontFamilyName, [UIFont labelFontSize])); - fonts.insert(QPlatformTheme::PushButtonFont, new QFont(systemFontFamilyName, [UIFont buttonFontSize])); + 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])); } - return fonts.value(type, 0); + return m_fonts.value(type, 0); } QT_END_NAMESPACE diff --git a/src/plugins/platforms/ios/qiosviewcontroller.mm b/src/plugins/platforms/ios/qiosviewcontroller.mm index c52bfd7345..404b213966 100644 --- a/src/plugins/platforms/ios/qiosviewcontroller.mm +++ b/src/plugins/platforms/ios/qiosviewcontroller.mm @@ -78,7 +78,7 @@ - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { Q_UNUSED(duration); - Qt::ScreenOrientation orientation = toQtScreenOrientation(toInterfaceOrientation); + Qt::ScreenOrientation orientation = toQtScreenOrientation(UIDeviceOrientation(toInterfaceOrientation)); if (orientation == -1) return; diff --git a/src/plugins/platforms/ios/qioswindow.mm b/src/plugins/platforms/ios/qioswindow.mm index e4fb5e2e1c..d7a2fa1a75 100644 --- a/src/plugins/platforms/ios/qioswindow.mm +++ b/src/plugins/platforms/ios/qioswindow.mm @@ -501,7 +501,7 @@ void QIOSWindow::handleContentOrientationChange(Qt::ScreenOrientation orientatio { // Keep the status bar in sync with content orientation. This will ensure // that the task bar (and associated gestures) are aligned correctly: - UIDeviceOrientation uiOrientation = fromQtScreenOrientation(orientation); + UIInterfaceOrientation uiOrientation = UIInterfaceOrientation(fromQtScreenOrientation(orientation)); [[UIApplication sharedApplication] setStatusBarOrientation:uiOrientation animated:NO]; } |