PDA

View Full Version : how to scroll a textbrowser ?



kumari arpita
10th August 2012, 08:17
Hi,

I have tried to scroll my textbrowser .But i am not able to do .



QString currmsg = "The Koran. \nfdfjk .\nncdfjklgjf.\njdfkhjdfk";


QTextCursor *temp = new QTextCursor(ui->textBrowser->textCursor());
temp->insertText(currmsg);

temp->insertBlock();
delete temp;


ui->textBrowser->setStyleSheet("color:black");



Thanx

sonulohani
10th August 2012, 08:33
QTextCursor cursor = ui->textBrowser->textCursor();
cursor.setPosition(0);
ui->textBrowser->setTextCursor(cursor);

BalaQT
10th August 2012, 08:56
hi,

When the text size is more, the scroll bar will come automatically.

hope it helps,
bala