QT_一些设置一-创新互联
QTextEdit *text_edit;
text_edit->append(strline);//自动换行后输入strline
text_edit->insertPlainText(str);//不还换接着输入str
//设置背景色
text_edit->setStyleSheet("QTextEdit { background: rgb(50, 51, 50)}");
3,
void read_file(const char* filename)
{
QFile *file = new QFile;
file->setFileName(filename);
bool ok = file->open(QIODevice::ReadOnly);
if (ok)
{
QTextStream in(file);
ui.text_edit->setText(in.readAll());
file->close();
}
delete file;
}
4,
//自定义进度条
playslider = new QSlider(ui.tab_view);
playslider->setObjectName(QStringLiteral("horizontalSlider"));
playslider->setOrientation(Qt::Horizontal);
playslider->setGeometry(QRect(0, 231, 510, 21));
//playslider->setTickPosition(QSlider::TicksBelow);
//playslider->setTickInterval(5);
playslider->setStyleSheet(
"QSlider::groove:horizontal { "
" height: 20px; "
" margin: 0px 0; "
" left: 12px; right: 12px; "
" background-image:url(:/Resources/background.png) "
" } "
"QSlider::handle:horizontal { "
" border-image:url(:/Resources/redsq.png);"
" width: 3px; "
" margin: -7px -7px -7px -7px; "
" } "
"}"
);
分享标题:QT_一些设置一-创新互联
网页地址:http://scyanting.com/article/phisi.html