Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

How to display a splash screen in Qt

From Wiki
Jump to: navigation, search
Article Metadata
Tested with
Devices(s): Emulator
Platform(s): S60 3rd Edition FP1, S60 3rd Edition FP2, S60 5th Edition
Keywords: QSplashScreen
Created: james1980 (12 Jan 2009)
Last edited: hamishwillee (11 Oct 2012)



This code snippet demonstrates how to display a splash screen before your application loaded using QSplashScreen.

A splash screen is a widget that is usually displayed when an application is being started. Splash screens are often used for applications that have long start up times (e.g. database or networking applications that take time to establish connections) to provide the user with feedback that the application is loading. The splash screen may usually appear in the center of the screen.


  • Download and install the Qt SDK

Various Function

  • Makes the splash screen wait until the widget mainWin is displayed
  • Draws the message text onto the splash screen with color and aligns the text according to the flags in alignment

Source File

#include <QApplication>
#include <QPixmap>
#include <QSplashScreen>
#include <QWidget>
#include <QMainWindow>
int main(int argc, char *argv[])
QApplication app(argc, argv);
QPixmap pixmap("c://designer.png");
QSplashScreen splash(pixmap);;
qApp->processEvents();//This is used to accept a click on the screen so that user can cancel the screen
QMainWindow window;
window.setStyleSheet("* { background-color:rgb(199,147,88); padding: 7px}");;
return app.exec();




This page was last modified on 11 October 2012, at 01:17.
176 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.