QT:等待对话框

1. gif动图显示等待对话框

#include "waitting.h"
#include "ui_waitting.h"

Waitting::Waitting(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Waitting)
{
    ui->setupUi(this);
    this->setWindowOpacity(0.8);

    setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint);//设置为对话框风格,并且去掉边框
    setWindowModality(Qt::ApplicationModal);//设置为模式对话框,同时在构造该对话框时要设置父窗口
    ui->label_waitting->setStyleSheet("background-color: transparent;");
    m_gif = new QMovie("qrc:/../Img/1.gif");
    ui->label_waitting->setMovie(m_gif);
    ui->label_waitting->setScaledContents(true);
    m_gif->start();
}

Waitting::~Waitting()
{
    m_gif->stop();
    delete ui;
}

2. QProgressBar 显示进度条

你可能感兴趣的:(QT)