PDA

View Full Version : Problem with inserting text into QTextEdit



xorrr
6th February 2006, 12:45
There is next problem. I need to insert QTextBlock at the beginning of document, which attached with QTextEdit without autoscrolling on this position.

I do next:

QTextCursor cursor = textEdit->textCursor();
cursor.movePosition(QTextCursor::Start);

QTextBlockFormat bf;
QTextCharFormat cf;

cursor.insertBlock(bf, cf);
cursor.insertText(text);

After, QTextEdit scrolls at the inserted TextBlock.

PS: I did cursor.scrollToAnchor(anchor), but it is very slow.