Sophie

Sophie

distrib > Mandriva > current > i586 > media > main-updates > by-pkgid > 8e6051afcdb111a0317a58fb64c2abf5 > files > 4873

qt4-doc-4.6.3-0.2mdv2010.2.i586.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- qsplashscreen.cpp -->
<head>
  <title>Qt 4.6: QSplashScreen Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<a name="//apple_ref/cpp/cl//QSplashScreen"></a>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">All&nbsp;Functions</font></a>&nbsp;&middot; <a href="overviews.html"><font color="#004faf">Overviews</font></a></td></tr></table><h1 class="title">QSplashScreen Class Reference<br /><span class="small-subtitle">[<a href="qtgui.html">QtGui</a> module]</span>
</h1>
<p>The QSplashScreen widget provides a splash screen that can be shown during application startup. <a href="#details">More...</a></p>
<pre> #include &lt;QSplashScreen&gt;</pre><p>Inherits <a href="qwidget.html">QWidget</a>.</p>
<ul>
<li><a href="qsplashscreen-members.html">List of all members, including inherited members</a></li>
<li><a href="qsplashscreen-qt3.html">Qt 3 support members</a></li>
</ul>
<hr />
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qsplashscreen.html#QSplashScreen">QSplashScreen</a></b> ( const QPixmap &amp; <i>pixmap</i> = QPixmap(), Qt::WindowFlags <i>f</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qsplashscreen.html#QSplashScreen-2">QSplashScreen</a></b> ( QWidget * <i>parent</i>, const QPixmap &amp; <i>pixmap</i> = QPixmap(), Qt::WindowFlags <i>f</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><b><a href="qsplashscreen.html#dtor.QSplashScreen">~QSplashScreen</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qsplashscreen.html#finish">finish</a></b> ( QWidget * <i>mainWin</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const QPixmap </td><td class="memItemRight" valign="bottom"><b><a href="qsplashscreen.html#pixmap">pixmap</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qsplashscreen.html#repaint">repaint</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qsplashscreen.html#setPixmap">setPixmap</a></b> ( const QPixmap &amp; <i>pixmap</i> )</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>217 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
<li><div bar="2" class="fn"></div>29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
<li><div bar="2" class="fn"></div>13 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
</ul>
<hr />
<a name="public-slots"></a>
<h2>Public Slots</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qsplashscreen.html#clearMessage">clearMessage</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qsplashscreen.html#showMessage">showMessage</a></b> ( const QString &amp; <i>message</i>, int <i>alignment</i> = Qt::AlignLeft, const QColor &amp; <i>color</i> = Qt::black )</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>19 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
<li><div bar="2" class="fn"></div>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
</ul>
<hr />
<a name="signals"></a>
<h2>Signals</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qsplashscreen.html#messageChanged">messageChanged</a></b> ( const QString &amp; <i>message</i> )</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>1 signal inherited from <a href="qwidget.html#signals">QWidget</a></li>
<li><div bar="2" class="fn"></div>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
</ul>
<hr />
<a name="protected-functions"></a>
<h2>Protected Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qsplashscreen.html#drawContents">drawContents</a></b> ( QPainter * <i>painter</i> )</td></tr>
</table>
<hr />
<a name="reimplemented-protected-functions"></a>
<h2>Reimplemented Protected Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><b><a href="qsplashscreen.html#event">event</a></b> ( QEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qsplashscreen.html#mousePressEvent">mousePressEvent</a></b> ( QMouseEvent * )</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>37 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li><div bar="2" class="fn"></div>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
<li><div bar="2" class="fn"></div>1 protected function inherited from <a href="qpaintdevice.html#protected-functions">QPaintDevice</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li><div class="fn"></div>58 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
<li><div class="fn"></div>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
<li><div class="fn"></div>4 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
<li><div class="fn"></div>5 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
<li><div class="fn"></div>1 protected slot inherited from <a href="qwidget.html#protected-slots">QWidget</a></li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QSplashScreen widget provides a splash screen that can be shown during application startup.</p>
<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&#x2e; database or networking applications that take time to establish connections) to provide the user with feedback that the application is loading.</p>
<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>
<p>Some X11 window managers do not support the &quot;stays on top&quot; 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 &quot;stays on top&quot; effect.</p>
<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>
<pre> int main(int argc, char *argv[])
 {
     QApplication app(argc, argv);
     QPixmap pixmap(&quot;:/splash.png&quot;);
     QSplashScreen splash(pixmap);
     splash.show();
     app.processEvents();
     ...
     QMainWindow window;
     window.show();
     splash.finish(&amp;window);
     return app.exec();
 }</pre>
<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>
<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>
<pre> QPixmap pixmap(&quot;:/splash.png&quot;);
 QSplashScreen *splash = new QSplashScreen(pixmap);
 splash-&gt;show();

 ... <span class="comment">// Loading some items</span>
 splash-&gt;showMessage(&quot;Loaded modules&quot;);

 qApp-&gt;processEvents();

 ... <span class="comment">// Establishing connections</span>
 splash-&gt;showMessage(&quot;Established connections&quot;);

 qApp-&gt;processEvents();</pre>
<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>
<hr />
<h2>Member Function Documentation</h2>
<a name="//apple_ref/cpp/instm/QSplashScreen/QSplashScreen"></a>
<h3 class="fn"><a name="QSplashScreen"></a>QSplashScreen::QSplashScreen ( const <a href="qpixmap.html">QPixmap</a> &amp; <i>pixmap</i> = QPixmap(), <a href="qt.html#WindowType-enum">Qt::WindowFlags</a> <i>f</i> = 0 )</h3>
<p>Construct a splash screen that will display the <i>pixmap</i>.</p>
<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>
<h3 class="fn"><a name="QSplashScreen-2"></a>QSplashScreen::QSplashScreen ( <a href="qwidget.html">QWidget</a> * <i>parent</i>, const <a href="qpixmap.html">QPixmap</a> &amp; <i>pixmap</i> = QPixmap(), <a href="qt.html#WindowType-enum">Qt::WindowFlags</a> <i>f</i> = 0 )</h3>
<p>This is an overloaded function.</p>
<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>
<a name="//apple_ref/cpp/instm/QSplashScreen/~QSplashScreen"></a>
<h3 class="fn"><a name="dtor.QSplashScreen"></a>QSplashScreen::~QSplashScreen ()&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Destructor.</p>
<a name="//apple_ref/cpp/instm/QSplashScreen/clearMessage"></a>
<h3 class="fn"><a name="clearMessage"></a>void QSplashScreen::clearMessage ()&nbsp;&nbsp;<tt> [slot]</tt></h3>
<p>Removes the message being displayed on the splash screen</p>
<p>See also <a href="qsplashscreen.html#showMessage">showMessage</a>().</p>
<a name="//apple_ref/cpp/instm/QSplashScreen/drawContents"></a>
<h3 class="fn"><a name="drawContents"></a>void QSplashScreen::drawContents ( <a href="qpainter.html">QPainter</a> * <i>painter</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></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>
<a name="//apple_ref/cpp/instm/QSplashScreen/event"></a>
<h3 class="fn"><a name="event"></a>bool QSplashScreen::event ( <a href="qevent.html">QEvent</a> * <i>e</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qobject.html#event">QObject::event</a>().</p>
<a name="//apple_ref/cpp/instm/QSplashScreen/finish"></a>
<h3 class="fn"><a name="finish"></a>void QSplashScreen::finish ( <a href="qwidget.html">QWidget</a> * <i>mainWin</i> )</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>
<a name="//apple_ref/cpp/instm/QSplashScreen/messageChanged"></a>
<h3 class="fn"><a name="messageChanged"></a>void QSplashScreen::messageChanged ( const <a href="qstring.html">QString</a> &amp; <i>message</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
<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>
<p>See also <a href="qsplashscreen.html#showMessage">showMessage</a>() and <a href="qsplashscreen.html#clearMessage">clearMessage</a>().</p>
<a name="//apple_ref/cpp/instm/QSplashScreen/mousePressEvent"></a>
<h3 class="fn"><a name="mousePressEvent"></a>void QSplashScreen::mousePressEvent ( <a href="qmouseevent.html">QMouseEvent</a> * )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#mousePressEvent">QWidget::mousePressEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QSplashScreen/pixmap"></a>
<h3 class="fn"><a name="pixmap"></a>const <a href="qpixmap.html">QPixmap</a> QSplashScreen::pixmap () const</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>
<p>See also <a href="qsplashscreen.html#setPixmap">setPixmap</a>().</p>
<a name="//apple_ref/cpp/instm/QSplashScreen/repaint"></a>
<h3 class="fn"><a name="repaint"></a>void QSplashScreen::repaint ()</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>
<a name="//apple_ref/cpp/instm/QSplashScreen/setPixmap"></a>
<h3 class="fn"><a name="setPixmap"></a>void QSplashScreen::setPixmap ( const <a href="qpixmap.html">QPixmap</a> &amp; <i>pixmap</i> )</h3>
<p>Sets the pixmap that will be used as the splash screen's image to <i>pixmap</i>.</p>
<p>See also <a href="qsplashscreen.html#pixmap">pixmap</a>().</p>
<a name="//apple_ref/cpp/instm/QSplashScreen/showMessage"></a>
<h3 class="fn"><a name="showMessage"></a>void QSplashScreen::showMessage ( const <a href="qstring.html">QString</a> &amp; <i>message</i>, int <i>alignment</i> = Qt::AlignLeft, const <a href="qcolor.html">QColor</a> &amp; <i>color</i> = Qt::black )&nbsp;&nbsp;<tt> [slot]</tt></h3>
<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>
<p>See also <a href="qt.html#AlignmentFlag-enum">Qt::Alignment</a> and <a href="qsplashscreen.html#clearMessage">clearMessage</a>().</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="40%" align="left">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies)</td>
<td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="40%" align="right"><div align="right">Qt 4.6.3</div></td>
</tr></table></div></address></body>
</html>