From db7c644cd634cce3b309fb63978f466456e0f559 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Wed, 28 Mar 2018 16:43:49 +0200 Subject: [PATCH] Document the QTextBlockFormat::headingLevel property Followup to 310daae53926628f80c08e4415b94b90ad525c8f Change-Id: Ib0b4330e2201991fa28b297e26edb3a8dd493577 Reviewed-by: Martin Smith Reviewed-by: Friedemann Kleint --- src/gui/text/qtextformat.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp index b3f48007877..749a2879418 100644 --- a/src/gui/text/qtextformat.cpp +++ b/src/gui/text/qtextformat.cpp @@ -556,6 +556,8 @@ Q_GUI_EXPORT QDataStream &operator>>(QDataStream &stream, QTextFormat &fmt) \value LineHeightType \value BlockNonBreakableLines \value BlockTrailingHorizontalRulerWidth The width of a horizontal ruler element. + \value HeadingLevel The level of a heading, for example 1 corresponds to an HTML H1 tag; otherwise 0. + This enum value has been added in Qt 5.12. Character properties @@ -2245,6 +2247,34 @@ QList QTextBlockFormat::tabPositions() const */ +/*! + \fn void QTextBlockFormat::setHeadingLevel(int level) + \since 5.12 + + Sets the paragraph's heading level, where 1 is the highest-level heading + type (usually with the largest possible heading font size), and increasing + values are progressively deeper into the document (and usually with smaller + font sizes). For example when reading an HTML H1 tag, the heading level is + set to 1. Setting the heading level does not automatically change the font + size; however QTextDocumentFragment::fromHtml() sets both the heading level + and the font size simultaneously. + + If the paragraph is not a heading, the level should be set to 0 (the default). + + \sa headingLevel() +*/ + + +/*! + \fn int QTextBlockFormat::headingLevel() const + \since 5.12 + + Returns the paragraph's heading level if it is a heading, or 0 if not. + + \sa setHeadingLevel() +*/ + + /*! \fn void QTextBlockFormat::setLineHeight(qreal height, int heightType) \since 4.8