-
Bug
-
Resolution: Done
-
P1: Critical
-
4.7.1
-
None
-
Reproduced on all platforms.
-
fd3fc0b34a891751e6a0849421e8cecd19481324
The following code causes the crash on all platforms:
QTextDocument doc(str); QTextCursor cursor(&doc); cursor.movePosition(QTextCursor::Down, QTextCursor::MoveAnchor, 1); QSignalSpy spy(&doc, SIGNAL(contentsChanged())); doc.markContentsDirty(cursor.position(), cursor.block().length());
Crash is happened in QTextDocument::markContentsDirty method.
d->documentChange(from, length);
if (!d->inContentsChange) {
d->lout->documentChanged(d->docChangeFrom, d->docChangeOldLength, d->docChangeLength);
d->docChangeFrom = -1;
}
QAbstractTextDocumentLayout *lout variable is 0 by default.
This code worked on 4.6.3. If this code is incorrect and layout should be always set before using QTextDocument we will have binary incompatibility between two Qt versions.