How to splash screen a gif video
-
Hi
You can use QMovieQMovie *movie = new QMovie(":/images/other/images/16x16/loading.gif");
QLabel *processLabel = new QLabel(this);
processLabel->setMovie(movie);
movie->start(); -
@mrjj said in How to splash screen a gif video:
QMovie *movie = new QMovie(":/images/other/images/16x16/loading.gif");
QLabel *processLabel = new QLabel(this);
processLabel->setMovie(movie);
movie->start();previously i used this :
QSplashScreen *splash = new QSplashScreen;
splash->setPixmap(QPixmap("C:/Users/data/Documents/untitled14/giphy.gif")); splash->show();
QTimer::singleShot(2500,movie,SLOT(close()));
QTimer::singleShot(2500,&w,SLOT(show())); -
Now i am trying like this in my main.cpp file :
QMovie *movie = new QMovie("C:/Users/data/Documents/untitled14/giphy.gif");
QLabel *processLabel = new QLabel(&w);
processLabel->setMovie(movie);
movie->start();QTimer::singleShot(2500,movie,SLOT(stop())); QTimer::singleShot(2500,&w,SLOT(show()));
-
@JohanSolo my doubt is i want to display the loading gif first then after a small amount of time the mainwindow. I have added the code which i have used kindly can u see that and point out if there is any mistake sir.
Thanks. -
This is the main.cpp full code sir
QApplication a(argc, argv);
MainWindow w;QMovie *movie = new QMovie("C:/Users/data/Documents/untitled14/200w.gif"); QLabel *processLabel = new QLabel(&w); processLabel->setMovie(movie); movie->start(); QTimer::singleShot(5000,movie,SLOT(stop())); QTimer::singleShot(2500,&w,SLOT(show()));