aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2018-02-15 16:10:52 +0100
committerJ-P Nurmi <jpnurmi@qt.io>2018-03-01 13:05:46 +0000
commit01b0e2316771b495e3ef3586585f2bc626557394 (patch)
tree4156ae206e773851d8533457c9c3ac28f7171fe1 /src
parent3995d587d62dfa9c6aa554180cba9b0a6a0f3f87 (diff)
Fix QQuickTheme::font() and palette()
Respect fonts and palettes from :/qtquickcontrols2.conf, but don't blatantly override the platform fonts and palettes with null values if the fonts and palettes are not set in :/qtquickcontrols2.conf. Even though fonts and palettes have technically same problem, testing the system palette is hard with 5.11 since QQuickDefaultTheme is a platform proxy theme and provides a custom system palette. It should be possible to have tst_palette::systemPalette() in dev, though, where we have removed the inheritance between QQuickTheme and QPlatformTheme. Task-number: QTBUG-66430 Change-Id: I6dfe678ccdc7e3990320c120612cfcc68723264d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/quickcontrols2/qquicktheme.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/quickcontrols2/qquicktheme.cpp b/src/quickcontrols2/qquicktheme.cpp
index 06a66bfd..3643e975 100644
--- a/src/quickcontrols2/qquicktheme.cpp
+++ b/src/quickcontrols2/qquicktheme.cpp
@@ -134,14 +134,16 @@ QQuickTheme::QQuickTheme(const QString &style)
const QFont *QQuickTheme::font(Font type) const
{
- Q_UNUSED(type);
- return m_styleFont.data();
+ if (m_styleFont)
+ return m_styleFont.data();
+ return QQuickProxyTheme::font(type);
}
const QPalette *QQuickTheme::palette(Palette type) const
{
- Q_UNUSED(type);
- return m_stylePalette.data();
+ if (m_stylePalette)
+ return m_stylePalette.data();
+ return QQuickProxyTheme::palette(type);
}
QFont QQuickTheme::resolveFont(const QFont &font) const