From f26928cccf7e0fd9f06236476f2a6b52151e5dca Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Fri, 17 Jan 2014 17:38:55 +0200 Subject: Allow QTextCharFormat::setFont() to skip unresolved font props This makes the font merging possible and solves an issue with the default font properties inheritance when used in conjunction with QTextFormatCollection. Change-Id: If8b543c011122dde9f086f5d696df3b042f7b90c Reviewed-by: Lars Knoll --- src/gui/text/qtextformat.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/gui/text/qtextformat.h') diff --git a/src/gui/text/qtextformat.h b/src/gui/text/qtextformat.h index c04ac3876b..1906a8a0c2 100644 --- a/src/gui/text/qtextformat.h +++ b/src/gui/text/qtextformat.h @@ -408,7 +408,13 @@ public: QTextCharFormat(); bool isValid() const { return isCharFormat(); } - void setFont(const QFont &font); + + enum FontPropertiesInheritanceBehavior { + FontPropertiesSpecifiedOnly, + FontPropertiesAll + }; + void setFont(const QFont &font, FontPropertiesInheritanceBehavior behavior); + void setFont(const QFont &font); // ### Qt6: Merge with above QFont font() const; inline void setFontFamily(const QString &family) -- cgit v1.2.3