×
Namespaces

Variants
Actions
Revision as of 21:52, 17 September 2009 by vkmunjpara (Talk | contribs)

How to display a splash screen in Qt

From Nokia Developer Wiki
Jump to: navigation, search
{{{width}}}


Article Metadata
Tested with
Devices(s): Emulator
Compatibility
Platform(s): S60 3rd Edition FP1, S60 3rd Edition FP2, S60 5th Edition
Symbian
Article
Keywords: QSplashScreen
Created: (12 Jan 2009)
Last edited: vkmunjpara (17 Sep 2009)


Overview

This code snippet demonstrates how to display a splash screen before your application loaded in Qt for S60.

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.QSplashscreen


Preconditions

Various Function

  • Makes the splash screen wait until the widget mainWin is displayed
 splash.finish(&window);
  • Draws the message text onto the splash screen with color color and aligns the text according to the flags in alignment
splash.showMessage("Wait...");

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);
splash.show();
splash.showMessage("Wait...");
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}}");
 
window.show();
splash.finish(&window);
return app.exec();
 
}

Screenshot

More about QSplashscreen.

Splash1.JPG

More about QSplashscreen.

262 page views in the last 30 days.
×