How to splash screen a gif video
-
I am trying to splash a gif video while opening my application . But its not playing like a gif video . it spalshes like an image. Is there any way i can make it splash like an 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())); -
this should run when an application icon is clicked .
-
@ManiRon
QLabel will not show animated gif unless setMovie is used. -
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()));
-
@ManiRon
hi
seems fine and i assume its in main.cpp ? -
-
-
@ManiRon
Hi
Please show the complete main.cpp code -
@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()));
-
mrjj Lifetime Qt Championreplied to ManiRon on 4 Sept 2018, 11:40 last edited by mrjj 9 Apr 2018, 11:40
QLabel *processLabel = new QLabel(&w); << u set main win as parent so its shown inside.
if its to be like window BEFORE mainwin comes, use null as parent.
1/53