Skip to content

QSplashScreen

The QSplashScreen widget provides a splash screen that can be shown during application startup.

Example

Display QSplashScreen.

#include <QApplication>
#include <QPixmap>
#include <QSplashScreen>
#include <QTimer>

#include "mainwindow.h"

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    QSplashScreen *splash = new QSplashScreen;
    splash->setPixmap(QPixmap(":/res/ic_launcher.png"));
    splash->show();

    MainWindow mainwindow;

    QTimer::singleShot(2500, splash, SLOT(close()));
    QTimer::singleShot(2500, &mainwindow, SLOT(show()));

    return app.exec();
}

Favorite site