1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
---|
2 | <!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/widgets/qsplashscreen.cpp:53 -->
|
---|
3 | <html>
|
---|
4 | <head>
|
---|
5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
6 | <title>QSplashScreen Class</title>
|
---|
7 | <style type="text/css"><!--
|
---|
8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
9 | a:link { color: #004faf; text-decoration: none }
|
---|
10 | a:visited { color: #672967; text-decoration: none }
|
---|
11 | body { background: #ffffff; color: black; }
|
---|
12 | --></style>
|
---|
13 | </head>
|
---|
14 | <body>
|
---|
15 |
|
---|
16 | <table border="0" cellpadding="0" cellspacing="0" width="100%">
|
---|
17 | <tr bgcolor="#E5E5E5">
|
---|
18 | <td valign=center>
|
---|
19 | <a href="index.html">
|
---|
20 | <font color="#004faf">Home</font></a>
|
---|
21 | | <a href="classes.html">
|
---|
22 | <font color="#004faf">All Classes</font></a>
|
---|
23 | | <a href="mainclasses.html">
|
---|
24 | <font color="#004faf">Main Classes</font></a>
|
---|
25 | | <a href="annotated.html">
|
---|
26 | <font color="#004faf">Annotated</font></a>
|
---|
27 | | <a href="groups.html">
|
---|
28 | <font color="#004faf">Grouped Classes</font></a>
|
---|
29 | | <a href="functions.html">
|
---|
30 | <font color="#004faf">Functions</font></a>
|
---|
31 | </td>
|
---|
32 | <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QSplashScreen Class Reference</h1>
|
---|
33 |
|
---|
34 | <p>The QSplashScreen widget provides a splash screen that can
|
---|
35 | be shown during application startup.
|
---|
36 | <a href="#details">More...</a>
|
---|
37 | <p><tt>#include <<a href="qsplashscreen-h.html">qsplashscreen.h</a>></tt>
|
---|
38 | <p>Inherits <a href="qwidget.html">QWidget</a>.
|
---|
39 | <p><a href="qsplashscreen-members.html">List of all member functions.</a>
|
---|
40 | <h2>Public Members</h2>
|
---|
41 | <ul>
|
---|
42 | <li class=fn><a href="#QSplashScreen"><b>QSplashScreen</b></a> ( const QPixmap & pixmap = QPixmap ( ), WFlags f = 0 )</li>
|
---|
43 | <li class=fn>virtual <a href="#~QSplashScreen"><b>~QSplashScreen</b></a> ()</li>
|
---|
44 | <li class=fn>void <a href="#setPixmap"><b>setPixmap</b></a> ( const QPixmap & pixmap )</li>
|
---|
45 | <li class=fn>QPixmap * <a href="#pixmap"><b>pixmap</b></a> () const</li>
|
---|
46 | <li class=fn>void <a href="#finish"><b>finish</b></a> ( QWidget * mainWin )</li>
|
---|
47 | <li class=fn>void <a href="#repaint"><b>repaint</b></a> ()</li>
|
---|
48 | </ul>
|
---|
49 | <h2>Public Slots</h2>
|
---|
50 | <ul>
|
---|
51 | <li class=fn>void <a href="#message"><b>message</b></a> ( const QString & message, int alignment = AlignLeft, const QColor & color = black )</li>
|
---|
52 | <li class=fn>void <a href="#clear"><b>clear</b></a> ()</li>
|
---|
53 | </ul>
|
---|
54 | <h2>Signals</h2>
|
---|
55 | <ul>
|
---|
56 | <li class=fn>void <a href="#messageChanged"><b>messageChanged</b></a> ( const QString & message )</li>
|
---|
57 | </ul>
|
---|
58 | <h2>Protected Members</h2>
|
---|
59 | <ul>
|
---|
60 | <li class=fn>virtual void <a href="#drawContents"><b>drawContents</b></a> ( QPainter * painter )</li>
|
---|
61 | </ul>
|
---|
62 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
63 |
|
---|
64 |
|
---|
65 | The QSplashScreen widget provides a splash screen that can
|
---|
66 | be shown during application startup.
|
---|
67 | <p>
|
---|
68 |
|
---|
69 | <p> A splash screen is a widget that is usually displayed when an
|
---|
70 | application is being started. Splash screens are often used for
|
---|
71 | applications that have long start up times (e.g. database or
|
---|
72 | networking applications that take time to establish connections) to
|
---|
73 | provide the user with feedback that the application is loading.
|
---|
74 | <p> The splash screen appears centered on the screen. It may be useful to add
|
---|
75 | the <a href="qt.html#WidgetFlags-enum">WStyle_StaysOnTop</a> if you desire to keep above all the windows in the
|
---|
76 | GUI.
|
---|
77 | <p> Some X11 window managers do not support the "stays on top" flag. A
|
---|
78 | solution is to set up a timer that periodically calls <a href="qwidget.html#raise">raise</a>() on
|
---|
79 | the splash screen to simulate the "stays on top" effect.
|
---|
80 | <p> The most common usage is to show a splash screen before the main
|
---|
81 | widget is displayed on the screen. This is illustrated in the
|
---|
82 | following code snippet.
|
---|
83 | <p> <pre>
|
---|
84 | int main( int argc, char **argv )
|
---|
85 | {
|
---|
86 | <a href="qapplication.html">QApplication</a> app( argc, argv );
|
---|
87 | <a href="qpixmap.html">QPixmap</a> pixmap( "splash.png" );
|
---|
88 | QSplashScreen *splash = new QSplashScreen( pixmap );
|
---|
89 | splash-><a href="qwidget.html#show">show</a>();
|
---|
90 | <a href="qmainwindow.html">QMainWindow</a> *mainWin = new <a href="qmainwindow.html">QMainWindow</a>;
|
---|
91 | ...
|
---|
92 | app.<a href="qapplication.html#setMainWidget">setMainWidget</a>( mainWin );
|
---|
93 | mainWin-><a href="qwidget.html#show">show</a>();
|
---|
94 | splash-><a href="#finish">finish</a>( mainWin );
|
---|
95 | delete splash;
|
---|
96 | return app.<a href="qapplication.html#exec">exec</a>();
|
---|
97 | }
|
---|
98 | </pre>
|
---|
99 |
|
---|
100 | <p> It is sometimes useful to update the splash screen with messages,
|
---|
101 | for example, announcing connections established or modules loaded
|
---|
102 | as the application starts up. QSplashScreen supports this with the
|
---|
103 | <a href="#message">message</a>() function. If you wish to do your own drawing you can
|
---|
104 | get a pointer to the pixmap used in the splash screen with <a href="#pixmap">pixmap</a>().
|
---|
105 | Alternatively, you can subclass QSplashScreen and reimplement
|
---|
106 | <a href="#drawContents">drawContents</a>().
|
---|
107 | <p> The user can hide the splash screen by clicking on it with the
|
---|
108 | mouse. Since the splash screen is typically displayed before the
|
---|
109 | event loop has started running, it is necessary to periodically
|
---|
110 | call <a href="qapplication.html#processEvents">QApplication::processEvents</a>() to receive the mouse clicks.
|
---|
111 | <p> <pre>
|
---|
112 | <a href="qpixmap.html">QPixmap</a> pixmap( "splash.png" );
|
---|
113 | QSplashScreen *splash = new QSplashScreen( pixmap );
|
---|
114 | splash-><a href="qwidget.html#show">show</a>();
|
---|
115 | ... // Loading some items
|
---|
116 | splash-><a href="#message">message</a>( "Loaded modules" );
|
---|
117 | qApp-><a href="qapplication.html#processEvents">processEvents</a>();
|
---|
118 | ... // Establishing connections
|
---|
119 | splash-><a href="#message">message</a>( "Established connections" );
|
---|
120 | qApp-><a href="qapplication.html#processEvents">processEvents</a>();
|
---|
121 | </pre>
|
---|
122 |
|
---|
123 | <p> <p>See also <a href="misc.html">Miscellaneous Classes</a>.
|
---|
124 |
|
---|
125 | <hr><h2>Member Function Documentation</h2>
|
---|
126 | <h3 class=fn><a name="QSplashScreen"></a>QSplashScreen::QSplashScreen ( const <a href="qpixmap.html">QPixmap</a> & pixmap = QPixmap ( ), WFlags f = 0 )
|
---|
127 | </h3>
|
---|
128 | Construct a splash screen that will display the <em>pixmap</em>.
|
---|
129 | <p> There should be no need to set the widget flags, <em>f</em>, except
|
---|
130 | perhaps <a href="qt.html#WidgetFlags-enum">WDestructiveClose</a> or <a href="qt.html#WidgetFlags-enum">WStyle_StaysOnTop</a>.
|
---|
131 |
|
---|
132 | <h3 class=fn><a name="~QSplashScreen"></a>QSplashScreen::~QSplashScreen ()<tt> [virtual]</tt>
|
---|
133 | </h3>
|
---|
134 | Destructor.
|
---|
135 |
|
---|
136 | <h3 class=fn>void <a name="clear"></a>QSplashScreen::clear ()<tt> [slot]</tt>
|
---|
137 | </h3>
|
---|
138 | Removes the message being displayed on the splash screen
|
---|
139 | <p> <p>See also <a href="#message">message</a>().
|
---|
140 |
|
---|
141 | <h3 class=fn>void <a name="drawContents"></a>QSplashScreen::drawContents ( <a href="qpainter.html">QPainter</a> * painter )<tt> [virtual protected]</tt>
|
---|
142 | </h3>
|
---|
143 | Draw the contents of the splash screen using painter <em>painter</em>.
|
---|
144 | The default implementation draws the message passed by <a href="#message">message</a>().
|
---|
145 | Reimplement this function if you want to do your own drawing on
|
---|
146 | the splash screen.
|
---|
147 |
|
---|
148 | <h3 class=fn>void <a name="finish"></a>QSplashScreen::finish ( <a href="qwidget.html">QWidget</a> * mainWin )
|
---|
149 | </h3>
|
---|
150 | Makes the splash screen wait until the widget <em>mainWin</em> is displayed
|
---|
151 | before calling <a href="qwidget.html#close">close</a>() on itself.
|
---|
152 |
|
---|
153 | <h3 class=fn>void <a name="message"></a>QSplashScreen::message ( const <a href="qstring.html">QString</a> & message, int alignment = AlignLeft, const <a href="qcolor.html">QColor</a> & color = black )<tt> [slot]</tt>
|
---|
154 | </h3>
|
---|
155 | Draws the <em>message</em> text onto the splash screen with color <em>color</em> and aligns the text according to the flags in <em>alignment</em>.
|
---|
156 | <p> <p>See also <a href="qt.html#AlignmentFlags-enum">Qt::AlignmentFlags</a> and <a href="#clear">clear</a>().
|
---|
157 |
|
---|
158 | <h3 class=fn>void <a name="messageChanged"></a>QSplashScreen::messageChanged ( const <a href="qstring.html">QString</a> & message )<tt> [signal]</tt>
|
---|
159 | </h3>
|
---|
160 |
|
---|
161 | <p> This signal is emitted when the message on the splash screen
|
---|
162 | changes. <em>message</em> is the new message and is a null-string
|
---|
163 | when the message has been removed.
|
---|
164 | <p> <p>See also <a href="#message">message</a>() and <a href="#clear">clear</a>().
|
---|
165 |
|
---|
166 | <h3 class=fn><a href="qpixmap.html">QPixmap</a> * <a name="pixmap"></a>QSplashScreen::pixmap () const
|
---|
167 | </h3>
|
---|
168 | Returns the pixmap that is used in the splash screen. The image
|
---|
169 | does not have any of the text drawn by <a href="#message">message</a>() calls.
|
---|
170 |
|
---|
171 | <h3 class=fn>void <a name="repaint"></a>QSplashScreen::repaint ()
|
---|
172 | </h3>
|
---|
173 | This overrides <a href="qwidget.html#repaint">QWidget::repaint</a>(). It differs from the standard
|
---|
174 | repaint function in that it also calls <a href="qapplication.html#flush">QApplication::flush</a>() to
|
---|
175 | ensure the updates are displayed, even when there is no event loop
|
---|
176 | present.
|
---|
177 |
|
---|
178 | <h3 class=fn>void <a name="setPixmap"></a>QSplashScreen::setPixmap ( const <a href="qpixmap.html">QPixmap</a> & pixmap )
|
---|
179 | </h3>
|
---|
180 | Sets the pixmap that will be used as the splash screen's image to
|
---|
181 | <em>pixmap</em>.
|
---|
182 |
|
---|
183 | <!-- eof -->
|
---|
184 | <hr><p>
|
---|
185 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
186 | Copyright © 1995-2007
|
---|
187 | <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
---|
188 | <table width=100% cellspacing=0 border=0><tr>
|
---|
189 | <td>Copyright © 2007
|
---|
190 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
191 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
192 | </table></div></address></body>
|
---|
193 | </html>
|
---|