我是靠谱客的博主 痴情中心,最近开发中收集的这篇文章主要介绍QT_一些设置一,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

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_一些设置一所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(40)

评论列表共有 0 条评论

立即
投稿
返回
顶部