Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.4.2
-
None
Description
The documentation says that the 3rd parameter of QAbstractTextDocumentLayout::documentChanged should receive the number of characters added to the document.
However, dozens of functions in QTextDocument call this method to invalidate the layout, passing as the 3rd parameter the total number of characters in the document, even though no change to the number of characters were made. For example, QTextDocument::setDefaultFont (and other setters):
void QTextDocument::setDefaultFont(const QFont &font) { Q_D(QTextDocument); d->setDefaultFont(font); if (d->lout) d->lout->documentChanged(0, 0, d->length()); } [...] void QTextDocument::setDefaultTextOption(const QTextOption &option) { Q_D(QTextDocument); d->defaultTextOption = option; if (d->lout) d->lout->documentChanged(0, 0, d->length()); }
This makes this function unsuited for position tracking in the layout. Besides, it disagrees with what documentation says.