Answer the question
In order to leave comments, you need to log in
How to set up a slider in QTextEdit object from Framework'a Qt 4.7?
There is an instance of the QTextEdit class:
QTextEdit *info2 = new QTextEdit;
info2->setReadOnly(true);
info2->setMinimumHeight(300);
info2->setAlignment(Qt::AlignCenter);
QString str;
QFile LicenseFile("E:/Qt/License.txt");
if (!LicenseFile.open(QIODevice::ReadOnly | QIODevice::Text))
return;
QTextStream in(&LicenseFile);
while (!in.atEnd())
{ str = in.readLine();
info2->append(str);}
LicenseFile.close();
Answer the question
In order to leave comments, you need to log in
The fact is that QTextEdit has automatic scrolling control so that the cursor is always visible (perhaps for something else). Cursor control methods will help you, for example:
edit->moveCursor (QTextCursor::Start); //или QTextCursor::End
edit->ensureCursorVisible() ;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question