How to splash screen a gif video
-
@ManiRon
HI
Thats the internal aligment :)I assume you mean to center window onthe screen / desktop
https://wiki.qt.io/How_to_Center_a_Window_on_the_Screen -
QMovie *movie = new QMovie("C:/Users/data/Documents/untitled14/200w.gif");
QLabel *processLabel = new QLabel(NULL);
processLabel->setMovie(movie);
movie->start();
processLabel->setWindowFlags(Qt::FramelessWindowHint);
processLabel->setGeometry(
QStyle::alignedRect(
Qt::RightToLeft,
Qt::AlignCenter,
processLabel->size(),
qApp->desktop()->availableGeometry()
));
processLabel->show();This Is my current code
-
#include "mainwindow.h"
#include <QApplication>
#include<QSplashScreen>
#include<QTimer>
#include<QMovie>
#include<QLabel>
#include<QLayout>
#include<QBoxLayout>
#include <QStyle>
#include <QDesktopWidget>int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
QMovie *movie = new QMovie("C:/Users/data/Documents/untitled14/200w.gif");
QLabel *processLabel = new QLabel(NULL);
processLabel->setMovie(movie);
movie->start();
processLabel->setWindowFlags(Qt::FramelessWindowHint);
processLabel->setAlignment(Qt::AlignCenter);
processLabel->setGeometry(
QStyle::alignedRect(
Qt::LeftToRight,
Qt::AlignCenter,
processLabel->size(),
qApp->desktop()->availableGeometry()
)
);
processLabel->show();QTimer::singleShot(2500,processLabel,SLOT(close())); QTimer::singleShot(2500,&w,SLOT(show())); //w.show(); return a.exec();
}
My full main.cpp code