textedit设置滚动条

textedit设置滚动条

ui->textEdit->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);

ui->textEdit->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);

ui->textEdit->verticalScrollBar()->setValue(ui->textEdit->verticalScrollBar()->maximumHeight());

//滚条设置在最后

ui->textEdit->setLineWrapMode(QTextEdit::NoWrap);

你可能感兴趣的:(text)