How to splash screen a gif video
-
-
@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. -
- 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); ?
-
QTimer::singleShot(5000,movie,SLOT(stop()));
QTimer::singleShot(2500,&w,SLOT(show()));this is what i use but this gif is not displaying now . Now it directly comes to the mainwindow but after the timeout which i have given in that QTimer
-
@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()));
-
@ManiRon
maybe u need processLabel->show(); -
@mrjj while installing an application an pop up will come in which it blurs the background portion and only that pop up will be displayed to select yes or no . In that manner i want the loading gif video should be displayed . Is there any way possible ?
-
@ManiRon
hi
Yes, you can remove the decorations.
https://stackoverflow.com/questions/3948441/how-to-remove-the-window-border-containing-minimize-maximize-and-close-buttons -
@mrjj itsworking sir,
Now i want to align the gif video to play at the centre of the screen.
QLayout *data = new QLayout;
data->alignment(Qt::AlignCenter);
QLabel *processLabel = new QLabel(NULL);
processLabel->setLayout(data);but it showed error . Note : these i am using it in main.cpp
21/53