6
6
td.postheader { font-family: sans-serif }
7
7
tr.address { font-family: sans-serif }
8
8
body { background: #ffffff; color: black; }
9
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">  </td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QSplashScreen Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QSplashScreen widget provides a splash screen that can be shown during application startup. <a href="#details">More...</a></p>
10
<p>Inherits <a href="qwidget.html">QWidget</a>.</p><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qsplashscreen.html#QSplashScreen">__init__</a></b> (<i>self</i>, QPixmap <i>pixmap</i> = QPixmap(), Qt.WindowFlags <i>flags</i> = 0)</li><li><div class="fn" /><b><a href="qsplashscreen.html#QSplashScreen-2">__init__</a></b> (<i>self</i>, QWidget, QPixmap <i>pixmap</i> = QPixmap(), Qt.WindowFlags <i>flags</i> = 0)</li><li><div class="fn" /><b><a href="qsplashscreen.html#clearMessage">clearMessage</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qsplashscreen.html#drawContents">drawContents</a></b> (<i>self</i>, QPainter)</li><li><div class="fn" />bool <b><a href="qsplashscreen.html#event">event</a></b> (<i>self</i>, QEvent)</li><li><div class="fn" /><b><a href="qsplashscreen.html#finish">finish</a></b> (<i>self</i>, QWidget)</li><li><div class="fn" /><b><a href="qsplashscreen.html#mousePressEvent">mousePressEvent</a></b> (<i>self</i>, QMouseEvent)</li><li><div class="fn" />QPixmap <b><a href="qsplashscreen.html#pixmap">pixmap</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qsplashscreen.html#repaint">repaint</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qsplashscreen.html#setPixmap">setPixmap</a></b> (<i>self</i>, QPixmap)</li><li><div class="fn" /><b><a href="qsplashscreen.html#showMessage">showMessage</a></b> (<i>self</i>, QString, int <i>alignment</i> = Qt.AlignLeft, QColor <i>color</i> = Qt.black)</li></ul><h3>Qt Signals</h3><ul><li><div class="fn" />void <b><a href="qsplashscreen.html#messageChanged">messageChanged</a></b> (const QString&)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QSplashScreen widget provides a splash screen that can be shown during application startup.</p>
11
<p>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.</p>
12
<p>The splash screen appears in the center of the screen. It may be useful to add the <a href="qt.html#WindowType-enum">Qt.WindowStaysOnTopHint</a> to the splash widget's window flags if you want to keep it above all the other windows on the desktop.</p>
13
<p>Some X11 window managers do not support the "stays on top" flag. A solution is to set up a timer that periodically calls <a href="qwidget.html#raise">raise_</a>() on the splash screen to simulate the "stays on top" effect.</p>
14
<p>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 in which a splash screen is displayed and some initialization tasks are performed before the application's main window is shown:</p>
15
<pre> int main(int argc, char *argv[])
9
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">  </td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QSplashScreen Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QSplashScreen widget provides a splash screen that can be
10
shown during application startup. <a href="#details">More...</a></p>
12
<p>Inherits <a href="qwidget.html">QWidget</a>.</p><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qsplashscreen.html#QSplashScreen">__init__</a></b> (<i>self</i>, QPixmap <i>pixmap</i> = QPixmap(), Qt.WindowFlags <i>flags</i> = 0)</li><li><div class="fn" /><b><a href="qsplashscreen.html#QSplashScreen-2">__init__</a></b> (<i>self</i>, QWidget, QPixmap <i>pixmap</i> = QPixmap(), Qt.WindowFlags <i>flags</i> = 0)</li><li><div class="fn" /><b><a href="qsplashscreen.html#clearMessage">clearMessage</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qsplashscreen.html#drawContents">drawContents</a></b> (<i>self</i>, QPainter)</li><li><div class="fn" />bool <b><a href="qsplashscreen.html#event">event</a></b> (<i>self</i>, QEvent)</li><li><div class="fn" /><b><a href="qsplashscreen.html#finish">finish</a></b> (<i>self</i>, QWidget)</li><li><div class="fn" /><b><a href="qsplashscreen.html#mousePressEvent">mousePressEvent</a></b> (<i>self</i>, QMouseEvent)</li><li><div class="fn" />QPixmap <b><a href="qsplashscreen.html#pixmap">pixmap</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qsplashscreen.html#repaint">repaint</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qsplashscreen.html#setPixmap">setPixmap</a></b> (<i>self</i>, QPixmap)</li><li><div class="fn" /><b><a href="qsplashscreen.html#showMessage">showMessage</a></b> (<i>self</i>, QString, int <i>alignment</i> = Qt.AlignLeft, QColor <i>color</i> = Qt.black)</li></ul><h3>Qt Signals</h3><ul><li><div class="fn" />void <b><a href="qsplashscreen.html#messageChanged">messageChanged</a></b> (const QString&)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QSplashScreen widget provides a splash screen that can be
13
shown during application startup.</p>
14
<p>A splash screen is a widget that is usually displayed when an
15
application is being started. Splash screens are often used for
16
applications that have long start up times (e.g. database or
17
networking applications that take time to establish connections) to
18
provide the user with feedback that the application is loading.</p>
19
<p>The splash screen appears in the center of the screen. It may be
20
useful to add the <a href="qt.html#WindowType-enum">Qt.WindowStaysOnTopHint</a> to the
21
splash widget's window flags if you want to keep it above all the
22
other windows on the desktop.</p>
23
<p>Some X11 window managers do not support the "stays on top" flag.
24
A solution is to set up a timer that periodically calls <a href="qwidget.html#raise">raise_</a>() on the splash screen to simulate
25
the "stays on top" effect.</p>
26
<p>The most common usage is to show a splash screen before the main
27
widget is displayed on the screen. This is illustrated in the
28
following code snippet in which a splash screen is displayed and
29
some initialization tasks are performed before the application's
30
main window is shown:</p>
31
<pre class="highlightedCode brush: cpp">
32
int main(int argc, char *argv[])
17
34
QApplication app(argc, argv);
18
35
QPixmap pixmap(":/splash.png");
25
42
splash.finish(&window);
28
<p>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 <a href="qcoreapplication.html#processEvents">QApplication.processEvents</a>() to receive the mouse clicks.</p>
29
<p>It is sometimes useful to update the splash screen with messages, for example, announcing connections established or modules loaded as the application starts up:</p>
30
<pre> QPixmap pixmap(":/splash.png");
46
<p>The user can hide the splash screen by clicking on it with the
47
mouse. Since the splash screen is typically displayed before the
48
event loop has started running, it is necessary to periodically
49
call <a href="qcoreapplication.html#processEvents">QApplication.processEvents</a>()
50
to receive the mouse clicks.</p>
51
<p>It is sometimes useful to update the splash screen with
52
messages, for example, announcing connections established or
53
modules loaded as the application starts up:</p>
54
<pre class="highlightedCode brush: cpp">
55
QPixmap pixmap(":/splash.png");
31
56
QSplashScreen *splash = new QSplashScreen(pixmap);
39
64
... <span class="comment">// Establishing connections</span>
40
65
splash->showMessage("Established connections");
42
qApp->processEvents();</pre>
43
<p>QSplashScreen supports this with the <a href="qsplashscreen.html#showMessage">showMessage</a>() function. If you wish to do your own drawing you can get a pointer to the pixmap used in the splash screen with <a href="qsplashscreen.html#pixmap">pixmap</a>(). Alternatively, you can subclass QSplashScreen and reimplement <a href="qsplashscreen.html#drawContents">drawContents</a>().</p>
44
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QSplashScreen" />QSplashScreen.__init__ (<i>self</i>, <a href="qpixmap.html">QPixmap</a> <i>pixmap</i> = QPixmap(), <a href="qt-windowflags.html">Qt.WindowFlags</a> <i>flags</i> = 0)</h3><p>Construct a splash screen that will display the <i>pixmap</i>.</p>
45
<p>There should be no need to set the widget flags, <i>f</i>, except perhaps <a href="qt.html#WindowType-enum">Qt.WindowStaysOnTopHint</a>.</p>
67
qApp->processEvents();
69
<p>QSplashScreen supports this with the <a href="qsplashscreen.html#showMessage">showMessage</a>() function. If you
70
wish to do your own drawing you can get a pointer to the pixmap
71
used in the splash screen with <a href="qsplashscreen.html#pixmap">pixmap</a>(). Alternatively, you can
72
subclass QSplashScreen and reimplement <a href="qsplashscreen.html#drawContents">drawContents</a>().</p>
73
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QSplashScreen" />QSplashScreen.__init__ (<i>self</i>, <a href="qpixmap.html">QPixmap</a> <i>pixmap</i> = QPixmap(), <a href="qt-windowflags.html">Qt.WindowFlags</a> <i>flags</i> = 0)</h3><p>Construct a splash screen that will display the
75
<p>There should be no need to set the widget flags, <i>f</i>,
76
except perhaps <a href="qt.html#WindowType-enum">Qt.WindowStaysOnTopHint</a>.</p>
46
79
<h3 class="fn"><a name="QSplashScreen-2" />QSplashScreen.__init__ (<i>self</i>, <a href="qwidget.html">QWidget</a>, <a href="qpixmap.html">QPixmap</a> <i>pixmap</i> = QPixmap(), <a href="qt-windowflags.html">Qt.WindowFlags</a> <i>flags</i> = 0)</h3><p>The <i>QWidget</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>This is an overloaded function.</p>
47
<p>This function allows you to specify a parent for your splashscreen. The typical use for this constructor is if you have a multiple screens and prefer to have the splash screen on a different screen than your primary one. In that case pass the proper <a href="examples.html#desktop">desktop</a>() as the <i>parent</i>.</p>
48
<a name="//apple_ref/cpp/instm/QSplashScreen/~QSplashScreen" />
80
<p>This function allows you to specify a parent for your
81
splashscreen. The typical use for this constructor is if you have a
82
multiple screens and prefer to have the splash screen on a
83
different screen than your primary one. In that case pass the
84
proper desktop() as the <i>parent</i>.</p>
49
87
<h3 class="fn"><a name="clearMessage" />QSplashScreen.clearMessage (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void clearMessage()</tt>.</p><p>Removes the message being displayed on the splash screen</p>
50
88
<p>See also <a href="qsplashscreen.html#showMessage">showMessage</a>().</p>
51
<a name="//apple_ref/cpp/instm/QSplashScreen/drawContents" />
52
<h3 class="fn"><a name="drawContents" />QSplashScreen.drawContents (<i>self</i>, <a href="qpainter.html">QPainter</a>)</h3><p>Draw the contents of the splash screen using painter <i>painter</i>. The default implementation draws the message passed by <a href="qsplashscreen.html#showMessage">showMessage</a>(). Reimplement this function if you want to do your own drawing on the splash screen.</p>
53
<a name="//apple_ref/cpp/instm/QSplashScreen/event" />
91
<h3 class="fn"><a name="drawContents" />QSplashScreen.drawContents (<i>self</i>, <a href="qpainter.html">QPainter</a>)</h3><p>Draw the contents of the splash screen using painter
92
<i>painter</i>. The default implementation draws the message passed
93
by <a href="qsplashscreen.html#showMessage">showMessage</a>().
94
Reimplement this function if you want to do your own drawing on the
54
98
<h3 class="fn"><a name="event" />bool QSplashScreen.event (<i>self</i>, <a href="qevent.html">QEvent</a>)</h3><p>Reimplemented from <a href="qobject.html#event">QObject.event</a>().</p>
55
<a name="//apple_ref/cpp/instm/QSplashScreen/finish" />
56
<h3 class="fn"><a name="finish" />QSplashScreen.finish (<i>self</i>, <a href="qwidget.html">QWidget</a>)</h3><p>Makes the splash screen wait until the widget <i>mainWin</i> is displayed before calling <a href="qwidget.html#close">close</a>() on itself.</p>
57
<a name="//apple_ref/cpp/instm/QSplashScreen/messageChanged" />
101
<h3 class="fn"><a name="finish" />QSplashScreen.finish (<i>self</i>, <a href="qwidget.html">QWidget</a>)</h3><p>Makes the splash screen wait until the widget <i>mainWin</i> is
102
displayed before calling <a href="qwidget.html#close">close</a>()
58
106
<h3 class="fn"><a name="mousePressEvent" />QSplashScreen.mousePressEvent (<i>self</i>, <a href="qmouseevent.html">QMouseEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#mousePressEvent">QWidget.mousePressEvent</a>().</p>
59
<a name="//apple_ref/cpp/instm/QSplashScreen/pixmap" />
60
<h3 class="fn"><a name="pixmap" /><a href="qpixmap.html">QPixmap</a> QSplashScreen.pixmap (<i>self</i>)</h3><p>Returns the pixmap that is used in the splash screen. The image does not have any of the text drawn by <a href="qsplashscreen.html#showMessage">showMessage</a>() calls.</p>
109
<h3 class="fn"><a name="pixmap" /><a href="qpixmap.html">QPixmap</a> QSplashScreen.pixmap (<i>self</i>)</h3><p>Returns the pixmap that is used in the splash screen. The image
110
does not have any of the text drawn by <a href="qsplashscreen.html#showMessage">showMessage</a>() calls.</p>
61
111
<p>See also <a href="qsplashscreen.html#setPixmap">setPixmap</a>().</p>
62
<a name="//apple_ref/cpp/instm/QSplashScreen/repaint" />
63
<h3 class="fn"><a name="repaint" />QSplashScreen.repaint (<i>self</i>)</h3><p>This overrides <a href="qwidget.html#repaint">QWidget.repaint</a>(). It differs from the standard repaint function in that it also calls <a href="qcoreapplication.html#flush">QApplication.flush</a>() to ensure the updates are displayed, even when there is no event loop present.</p>
64
<a name="//apple_ref/cpp/instm/QSplashScreen/setPixmap" />
65
<h3 class="fn"><a name="setPixmap" />QSplashScreen.setPixmap (<i>self</i>, <a href="qpixmap.html">QPixmap</a>)</h3><p>Sets the pixmap that will be used as the splash screen's image to <i>pixmap</i>.</p>
114
<h3 class="fn"><a name="repaint" />QSplashScreen.repaint (<i>self</i>)</h3><p>This overrides <a href="qwidget.html#repaint">QWidget.repaint</a>(). It differs from the
115
standard repaint function in that it also calls <a href="qcoreapplication.html#flush">QApplication.flush</a>() to ensure
116
the updates are displayed, even when there is no event loop
120
<h3 class="fn"><a name="setPixmap" />QSplashScreen.setPixmap (<i>self</i>, <a href="qpixmap.html">QPixmap</a>)</h3><p>Sets the pixmap that will be used as the splash screen's image
121
to <i>pixmap</i>.</p>
66
122
<p>See also <a href="qsplashscreen.html#pixmap">pixmap</a>().</p>
67
<a name="//apple_ref/cpp/instm/QSplashScreen/showMessage" />
68
<h3 class="fn"><a name="showMessage" />QSplashScreen.showMessage (<i>self</i>, QString, int <i>alignment</i> = Qt.AlignLeft, <a href="qcolor.html">QColor</a> <i>color</i> = Qt.black)</h3><p>This method is also a Qt slot with the C++ signature <tt>void showMessage(const QString&,int = Qt.AlignLeft,const QColor& = Qt.black)</tt>.</p><p>Draws the <i>message</i> text onto the splash screen with color <i>color</i> and aligns the text according to the flags in <i>alignment</i>.</p>
69
<p>See also <a href="qt.html#AlignmentFlag-enum">Qt.Alignment</a> and <a href="qsplashscreen.html#clearMessage">clearMessage</a>().</p>
70
<p /><hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="messageChanged" />void messageChanged (const QString&)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when the message on the splash screen changes. <i>message</i> is the new message and is a null-string when the message has been removed.</p>
125
<h3 class="fn"><a name="showMessage" />QSplashScreen.showMessage (<i>self</i>, QString, int <i>alignment</i> = Qt.AlignLeft, <a href="qcolor.html">QColor</a> <i>color</i> = Qt.black)</h3><p>This method is also a Qt slot with the C++ signature <tt>void showMessage(const QString&,int = Qt.AlignLeft,const QColor& = Qt.black)</tt>.</p><p>Draws the <i>message</i> text onto the splash screen with color
126
<i>color</i> and aligns the text according to the flags in
127
<i>alignment</i>.</p>
128
<p>See also <a href="qt.html#AlignmentFlag-enum">Qt.Alignment</a>
129
and <a href="qsplashscreen.html#clearMessage">clearMessage</a>().</p>
130
<hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="messageChanged" />void messageChanged (const QString&)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when the message on the splash screen
131
changes. <i>message</i> is the new message and is a null-string
132
when the message has been removed.</p>
71
133
<p>See also <a href="qsplashscreen.html#showMessage">showMessage</a>() and <a href="qsplashscreen.html#clearMessage">clearMessage</a>().</p>
72
<a name="//apple_ref/cpp/instm/QSplashScreen/mousePressEvent" />
73
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.7.7 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt 4.6.3</td></tr></table></div></address></body></html>
b'\\ No newline at end of file'
136
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.8.1 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt 4.7.0</td></tr></table></div></address></body></html>
b'\\ No newline at end of file'