From c8dd650616278fda0f79bd237833de1ade5d947a Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Thu, 7 Nov 2019 14:07:53 +0100 Subject: Unset the resolved font's families if it was not set before When the font is resolved, if the font does not have families set then it will set it to be the family to ensure that it has the right precedence. Therefore we need to reset the families setting so that it does not act like a font has changed after being resolved when it really hasn't. Fixes: QTBUG-79790 Change-Id: I03c6f1456dbe5f136181b1c3a0e22fdc0fa66679 Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquicktextarea.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/quicktemplates2/qquicktextarea.cpp') diff --git a/src/quicktemplates2/qquicktextarea.cpp b/src/quicktemplates2/qquicktextarea.cpp index f7b8969c..ef59bd93 100644 --- a/src/quicktemplates2/qquicktextarea.cpp +++ b/src/quicktemplates2/qquicktextarea.cpp @@ -253,7 +253,10 @@ void QQuickTextAreaPrivate::inheritFont(const QFont &font) parentFont.resolve(extra.isAllocated() ? extra->requestedFont.resolve() | font.resolve() : font.resolve()); const QFont defaultFont = QQuickTheme::font(QQuickTheme::TextArea); - const QFont resolvedFont = parentFont.resolve(defaultFont); + QFont resolvedFont = parentFont.resolve(defaultFont); + // See comment in QQuickControlPrivate::inheritFont + if (defaultFont.families().isEmpty()) + resolvedFont.setFamilies(QStringList()); setFont_helper(resolvedFont); } -- cgit v1.2.3