After digging the sources I came to QTextCursor::insertText() which is used by setPlainText() and there it is:
|| ch
== QChar::ParagraphSeparator || ch == QTextBeginningOfFrame
|| ch == QTextEndOfFrame
if (!hasEditBlock) {
hasEditBlock = true;
d->priv->beginEditBlock();
}
if (blockEnd > blockStart)
d->priv->insert(d->position, textStart + blockStart, blockEnd - blockStart, formatIdx);
d->insertBlock(blockFmt, format); // Here we go: a new block is inserted
blockStart = i + 1;
}
if (ch == QLatin1Char('\n')
|| ch == QChar::ParagraphSeparator
|| ch == QTextBeginningOfFrame
|| ch == QTextEndOfFrame
|| ch == QLatin1Char('\r')) {
if (!hasEditBlock) {
hasEditBlock = true;
d->priv->beginEditBlock();
}
if (blockEnd > blockStart)
d->priv->insert(d->position, textStart + blockStart, blockEnd - blockStart, formatIdx);
d->insertBlock(blockFmt, format); // Here we go: a new block is inserted
blockStart = i + 1;
}
To copy to clipboard, switch view to plain text mode
Bookmarks