You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
183 lines
6.6 KiB
183 lines
6.6 KiB
'\" t
|
|
.TH QSplashScreen 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
|
|
.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
|
|
.\" license file included in the distribution for a complete license
|
|
.\" statement.
|
|
.\"
|
|
.ad l
|
|
.nh
|
|
.SH NAME
|
|
QSplashScreen \- Splash screen that can be shown during application startup
|
|
.SH SYNOPSIS
|
|
\fC#include <ntqsplashscreen.h>\fR
|
|
.PP
|
|
Inherits QWidget.
|
|
.PP
|
|
.SS "Public Members"
|
|
.in +1c
|
|
.ti -1c
|
|
.BI "\fBQSplashScreen\fR ( const QPixmap & pixmap = QPixmap ( ), WFlags f = 0 )"
|
|
.br
|
|
.ti -1c
|
|
.BI "virtual \fB~QSplashScreen\fR ()"
|
|
.br
|
|
.ti -1c
|
|
.BI "void \fBsetPixmap\fR ( const QPixmap & pixmap )"
|
|
.br
|
|
.ti -1c
|
|
.BI "QPixmap * \fBpixmap\fR () const"
|
|
.br
|
|
.ti -1c
|
|
.BI "void \fBfinish\fR ( QWidget * mainWin )"
|
|
.br
|
|
.ti -1c
|
|
.BI "void \fBrepaint\fR ()"
|
|
.br
|
|
.in -1c
|
|
.SS "Public Slots"
|
|
.in +1c
|
|
.ti -1c
|
|
.BI "void \fBmessage\fR ( const QString & message, int alignment = AlignLeft, const QColor & color = black )"
|
|
.br
|
|
.ti -1c
|
|
.BI "void \fBclear\fR ()"
|
|
.br
|
|
.in -1c
|
|
.SS "Signals"
|
|
.in +1c
|
|
.ti -1c
|
|
.BI "void \fBmessageChanged\fR ( const QString & message )"
|
|
.br
|
|
.in -1c
|
|
.SS "Protected Members"
|
|
.in +1c
|
|
.ti -1c
|
|
.BI "virtual void \fBdrawContents\fR ( QPainter * painter )"
|
|
.br
|
|
.in -1c
|
|
.SH DESCRIPTION
|
|
The QSplashScreen widget provides a splash screen that can be shown during application startup.
|
|
.PP
|
|
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.
|
|
.PP
|
|
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.
|
|
.PP
|
|
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.
|
|
.PP
|
|
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.
|
|
.PP
|
|
.nf
|
|
.br
|
|
int main( int argc, char **argv )
|
|
.br
|
|
{
|
|
.br
|
|
QApplication app( argc, argv );
|
|
.br
|
|
QPixmap pixmap( "splash.png" );
|
|
.br
|
|
QSplashScreen *splash = new QSplashScreen( pixmap );
|
|
.br
|
|
splash->show();
|
|
.br
|
|
QMainWindow *mainWin = new QMainWindow;
|
|
.br
|
|
...
|
|
.br
|
|
app.setMainWidget( mainWin );
|
|
.br
|
|
mainWin->show();
|
|
.br
|
|
splash->finish( mainWin );
|
|
.br
|
|
delete splash;
|
|
.br
|
|
return app.exec();
|
|
.br
|
|
}
|
|
.br
|
|
.fi
|
|
.PP
|
|
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().
|
|
.PP
|
|
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.
|
|
.PP
|
|
.nf
|
|
.br
|
|
QPixmap pixmap( "splash.png" );
|
|
.br
|
|
QSplashScreen *splash = new QSplashScreen( pixmap );
|
|
.br
|
|
splash->show();
|
|
.br
|
|
... // Loading some items
|
|
.br
|
|
splash->message( "Loaded modules" );
|
|
.br
|
|
tqApp->processEvents();
|
|
.br
|
|
... // Establishing connections
|
|
.br
|
|
splash->message( "Established connections" );
|
|
.br
|
|
tqApp->processEvents();
|
|
.br
|
|
.fi
|
|
.PP
|
|
See also Miscellaneous Classes.
|
|
.SH MEMBER FUNCTION DOCUMENTATION
|
|
.SH "QSplashScreen::QSplashScreen ( const QPixmap & pixmap = QPixmap ( ), WFlags f = 0 )"
|
|
Construct a splash screen that will display the \fIpixmap\fR.
|
|
.PP
|
|
There should be no need to set the widget flags, \fIf\fR, except perhaps WDestructiveClose or WStyle_StaysOnTop.
|
|
.SH "QSplashScreen::~QSplashScreen ()\fC [virtual]\fR"
|
|
Destructor.
|
|
.SH "void QSplashScreen::clear ()\fC [slot]\fR"
|
|
Removes the message being displayed on the splash screen
|
|
.PP
|
|
See also message().
|
|
.SH "void QSplashScreen::drawContents ( QPainter * painter )\fC [virtual protected]\fR"
|
|
Draw the contents of the splash screen using painter \fIpainter\fR. The default implementation draws the message passed by message(). Reimplement this function if you want to do your own drawing on the splash screen.
|
|
.SH "void QSplashScreen::finish ( QWidget * mainWin )"
|
|
Makes the splash screen wait until the widget \fImainWin\fR is displayed before calling close() on itself.
|
|
.SH "void QSplashScreen::message ( const QString & message, int alignment = AlignLeft, const QColor & color = black )\fC [slot]\fR"
|
|
Draws the \fImessage\fR text onto the splash screen with color \fIcolor\fR and aligns the text according to the flags in \fIalignment\fR.
|
|
.PP
|
|
See also Qt::AlignmentFlags and clear().
|
|
.SH "void QSplashScreen::messageChanged ( const QString & message )\fC [signal]\fR"
|
|
This signal is emitted when the message on the splash screen changes. \fImessage\fR is the new message and is a null-string when the message has been removed.
|
|
.PP
|
|
See also message() and clear().
|
|
.SH "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.
|
|
.SH "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.
|
|
.SH "void QSplashScreen::setPixmap ( const QPixmap & pixmap )"
|
|
Sets the pixmap that will be used as the splash screen's image to
|
|
\fIpixmap\fR.
|
|
|
|
.SH "SEE ALSO"
|
|
.BR http://doc.trolltech.com/ntqsplashscreen.html
|
|
.BR http://www.trolltech.com/faq/tech.html
|
|
.SH COPYRIGHT
|
|
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
|
|
license file included in the distribution for a complete license
|
|
statement.
|
|
.SH AUTHOR
|
|
Generated automatically from the source code.
|
|
.SH BUGS
|
|
If you find a bug in Qt, please report it as described in
|
|
.BR http://doc.trolltech.com/bughowto.html .
|
|
Good bug reports help us to help you. Thank you.
|
|
.P
|
|
The definitive Qt documentation is provided in HTML format; it is
|
|
located at $QTDIR/doc/html and can be read using Qt Assistant or with
|
|
a web browser. This man page is provided as a convenience for those
|
|
users who prefer man pages, although this format is not officially
|
|
supported by Trolltech.
|
|
.P
|
|
If you find errors in this manual page, please report them to
|
|
.BR qt-bugs@trolltech.com .
|
|
Please include the name of the manual page (tqsplashscreen.3qt) and the Qt
|
|
version (3.3.8).
|