Doc: Update description of QTextDocument::characterCount

A QTextDocument always contains a QChar::ParagraphSeparator, so
characterCount() will always return actual count + 1.
The tests confirm this behavior, make it explicit in the docs.

Fixes: QTBUG-80597
Change-Id: I91040fb6eb2c4fae5235458c695110f8f15bdfea
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
bb10
Paul Wicking 2020-02-13 12:56:07 +01:00
parent 7981dbfaf3
commit d1186f9299
1 changed files with 3 additions and 0 deletions

View File

@ -904,6 +904,9 @@ int QTextDocument::lineCount() const
Returns the number of characters of this document.
\note As a QTextDocument always contains at least one
QChar::ParagraphSeparator, this method will return at least 1.
\sa blockCount(), characterAt()
*/
int QTextDocument::characterCount() const