当前位置:网站首页>QT等待框制作
QT等待框制作
2022-07-01 05:16:00 【rainbow_lucky0106】
QMovie + GIF
#include "DWaitProcessDlg.h"
DWaitProcessDlg::DWaitProcessDlg(const QString &title, QWidget *parent) : QDialog(parent)
{
this->setFixedSize(100, 100);
this->setWindowOpacity(0.8);
this->setWindowFlags(Qt::FramelessWindowHint | Qt::Dialog);
this->setAttribute(Qt::WA_TranslucentBackground, true);
m_frameBg = new QFrame(this);
m_frameBg->setStyleSheet("background-color: rgb(55, 135,215); border-radius:10px;");
m_frameBg->setGeometry(0, 0, 100, 100);
m_labelLogo = new QLabel(m_frameBg);
m_labelLogo->setStyleSheet("background-color:transparent;");
m_labelLogo->setGeometry(30, 15, 40, 40);
m_movieLogo = new QMovie(":/Resource/images/spinner.svg");
m_labelLogo->setScaledContents(true);
m_labelLogo->setMovie(m_movieLogo);
m_labelTip = new QLabel(m_frameBg);
m_labelTip->setText(title);
m_labelTip->setStyleSheet("color: white;background-color: transparent;");
m_labelTip->setGeometry(10, 70, 80, 20);
m_movieLogo->start();
}
DWaitProcessDlg::~DWaitProcessDlg()
{
m_movieLogo->stop();
delete m_labelLogo;
delete m_movieLogo;
delete m_labelLogo;
delete m_frameBg;
}
调用方式
QApplication::setOverrideCursor(Qt::WaitCursor);//设置鼠标为等待状态
QString strTip = "导出数据中...";
DWaitProcessDlg *pWaitDlg = new DWaitProcessDlg(strTip, this);
pWaitDlg->show();
for(int i=0; i<list.count(); i++)
{
QCoreApplication::processEvents();
}
QApplication::restoreOverrideCursor();
pWaitDlg->close();
边栏推荐
- 3D建模與處理軟件簡介 劉利剛 中國科技大學
- 积分商城游戏能够给商家带来什么?怎么搭建积分商城?
- Variable binding and deconstruction for rudimentary rust
- CockroachDB 分布式事务源码分析之 TxnCoordSender
- Ebpf cilium practice (2) - underlying network observability
- Tar command
- [daily question in summer] Luogu p2026 find the analytic formula of primary function
- HCIP Day13
- Implementation of distributed lock
- Global and Chinese markets for business weather forecasting 2022-2028: Research Report on technology, participants, trends, market size and share
猜你喜欢

云原生存储解决方案Rook-Ceph与Rainbond结合的实践

Sqlplus connects using the instance name

导电滑环短路的原因以及应对措施

Causes of short circuit of conductive slip ring and Countermeasures
![[RootersCTF2019]babyWeb](/img/b4/aa8f8e107a9dacbace72d4717b1834.png)
[RootersCTF2019]babyWeb

CockroachDB 分布式事务源码分析之 TxnCoordSender

How to traverse massive data in redis

【暑期每日一题】洛谷 P5886 Hello, 2020!

busybox生成的东西

LeetCode522-最长特殊序列II-哈希表-字符串-双指针
随机推荐
How to meet the requirements of source code confidentiality and source code security management
Global and Chinese market of high-end home theater 2022-2028: Research Report on technology, participants, trends, market size and share
FileOutPutStream
[daily question in summer] Luogu p1568 race
Copy baby prompt: material cannot be empty. How to solve it?
Causes of short circuit of conductive slip ring and Countermeasures
【暑期每日一题】洛谷 P5886 Hello, 2020!
【暑期每日一题】洛谷 P7222 [RC-04] 信息学竞赛
HCIP Day13
JS random verification code
AcWing 884. Gauss elimination for solving XOR linear equations
Use and principle of wait notify
Rainbow combines neuvector to practice container safety management
【暑期每日一题】洛谷 P5740【深基7.例9】最厉害的学生
[daily question in summer] Luogu p2026 find the analytic formula of primary function
Distributed - summary list
Global and Chinese market of mainboard 2022-2028: Research Report on technology, participants, trends, market size and share
【暑期每日一题】洛谷 P1568 赛跑
And search: the suspects (find the number of people related to the nth person)
Lock free concurrency of JUC (leguan lock)