summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/android/qandroidplatformtheme.cpp
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2014-11-24 06:17:35 +0400
committerKonstantin Ritt <ritt.ks@gmail.com>2014-11-25 22:18:15 +0100
commit02e20f772d4e07c0eed80d1aa11938787b763eca (patch)
tree6fc1cf14a0b641189181d1b7cc82deb5a0e0e33f /src/plugins/platforms/android/qandroidplatformtheme.cpp
parent77f800bad71f093739ffdab7ac088194978deceb (diff)
[QAndroidPlatformTheme] Get rid of static QFont
QFont is not POD and shouldn't be instantiated statically, otherwise we could end up with UB during qApp destruction. Change-Id: I2372c7a643eb3007957ab2b798732c1a18fd0ae5 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/android/qandroidplatformtheme.cpp')
-rw-r--r--src/plugins/platforms/android/qandroidplatformtheme.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/platforms/android/qandroidplatformtheme.cpp b/src/plugins/platforms/android/qandroidplatformtheme.cpp
index f9f2e4a944..8cece443b1 100644
--- a/src/plugins/platforms/android/qandroidplatformtheme.cpp
+++ b/src/plugins/platforms/android/qandroidplatformtheme.cpp
@@ -347,6 +347,9 @@ QAndroidPlatformTheme::QAndroidPlatformTheme(QAndroidPlatformNativeInterface *an
m_androidStyleData = loadAndroidStyle(&m_defaultPalette);
QGuiApplication::setPalette(m_defaultPalette);
androidPlatformNativeInterface->m_androidStyle = m_androidStyleData;
+
+ // default in case the style has not set a font
+ m_systemFont = QFont(QLatin1String("Roboto"), 14.0 * 100 / 72); // keep default size the same after changing from 100 dpi to 72 dpi
}
QPlatformMenuBar *QAndroidPlatformTheme::createPlatformMenuBar() const
@@ -429,10 +432,8 @@ const QFont *QAndroidPlatformTheme::font(Font type) const
return &(it.value());
}
- // default in case the style has not set a font
- static QFont systemFont("Roboto", 14.0 * 100 / 72); // keep default size the same after changing from 100 dpi to 72 dpi
if (type == QPlatformTheme::SystemFont)
- return &systemFont;
+ return &m_systemFont;
return 0;
}