十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
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; "
" } "
"}"
);