jjzjj

qsplashscreen

全部标签

c++ - Qt 启动画面不显示

我有这段代码,我希望它显示启动画面,因为它会更大,已经制作了一种计时器,因此可以看到启动画面的工作。问题是我没有看到启动画面,但是代码会在启动画面没有出现时运行,直接将我发送到主窗口而不显示splas屏幕。这是我的代码。主要.cpp#include#include#include#include"splashwindow.h"#include"mainwindow.h"#include"database.h"intmain(intargc,char*argv[]){/*Definetheapp*/QApplicationapp(argc,argv);/*Definethesplashs

c++ - Qt : Display a picture during application loading

我想为加载缓慢的应用程序添加启动画面。我已经创建了一个简单的应用程序来测试。main.cpp:intmain(intargc,char*argv[]){QApplicationapp(argc,argv);QPixmappixmap("/home/helene/Images/my_image.png");if(pixmap.isNull()){pixmap=QPixmap(300,300);pixmap.fill(Qt::magenta);}QSplashScreen*splash=newQSplashScreen(pixmap);splash->show();splash->show