当前位置:网站首页>Several methods of QT setting loading interface
Several methods of QT setting loading interface
2022-07-28 06:32:00 【Schoolmate Xiaotu!】
Preface
Introduce two methods of setting the loading interface
Static picture display
QSplashScreen splash(QPixmap(":/rec/lancoo7.png"));
splash.setDisabled(true);// The input event of the hexadecimal user corresponds
splash.show();
delayMSec(2000); // Nonblocking delay 2s, Simulate complex programs
splash.close();
delaydelayMSec Functions encapsulate methods for themselves
void MainWindow::delayMSec(unsigned int msec)
{
QTime Time_set = QTime::currentTime().addMSecs(msec);
while( QTime::currentTime() < Time_set )
QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
}
effect

gif Picture shows
QPixmap pixmap(":/rec/gif2.gif");
QMovie movie(":/rec/gif2.gif");
QLabel label;
label.setMovie(&movie);
movie.start();
label.setFixedSize(400,400);
movie.setScaledSize(label.size());
label.move(QApplication::desktop()->width()/2-label.width()/2,QApplication::desktop()->height()/2-label.height()/2); // If there's a mistake here , Then add #include <QDesktopWidget> The header file
label.setWindowFlags(Qt::FramelessWindowHint);// Hide borders
label.setWindowModality(Qt::ApplicationModal); // Block all forms except the current form
label.show();
delayMSec(2000); // Nonblocking delay 2s, Simulate complex programs
movie.stop();
label.close();
effect

Here is the moving picture , But I didn't find that the background was transparent gif picture
Load image resources :
link :https://pan.baidu.com/s/1_varGLRYZ_IywszB9NLC5w
Extraction code :snke
– From Baidu network disk super member V2 The share of
It's not easy to code words , If this blog is helpful to you , Please praise the collection , Thank you very much ! There is something wrong
边栏推荐
- 小程序自定义组件-数据,方法和属性
- JSON笔记
- EMC experiment practical case ESD electrostatic experiment
- 【学习笔记】编码能力
- How to test industrial Ethernet cables (using fluke dsx-8000)?
- Common table expression CTE in Clickhouse
- Beta distribution (probability of probability)
- 根据IP地址和子网掩码求主机所在的网络地址和广播地址
- Trouble encountered in cable testing -- a case study of a manufacturer?
- error: redefinition of ‘xxx‘
猜你喜欢

多个ics日历合并成单个ics日历

Servlet

【YOLOv5】环境搭建:Win11 + mx450

What about the insufficient memory of Clickhouse aggregation? Then improve the polymerization performance

ConNeXt

Fluke dtx-1800 and its accessories dtx-cha002 channel adapter channel replacement RJ45 socket notes

Matlab 信号处理

Pytorch learning notes 3 - datasets & dataloaders & transforms

自定义组件--纯数据字段&组件的生命周期

mysql join技巧
随机推荐
VI and VIM commands
USB network native driver for esxi updated to support esxi7.0.1
小程序创建组件
IMS-FACNN(Improved Multi-Scale Convolution Neural Network integrated with a Feature Attention Mecha
[server usage record] log in to the remote server through the springboard machine and transfer files
Hugging face 的入门使用
雷达成像 Matlab 仿真 4 —— 距离分辨率分析
qt中Qthread线程的使用以及安全关闭
Exploration of Clickhouse aggregation internal mechanism of aggregation
Perl入门学习(八)子程序
机器学习笔记 5 —— Logistic Regression
Paper artifact vs code + latex + latex workshop
Pytorch learning notes 3 - datasets & dataloaders & transforms
小程序自定义组件-数据,方法和属性
Efficient Net_ V2
基于 YOLOV5 的 SAR 图像舰船检测
Servlet
毕业论文 | 文献综述应该怎么写
自定义组件--数据监听器
Five categories of IP addresses