当前位置:网站首页>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();
边栏推荐
- Principle, technology and implementation scheme of data consistency in distributed database
- C WPF uses dockpanel to realize screenshot box
- Usage and principle of synchronized
- 复制宝贝提示材质不能为空,如何解决?
- How to start learning editing? Detailed analysis of zero basis
- 【暑期每日一题】洛谷 P5740【深基7.例9】最厉害的学生
- 点赞的云函数
- el-form表单新增表单项动态校验;el-form校验动态表单v-if不生效;
- Single page application
- Serialization and deserialization of objects
猜你喜欢
在Rainbond中一键部署高可用 EMQX 集群
Series of improving enterprise product delivery efficiency (1) -- one click installation and upgrade of enterprise applications
Day 05 - file operation function
busybox生成的东西
Use and principle of wait notify
0xc000007b应用程序无法正常启动解决方案(亲测有效)
STM32 expansion board digital tube display
Usage and principle of synchronized
Manually implement a simple stack
【暑期每日一题】洛谷 P5886 Hello, 2020!
随机推荐
How to start learning editing? Detailed analysis of zero basis
LevelDB源码分析之memtable
Is there any good website or software for learning programming? [introduction to programming]?
Character input stream and character output stream
Actual combat: gateway api-2022.2.13
One click deployment of highly available emqx clusters in rainbow
Mathematical knowledge: finding the number of divisors
Global and Chinese market of enterprise wireless LAN 2022-2028: Research Report on technology, participants, trends, market size and share
Lock free concurrency of JUC (leguan lock)
Programmers dig "holes" to get rich: if they find a loophole, they will be rewarded 12.72 million yuan
[daily question in summer] Luogu p2026 find the analytic formula of primary function
使用 Nocalhost 开发 Rainbond 上的微服务应用
Application of industrial conductive slip ring
Global and Chinese market of paper machine systems 2022-2028: Research Report on technology, participants, trends, market size and share
Global and Chinese markets of Ethernet communication modules 2022-2028: Research Report on technology, participants, trends, market size and share
Application and principle of ThreadPoolExecutor thread pool
busybox生成的东西
Explanation of characteristics of hydraulic slip ring
How to hide browser network IP address and modify IP internet access?
Rust hello-word