QT_一些设置一-创新互联

1,
QTextEdit *text_edit;QT_一些设置一

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;                          "
           " }                                                         "
           "}"
       );

创新互联主营潮南网站建设的网络公司,主营网站建设方案,重庆APP开发,潮南h5小程序开发搭建,潮南网站营销推广欢迎潮南等地区企业咨询
网站栏目:QT_一些设置一-创新互联
网站网址:http://scjbc.cn/article/phisi.html

其他资讯