Eneboo - Documentación para desarrolladores
Slots públicos | Señales | Métodos públicos | Métodos protegidos
Referencia de la Clase QSplashScreen

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

#include <qsplashscreen.h>

Diagrama de herencias de QSplashScreen
QWidget QWidget QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject

Lista de todos los miembros.

Slots públicos

void message (const QString &str, int flags=AlignLeft, const QColor &color=black)
void clear ()
void message (const QString &str, int flags=AlignLeft, const QColor &color=black)
void clear ()

Señales

void messageChanged (const QString &str)
void messageChanged (const QString &str)

Métodos públicos

 QSplashScreen (const QPixmap &pixmap=QPixmap(), WFlags f=0)
virtual ~QSplashScreen ()
void setPixmap (const QPixmap &pixmap)
QPixmappixmap () const
void finish (QWidget *w)
void repaint ()
 QSplashScreen (const QPixmap &pixmap=QPixmap(), WFlags f=0)
virtual ~QSplashScreen ()
void setPixmap (const QPixmap &pixmap)
QPixmappixmap () const
void finish (QWidget *w)
void repaint ()

Métodos protegidos

virtual void drawContents (QPainter *painter)
void mousePressEvent (QMouseEvent *)
virtual void drawContents (QPainter *painter)
void mousePressEvent (QMouseEvent *)

Descripción detallada

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

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 appears centered on the screen. It may be useful to add the WStyle_StaysOnTop if you desire to keep above all the windows in the GUI.

Some X11 window managers do not support the "stays on top" flag. A solution is to set up a timer that periodically calls raise() on the splash screen to simulate the "stays on top" effect.

The most common usage is to show a splash screen before the main widget is displayed on the screen. This is illustrated in the following code snippet.

   int main( int argc, char **argv )
   {
       QApplication app( argc, argv );
       QPixmap pixmap( "splash.png" );
       QSplashScreen *splash = new QSplashScreen( pixmap );
       splash->show();
       QMainWindow *mainWin = new QMainWindow;
       ...
       app.setMainWidget( mainWin );
       mainWin->show();
       splash->finish( mainWin );
       delete splash;
       return app.exec();
   }

It is sometimes useful to update the splash screen with messages, for example, announcing connections established or modules loaded as the application starts up. QSplashScreen supports this with the message() function. If you wish to do your own drawing you can get a pointer to the pixmap used in the splash screen with pixmap(). Alternatively, you can subclass QSplashScreen and reimplement drawContents().

The user can hide the splash screen by clicking on it with the mouse. Since the splash screen is typically displayed before the event loop has started running, it is necessary to periodically call QApplication::processEvents() to receive the mouse clicks.

   QPixmap pixmap( "splash.png" );
   QSplashScreen *splash = new QSplashScreen( pixmap );
   splash->show();
   ... // Loading some items
   splash->message( "Loaded modules" );
   qApp->processEvents();
   ... // Establishing connections
   splash->message( "Established connections" );
   qApp->processEvents();

Documentación del constructor y destructor

QSplashScreen::QSplashScreen ( const QPixmap pixmap = QPixmap(),
WFlags  f = 0 
)

Construct a splash screen that will display the pixmap.

There should be no need to set the widget flags, f, except perhaps WDestructiveClose or WStyle_StaysOnTop.

QSplashScreen::~QSplashScreen ( ) [virtual]

Destructor.

QSplashScreen::QSplashScreen ( const QPixmap pixmap = QPixmap(),
WFlags  f = 0 
)
virtual QSplashScreen::~QSplashScreen ( ) [virtual]

Documentación de las funciones miembro

void QSplashScreen::clear ( void  ) [slot]

Removes the message being displayed on the splash screen

Ver también:
message()
void QSplashScreen::clear ( ) [slot]
void QSplashScreen::drawContents ( QPainter painter) [protected, virtual]

Draw the contents of the splash screen using painter painter. The default implementation draws the message passed by message(). Reimplement this function if you want to do your own drawing on the splash screen.

virtual void QSplashScreen::drawContents ( QPainter painter) [protected, virtual]
void QSplashScreen::finish ( QWidget w)
void QSplashScreen::finish ( QWidget mainWin)

Makes the splash screen wait until the widget mainWin is displayed before calling close() on itself.

void QSplashScreen::message ( const QString message,
int  alignment = AlignLeft,
const QColor color = black 
) [slot]

Draws the message text onto the splash screen with color color and aligns the text according to the flags in alignment.

Ver también:
Qt::AlignmentFlags clear()
void QSplashScreen::message ( const QString str,
int  flags = AlignLeft,
const QColor color = black 
) [slot]
void QSplashScreen::messageChanged ( const QString str) [signal]
QSplashScreen::messageChanged ( const QString message) [signal]

This signal is emitted when the message on the splash screen changes. message is the new message and is a null-string when the message has been removed.

Ver también:
message(), clear()
void QSplashScreen::mousePressEvent ( QMouseEvent ) [protected, virtual]

Reimplementado de QWidget.

void QSplashScreen::mousePressEvent ( QMouseEvent e) [protected, virtual]

This event handler, for event e, can be reimplemented in a subclass to receive mouse press events for the widget.

If you create new widgets in the mousePressEvent() the mouseReleaseEvent() may not end up where you expect, depending on the underlying window system (or X11 window manager), the widgets' location and maybe more.

The default implementation implements the closing of popup widgets when you click outside the window. For other widget types it does nothing.

Ver también:
mouseReleaseEvent(), mouseDoubleClickEvent(), mouseMoveEvent(), event(), QMouseEvent

Reimplementado de QWidget.

QPixmap* QSplashScreen::pixmap ( ) const
QPixmap * QSplashScreen::pixmap ( ) const

Returns the pixmap that is used in the splash screen. The image does not have any of the text drawn by message() calls.

void QSplashScreen::repaint ( )

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.

This version erases and repaints the entire widget.

Reimplementado de QWidget.

void QSplashScreen::repaint ( )

This overrides QWidget::repaint(). It differs from the standard repaint function in that it also calls QApplication::flush() to ensure the updates are displayed, even when there is no event loop present.

Reimplementado de QWidget.

void QSplashScreen::setPixmap ( const QPixmap pixmap)
void QSplashScreen::setPixmap ( const QPixmap pixmap)

Sets the pixmap that will be used as the splash screen's image to pixmap.


La documentación para esta clase fue generada a partir de los siguientes ficheros:
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'