概述
1,
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; "
" } "
"}"
);
转载于:https://www.cnblogs.com/liuhan333/p/6400719.html
最后
以上就是痴情中心为你收集整理的QT_一些设置一的全部内容,希望文章能够帮你解决QT_一些设置一所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复