aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-10-25 00:19:55 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-10-25 18:42:08 +0000
commit47065844f666e1332a7fb5bcfdc6015e0f7e1591 (patch)
treeb85c366307bc70fde090b1b0809d7cc360ece6a1 /src
parent1acc393933650f824de427f6b0ca3e38a0a8bdb4 (diff)
Replace QStringLiteral with QLatin1String in the proxy themes
This allows us, in theory, to test multiple styles in the same process by calling qmlClearTypeRegistrations() between each style test round. When QML types are cleared, QML plugins are unloaded, and the current style plugin's proxy platform theme is destroyed. It leads to a nasty crash if there are fonts stored in the Qt font database that have their family names stored in the read-only data of an unloaded plugin. Change-Id: I32a70077ac4502e16a753fb68f7efeef35d239b5 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/imports/controls/material/qquickmaterialtheme.cpp8
-rw-r--r--src/imports/controls/universal/qquickuniversaltheme.cpp4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/imports/controls/material/qquickmaterialtheme.cpp b/src/imports/controls/material/qquickmaterialtheme.cpp
index 0d2f8a70..1967a74b 100644
--- a/src/imports/controls/material/qquickmaterialtheme.cpp
+++ b/src/imports/controls/material/qquickmaterialtheme.cpp
@@ -45,15 +45,15 @@ QQuickMaterialTheme::QQuickMaterialTheme(QPlatformTheme *theme)
: QQuickProxyTheme(theme)
{
QFont font;
- font.setFamily(QStringLiteral("Roboto"));
+ font.setFamily(QLatin1String("Roboto"));
QString family = QFontInfo(font).family();
- if (family != QStringLiteral("Roboto")) {
- font.setFamily(QStringLiteral("Noto"));
+ if (family != QLatin1String("Roboto")) {
+ font.setFamily(QLatin1String("Noto"));
family = QFontInfo(font).family();
}
- if (family == QStringLiteral("Roboto") || family == QStringLiteral("Noto")) {
+ if (family == QLatin1String("Roboto") || family == QLatin1String("Noto")) {
systemFont.setFamily(family);
buttonFont.setFamily(family);
toolTipFont.setFamily(family);
diff --git a/src/imports/controls/universal/qquickuniversaltheme.cpp b/src/imports/controls/universal/qquickuniversaltheme.cpp
index 51642c4a..dc516b45 100644
--- a/src/imports/controls/universal/qquickuniversaltheme.cpp
+++ b/src/imports/controls/universal/qquickuniversaltheme.cpp
@@ -44,8 +44,8 @@ QT_BEGIN_NAMESPACE
QQuickUniversalTheme::QQuickUniversalTheme(QPlatformTheme *theme)
: QQuickProxyTheme(theme)
{
- const QFont font(QStringLiteral("Segoe UI"));
- if (QFontInfo(font).family() == QStringLiteral("Segoe UI")) {
+ const QFont font(QLatin1String("Segoe UI"));
+ if (QFontInfo(font).family() == QLatin1String("Segoe UI")) {
const QString family = font.family();
systemFont.setFamily(family);
groupBoxTitleFont.setFamily(family);