source: trunk/doc/html/qstatusbar.html@ 208

Last change on this file since 208 was 190, checked in by rudi, 14 years ago

reference documentation added

File size: 11.6 KB
Line 
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/qstatusbar.cpp:49 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>QStatusBar Class</title>
7<style type="text/css"><!--
8fn { margin-left: 1cm; text-indent: -1cm; }
9a:link { color: #004faf; text-decoration: none }
10a:visited { color: #672967; text-decoration: none }
11body { 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&nbsp;Classes</font></a>
23 | <a href="mainclasses.html">
24<font color="#004faf">Main&nbsp;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&nbsp;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>QStatusBar Class Reference</h1>
33
34<p>The QStatusBar class provides a horizontal bar suitable for
35presenting status information.
36<a href="#details">More...</a>
37<p><tt>#include &lt;<a href="qstatusbar-h.html">qstatusbar.h</a>&gt;</tt>
38<p>Inherits <a href="qwidget.html">QWidget</a>.
39<p><a href="qstatusbar-members.html">List of all member functions.</a>
40<h2>Public Members</h2>
41<ul>
42<li class=fn><a href="#QStatusBar"><b>QStatusBar</b></a> ( QWidget&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0 )</li>
43<li class=fn>virtual <a href="#~QStatusBar"><b>~QStatusBar</b></a> ()</li>
44<li class=fn>virtual void <a href="#addWidget"><b>addWidget</b></a> ( QWidget&nbsp;*&nbsp;widget, int&nbsp;stretch = 0, bool&nbsp;permanent = FALSE )</li>
45<li class=fn>virtual void <a href="#removeWidget"><b>removeWidget</b></a> ( QWidget&nbsp;*&nbsp;widget )</li>
46<li class=fn>void <a href="#setSizeGripEnabled"><b>setSizeGripEnabled</b></a> ( bool )</li>
47<li class=fn>bool <a href="#isSizeGripEnabled"><b>isSizeGripEnabled</b></a> () const</li>
48</ul>
49<h2>Public Slots</h2>
50<ul>
51<li class=fn>void <a href="#message"><b>message</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;message )</li>
52<li class=fn>void <a href="#message-2"><b>message</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;message, int&nbsp;ms )</li>
53<li class=fn>void <a href="#clear"><b>clear</b></a> ()</li>
54</ul>
55<h2>Signals</h2>
56<ul>
57<li class=fn>void <a href="#messageChanged"><b>messageChanged</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;message )</li>
58</ul>
59<h2>Properties</h2>
60<ul>
61<li class=fn>bool <a href="#sizeGripEnabled-prop"><b>sizeGripEnabled</b></a>&nbsp;- whether the QSizeGrip in the bottom right of the status bar is enabled</li>
62</ul>
63<h2>Protected Members</h2>
64<ul>
65<li class=fn>virtual void <a href="#paintEvent"><b>paintEvent</b></a> ( QPaintEvent * )</li>
66<li class=fn>void <a href="#reformat"><b>reformat</b></a> ()</li>
67<li class=fn>void <a href="#hideOrShow"><b>hideOrShow</b></a> ()</li>
68</ul>
69<hr><a name="details"></a><h2>Detailed Description</h2>
70
71
72The QStatusBar class provides a horizontal bar suitable for
73presenting status information.
74<p>
75
76
77<p> Each status indicator falls into one of three categories:
78<p> <ul>
79<li> <em>Temporary</em> - briefly occupies most of the status bar. Used
80to explain tool tip texts or menu entries, for example.
81<li> <em>Normal</em> - occupies part of the status bar and may be hidden
82by temporary messages. Used to display the page and line
83number in a word processor, for example.
84<li> <em>Permanent</em> - is never hidden. Used for important mode
85indications, for example, some applications put a Caps Lock
86indicator in the status bar.
87</ul>
88<p> QStatusBar lets you display all three types of indicators.
89<p> To display a <em>temporary</em> message, call <a href="#message">message</a>() (perhaps by
90connecting a suitable signal to it). To remove a temporary
91message, call <a href="#clear">clear</a>(). There are two variants of message(): one
92that displays the message until the next clear() or message() and
93one that has a time limit:
94<p> <pre>
95 <a href="qobject.html#connect">connect</a>( loader, SIGNAL(progressMessage(const <a href="qstring.html">QString</a>&amp;)),
96 statusBar(), SLOT(<a href="#message">message</a>(const <a href="qstring.html">QString</a>&amp;)) );
97
98 statusBar()-&gt;message("Loading..."); // Initial message
99 loader.loadStuff(); // Emits progress messages
100 statusBar()-&gt;message("Done.", 2000); // Final message for 2 seconds
101 </pre>
102
103<p> <em>Normal</em> and <em>Permanent</em> messages are displayed by creating a
104small widget and then adding it to the status bar with
105<a href="#addWidget">addWidget</a>(). Widgets like <a href="qlabel.html">QLabel</a>, <a href="qprogressbar.html">QProgressBar</a> or even <a href="qtoolbutton.html">QToolButton</a>
106are useful for adding to status bars. <a href="#removeWidget">removeWidget</a>() is used to
107remove widgets.
108<p> <pre>
109 statusBar()-&gt;addWidget(new MyReadWriteIndication(statusBar()));
110 </pre>
111
112<p> By default QStatusBar provides a <a href="qsizegrip.html">QSizeGrip</a> in the lower-right
113corner. You can disable it with <a href="#setSizeGripEnabled">setSizeGripEnabled</a>(FALSE);
114<p> <img src=qstatusbar-m.png> <img src=qstatusbar-w.png>
115<p> <p>See also <a href="qtoolbar.html">QToolBar</a>, <a href="qmainwindow.html">QMainWindow</a>, <a href="qlabel.html">QLabel</a>, <a href="guibooks.html#fowler">GUI Design Handbook: Status Bar</a>, <a href="application.html">Main Window and Related Classes</a>, and <a href="helpsystem.html">Help System</a>.
116
117<hr><h2>Member Function Documentation</h2>
118<h3 class=fn><a name="QStatusBar"></a>QStatusBar::QStatusBar ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0 )
119</h3>
120Constructs a status bar called <em>name</em> with parent <em>parent</em> and
121with a size grip.
122<p> <p>See also <a href="#sizeGripEnabled-prop">sizeGripEnabled</a>.
123
124<h3 class=fn><a name="~QStatusBar"></a>QStatusBar::~QStatusBar ()<tt> [virtual]</tt>
125</h3>
126Destroys the status bar and frees any allocated resources and
127child widgets.
128
129<h3 class=fn>void <a name="addWidget"></a>QStatusBar::addWidget ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;widget, int&nbsp;stretch = 0, bool&nbsp;permanent = FALSE )<tt> [virtual]</tt>
130</h3>
131Adds <em>widget</em> to this status bar. <em>widget</em> is reparented if it
132isn't already a child of the QStatusBar.
133<p> <em>widget</em> is permanently visible if <em>permanent</em> is TRUE and may
134be obscured by temporary messages if <em>permanent</em> is FALSE. The
135default is FALSE.
136<p> If <em>permanent</em> is TRUE, <em>widget</em> is located at the far right of
137the status bar. If <em>permanent</em> is FALSE (the default), <em>widget</em>
138is located just to the left of the first permanent widget.
139<p> <em>stretch</em> is used to compute a suitable size for <em>widget</em> as the
140status bar grows and shrinks. The default of 0 uses a minimum of
141space.
142<p> This function may cause some flicker.
143<p> <p>See also <a href="#removeWidget">removeWidget</a>().
144
145<h3 class=fn>void <a name="clear"></a>QStatusBar::clear ()<tt> [slot]</tt>
146</h3>
147Removes any temporary message being shown.
148<p> <p>See also <a href="#message">message</a>().
149
150<h3 class=fn>void <a name="hideOrShow"></a>QStatusBar::hideOrShow ()<tt> [protected]</tt>
151</h3>
152Ensures that the right widgets are visible. Used by <a href="#message">message</a>() and
153<a href="#clear">clear</a>().
154
155<h3 class=fn>bool <a name="isSizeGripEnabled"></a>QStatusBar::isSizeGripEnabled () const
156</h3><p>Returns TRUE if the <a href="qsizegrip.html">QSizeGrip</a> in the bottom right of the status bar is enabled; otherwise returns FALSE.
157See the <a href="qstatusbar.html#sizeGripEnabled-prop">"sizeGripEnabled"</a> property for details.
158<h3 class=fn>void <a name="message"></a>QStatusBar::message ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;message )<tt> [slot]</tt>
159</h3>
160Hides the normal status indicators and displays <em>message</em> until
161<a href="#clear">clear</a>() or another <a href="#message">message</a>() is called.
162<p> <p>See also <a href="#clear">clear</a>().
163
164<p>Example: <a href="regexptester-example.html#x2494">regexptester/regexptester.cpp</a>.
165<h3 class=fn>void <a name="message-2"></a>QStatusBar::message ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;message, int&nbsp;ms )<tt> [slot]</tt>
166</h3>
167This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
168<p> Hides the normal status indications and displays <em>message</em> for <em>ms</em> milli-seconds or until <a href="#clear">clear</a>() or another <a href="#message">message</a>() is called,
169whichever occurs first.
170
171<h3 class=fn>void <a name="messageChanged"></a>QStatusBar::messageChanged ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;message )<tt> [signal]</tt>
172</h3>
173
174<p> This signal is emitted when the temporary status messages
175changes. <em>message</em> is the new temporary message, and is a
176null-string when the message has been removed.
177<p> <p>See also <a href="#message">message</a>() and <a href="#clear">clear</a>().
178
179<h3 class=fn>void <a name="paintEvent"></a>QStatusBar::paintEvent ( <a href="qpaintevent.html">QPaintEvent</a>&nbsp;* )<tt> [virtual protected]</tt>
180</h3>
181Shows the temporary message, if appropriate.
182
183<p>Reimplemented from <a href="qwidget.html#paintEvent">QWidget</a>.
184<h3 class=fn>void <a name="reformat"></a>QStatusBar::reformat ()<tt> [protected]</tt>
185</h3>
186Changes the status bar's appearance to account for item changes.
187Special subclasses may need this, but geometry management will
188usually take care of any necessary rearrangements.
189
190<h3 class=fn>void <a name="removeWidget"></a>QStatusBar::removeWidget ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;widget )<tt> [virtual]</tt>
191</h3>
192Removes <em>widget</em> from the status bar.
193<p> This function may cause some flicker.
194<p> Note that <em>widget</em> is not deleted.
195<p> <p>See also <a href="#addWidget">addWidget</a>().
196
197<h3 class=fn>void <a name="setSizeGripEnabled"></a>QStatusBar::setSizeGripEnabled ( bool )
198</h3><p>Sets whether the <a href="qsizegrip.html">QSizeGrip</a> in the bottom right of the status bar is enabled.
199See the <a href="qstatusbar.html#sizeGripEnabled-prop">"sizeGripEnabled"</a> property for details.
200<hr><h2>Property Documentation</h2>
201<h3 class=fn>bool <a name="sizeGripEnabled-prop"></a>sizeGripEnabled</h3>
202<p>This property holds whether the <a href="qsizegrip.html">QSizeGrip</a> in the bottom right of the status bar is enabled.
203<p>Enables or disables the QSizeGrip in the bottom right of the
204status bar. By default, the size grip is enabled.
205
206<p>Set this property's value with <a href="#setSizeGripEnabled">setSizeGripEnabled</a>() and get this property's value with <a href="#isSizeGripEnabled">isSizeGripEnabled</a>().
207<!-- eof -->
208<hr><p>
209This file is part of the <a href="index.html">Qt toolkit</a>.
210Copyright &copy; 1995-2007
211<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
212<table width=100% cellspacing=0 border=0><tr>
213<td>Copyright &copy; 2007
214<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
215<td align=right><div align=right>Qt 3.3.8</div>
216</table></div></address></body>
217</html>
Note: See TracBrowser for help on using the repository browser.