I have the folling code: (textBrowser is a QTextBrowser)
textBrowser->clear();
textBrowser->append("String with 100 lines of text");
textBrowser
->textCursor
().
movePosition(QTextCursor::Start);
textBrowser->ensureCursorVisible();
textBrowser->clear();
textBrowser->append("String with 100 lines of text");
textBrowser->textCursor().movePosition(QTextCursor::Start);
textBrowser->ensureCursorVisible();
To copy to clipboard, switch view to plain text mode
I thought this would make the beginning of the text visible for the user. But unfortunatly the cursor rest at the end of the text ( textBroser->textCursor().atEnd() returns true ).
I tried a work around with setting an named anchor at the beginning of the test, which works fine - but my app continues to write at the end. If I move to the beginning of the text with the keyboard pressing <ctrl+home> the windows stays very nice at the beginning - the anchor is some pixels lower, and the window continues to scroll.
now - how to move the window to the same state as <ctrl+home> does?
Thanks for your time,
Klaus
Bookmarks