当前位置:网站首页>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();
边栏推荐
- LevelDB源码分析之memtable
- 复制宝贝提示材质不能为空,如何解决?
- How to start learning editing? Detailed analysis of zero basis
- AcWing 884. Gauss elimination for solving XOR linear equations
- Global and Chinese market of enterprise wireless LAN 2022-2028: Research Report on technology, participants, trends, market size and share
- LevelDB源码分析之LRU Cache
- 点赞的云函数
- Mathematical knowledge: finding the number of divisors
- C# wpf 使用DockPanel实现截屏框
- Solution: thread 1:[< *> setvalue:forundefined key]: this class is not key value coding compliant for the key*
猜你喜欢
![[RootersCTF2019]babyWeb](/img/b4/aa8f8e107a9dacbace72d4717b1834.png)
[RootersCTF2019]babyWeb

Actual combat: gateway api-2022.2.13

LeetCode1497-检查数组对是否可以被 k 整除-数组-哈希表-计数

Distributed - summary list

Intelligent operation and maintenance: visual management system based on BIM Technology

Explanation of characteristics of hydraulic slip ring

提高企业产品交付效率系列(1)—— 企业应用一键安装和升级

导电滑环使用的注意事项

el-cascader回显失败;el-cascader回显不出来

C WPF uses dockpanel to realize screenshot box
随机推荐
【暑期每日一题】洛谷 P5740【深基7.例9】最厉害的学生
实战:redux的基本使用
[data recovery in North Asia] a data recovery case of raid crash caused by hard disk drop during data synchronization of hot spare disk of RAID5 disk array
[RootersCTF2019]babyWeb
Go learning notes (5) basic types and declarations (4)
Receiving package install and uninstall events
Print stream and system setout();
QDataStream的简单读写验证
CockroachDB 分布式事务源码分析之 TxnCoordSender
Thread process foundation of JUC
C# wpf 使用DockPanel实现截屏框
Pico Neo3手柄抓取物体
在Rainbond中一键部署高可用 EMQX 集群
Simple read / write verification of qdatastream
如何选择导电滑环材料
tar命令
Several methods of creating thread classes
CockroachDB: The Resilient Geo-Distributed SQL Database 论文阅读笔记
HCIP Day13
Global and Chinese market of high-end home theater 2022-2028: Research Report on technology, participants, trends, market size and share