QtTextDocument::characterCount() return currently 1 even if the document is empty.
The QTextDocument will contain a single paragraph separator (unicode 0x2029)
when it is empty because it contains an empty block. This is a formatting
character, which is invisible, but is still counted as a character in the
This is not documented well and is very misleading.
Users have requested that characterCount should return 0 if the document is empty.