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.
tqt3/doc/html/ntqsplashscreen.html

194 lines
9.6 KiB

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/widgets/qsplashscreen.cpp:53 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>TQSplashScreen Class</title>
<style type="text/css"><!--
fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
<a href="index.html">
<font color="#004faf">Home</font></a>
| <a href="classes.html">
<font color="#004faf">All&nbsp;Classes</font></a>
| <a href="mainclasses.html">
<font color="#004faf">Main&nbsp;Classes</font></a>
| <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
| <a href="groups.html">
<font color="#004faf">Grouped&nbsp;Classes</font></a>
| <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>TQSplashScreen Class Reference</h1>
<p>The TQSplashScreen widget provides a splash screen that can
be shown during application startup.
<a href="#details">More...</a>
<p><tt>#include &lt;<a href="qsplashscreen-h.html">ntqsplashscreen.h</a>&gt;</tt>
<p>Inherits <a href="ntqwidget.html">TQWidget</a>.
<p><a href="qsplashscreen-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li class=fn><a href="#TQSplashScreen"><b>TQSplashScreen</b></a> ( const&nbsp;TQPixmap&nbsp;&amp;&nbsp;pixmap = TQPixmap ( ), WFlags&nbsp;f = 0 )</li>
<li class=fn>virtual <a href="#~TQSplashScreen"><b>~TQSplashScreen</b></a> ()</li>
<li class=fn>void <a href="#setPixmap"><b>setPixmap</b></a> ( const&nbsp;TQPixmap&nbsp;&amp;&nbsp;pixmap )</li>
<li class=fn>TQPixmap * <a href="#pixmap"><b>pixmap</b></a> () const</li>
<li class=fn>void <a href="#finish"><b>finish</b></a> ( TQWidget&nbsp;*&nbsp;mainWin )</li>
<li class=fn>void <a href="#repaint"><b>repaint</b></a> ()</li>
</ul>
<h2>Public Slots</h2>
<ul>
<li class=fn>void <a href="#message"><b>message</b></a> ( const&nbsp;TQString&nbsp;&amp;&nbsp;message, int&nbsp;alignment = AlignLeft, const&nbsp;TQColor&nbsp;&amp;&nbsp;color = black )</li>
<li class=fn>void <a href="#clear"><b>clear</b></a> ()</li>
</ul>
<h2>Signals</h2>
<ul>
<li class=fn>void <a href="#messageChanged"><b>messageChanged</b></a> ( const&nbsp;TQString&nbsp;&amp;&nbsp;message )</li>
</ul>
<h2>Protected Members</h2>
<ul>
<li class=fn>virtual void <a href="#drawContents"><b>drawContents</b></a> ( TQPainter&nbsp;*&nbsp;painter )</li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>
The TQSplashScreen 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. database or
networking applications that take time to establish connections) to
provide the user with feedback that the application is loading.
<p> The splash screen appears centered on the screen. It may be useful to add
the <a href="ntqt.html#WidgetFlags-enum">WStyle_StaysOnTop</a> if you desire to keep above all the windows in the
GUI.
<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="ntqwidget.html#raise">raise</a>() on
the splash screen to simulate the "stays on top" effect.
<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.
<p> <pre>
int main( int argc, char **argv )
{
<a href="ntqapplication.html">TQApplication</a> app( argc, argv );
<a href="ntqpixmap.html">TQPixmap</a> pixmap( "splash.png" );
TQSplashScreen *splash = new TQSplashScreen( pixmap );
splash-&gt;<a href="ntqwidget.html#show">show</a>();
<a href="ntqmainwindow.html">TQMainWindow</a> *mainWin = new <a href="ntqmainwindow.html">TQMainWindow</a>;
...
app.<a href="ntqapplication.html#setMainWidget">setMainWidget</a>( mainWin );
mainWin-&gt;<a href="ntqwidget.html#show">show</a>();
splash-&gt;<a href="#finish">finish</a>( mainWin );
delete splash;
return app.<a href="ntqapplication.html#exec">exec</a>();
}
</pre>
<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. TQSplashScreen supports this with the
<a href="#message">message</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="#pixmap">pixmap</a>().
Alternatively, you can subclass TQSplashScreen and reimplement
<a href="#drawContents">drawContents</a>().
<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="ntqapplication.html#processEvents">TQApplication::processEvents</a>() to receive the mouse clicks.
<p> <pre>
<a href="ntqpixmap.html">TQPixmap</a> pixmap( "splash.png" );
TQSplashScreen *splash = new TQSplashScreen( pixmap );
splash-&gt;<a href="ntqwidget.html#show">show</a>();
... // Loading some items
splash-&gt;<a href="#message">message</a>( "Loaded modules" );
tqApp-&gt;<a href="ntqapplication.html#processEvents">processEvents</a>();
... // Establishing connections
splash-&gt;<a href="#message">message</a>( "Established connections" );
tqApp-&gt;<a href="ntqapplication.html#processEvents">processEvents</a>();
</pre>
<p> <p>See also <a href="misc.html">Miscellaneous Classes</a>.
<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="TQSplashScreen"></a>TQSplashScreen::TQSplashScreen ( const&nbsp;<a href="ntqpixmap.html">TQPixmap</a>&nbsp;&amp;&nbsp;pixmap = TQPixmap ( ), WFlags&nbsp;f = 0 )
</h3>
Construct a splash screen that will display the <em>pixmap</em>.
<p> There should be no need to set the widget flags, <em>f</em>, except
perhaps <a href="ntqt.html#WidgetFlags-enum">WDestructiveClose</a> or <a href="ntqt.html#WidgetFlags-enum">WStyle_StaysOnTop</a>.
<h3 class=fn><a name="~TQSplashScreen"></a>TQSplashScreen::~TQSplashScreen ()<tt> [virtual]</tt>
</h3>
Destructor.
<h3 class=fn>void <a name="clear"></a>TQSplashScreen::clear ()<tt> [slot]</tt>
</h3>
Removes the message being displayed on the splash screen
<p> <p>See also <a href="#message">message</a>().
<h3 class=fn>void <a name="drawContents"></a>TQSplashScreen::drawContents ( <a href="ntqpainter.html">TQPainter</a>&nbsp;*&nbsp;painter )<tt> [virtual protected]</tt>
</h3>
Draw the contents of the splash screen using painter <em>painter</em>.
The default implementation draws the message passed by <a href="#message">message</a>().
Reimplement this function if you want to do your own drawing on
the splash screen.
<h3 class=fn>void <a name="finish"></a>TQSplashScreen::finish ( <a href="ntqwidget.html">TQWidget</a>&nbsp;*&nbsp;mainWin )
</h3>
Makes the splash screen wait until the widget <em>mainWin</em> is displayed
before calling <a href="ntqwidget.html#close">close</a>() on itself.
<h3 class=fn>void <a name="message"></a>TQSplashScreen::message ( const&nbsp;<a href="ntqstring.html">TQString</a>&nbsp;&amp;&nbsp;message, int&nbsp;alignment = AlignLeft, const&nbsp;<a href="ntqcolor.html">TQColor</a>&nbsp;&amp;&nbsp;color = black )<tt> [slot]</tt>
</h3>
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>.
<p> <p>See also <a href="ntqt.html#AlignmentFlags-enum">TQt::AlignmentFlags</a> and <a href="#clear">clear</a>().
<h3 class=fn>void <a name="messageChanged"></a>TQSplashScreen::messageChanged ( const&nbsp;<a href="ntqstring.html">TQString</a>&nbsp;&amp;&nbsp;message )<tt> [signal]</tt>
</h3>
<p> This signal is emitted when the message on the splash screen
changes. <em>message</em> is the new message and is a null-string
when the message has been removed.
<p> <p>See also <a href="#message">message</a>() and <a href="#clear">clear</a>().
<h3 class=fn><a href="ntqpixmap.html">TQPixmap</a>&nbsp;* <a name="pixmap"></a>TQSplashScreen::pixmap () const
</h3>
Returns the pixmap that is used in the splash screen. The image
does not have any of the text drawn by <a href="#message">message</a>() calls.
<h3 class=fn>void <a name="repaint"></a>TQSplashScreen::repaint ()
</h3>
This overrides <a href="ntqwidget.html#repaint">TQWidget::repaint</a>(). It differs from the standard
repaint function in that it also calls <a href="ntqapplication.html#flush">TQApplication::flush</a>() to
ensure the updates are displayed, even when there is no event loop
present.
<h3 class=fn>void <a name="setPixmap"></a>TQSplashScreen::setPixmap ( const&nbsp;<a href="ntqpixmap.html">TQPixmap</a>&nbsp;&amp;&nbsp;pixmap )
</h3>
Sets the pixmap that will be used as the splash screen's image to
<em>pixmap</em>.
<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">TQt toolkit</a>.
Copyright &copy; 1995-2007
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright &copy; 2007
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
<td align=right><div align=right>TQt 3.3.8</div>
</table></div></address></body>
</html>