How to splash screen a gif video
-
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()));
-
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()));
-
@mrjj when i ran this i got QObject::connect: No such slot QMovie::close() in main.cpp:23 this error
Hi
well, it means QMovie do not have a close slot.
it has
so maybe you mean stop ?
-
@ManiRon This means you didn't put properly the
QLabel
in a layout or set it as the central widget.@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()));
-
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()));
-
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. -
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. -
- QLabel *processLabel = new QLabel(NULL); ?
Yes. will make it window.'
Yes, it should be.
Just dont call w.show() before u want to. - QLabel *processLabel = new QLabel(NULL); ?
-
- QLabel *processLabel = new QLabel(NULL); ?
Yes. will make it window.'
Yes, it should be.
Just dont call w.show() before u want to.@mrjj
Now This is my code in Main.cpp
QMovie *movie = new QMovie("C:/Users/data/Documents/untitled14/200w.gif");
QLabel *processLabel = new QLabel(NULL);
processLabel->setMovie(movie);
movie->start();QTimer::singleShot(2500,movie,SLOT(stop())); QTimer::singleShot(2500,&w,SLOT(show()));
- QLabel *processLabel = new QLabel(NULL); ?