File: qstatusbar.html

package info (click to toggle)
qt-embedded 2.3.2-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 68,608 kB
  • ctags: 45,998
  • sloc: cpp: 276,654; ansic: 71,987; makefile: 29,074; sh: 12,305; yacc: 2,465; python: 1,863; perl: 481; lex: 480; xml: 68; lisp: 15
file content (168 lines) | stat: -rw-r--r-- 10,193 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Qt Toolkit - QStatusBar Class</title><style type="text/css"><!--
h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }body { background: white; color: black; }
--></style>
</head><body bgcolor="#ffffff">

<table width="100%">
<tr><td><a href="index.html">
<img width="100" height="100" src="qtlogo.png"
alt="Home" border="0"><img width="100"
height="100" src="face.png" alt="Home" border="0">
</a><td valign=top><div align=right><img src="dochead.png" width="472" height="27"><br>
<a href="classes.html"><b>Classes</b></a>
-<a href="annotated.html">Annotated</a>
- <a href="hierarchy.html">Tree</a>
-<a href="functions.html">Functions</a>
-<a href="index.html">Home</a>
-<a href="topicals.html"><b>Structure</b></a>
</div>
</table>

<h1 align=center>QStatusBar Class Reference</h1><br clear="all">
<p>
The QStatusBar class provides a horizontal bar suitable for presenting status information.
<a href="#details">More...</a>
<p>
<code>#include &lt;<a href="qstatusbar-h.html">qstatusbar.h</a>&gt;</code>
<p>
Inherits <a href="qwidget.html">QWidget</a>.
<p><a href="qstatusbar-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li><div class="fn"><a href="#86b1d1"><b>QStatusBar</b></a>(QWidget*parent=0, constchar*name=0)</div>
<li><div class="fn"><a href="#dbacef"><b>~QStatusBar</b></a>()</div>
<li><div class="fn">void<a href="#99b094"><b>addWidget</b></a>(QWidget*, intstretch=0, bool=FALSE)</div>
<li><div class="fn">void<a href="#dc867a"><b>removeWidget</b></a>(QWidget*)</div>
<li><div class="fn">void<a href="#8b3acc"><b>setSizeGripEnabled</b></a>(bool)</div>
<li><div class="fn">bool<a href="#938ad4"><b>isSizeGripEnabled</b></a>()const</div>
</ul>
<h2>Public Slots</h2>
<ul>
<li><div class="fn">void<a href="#16f76d"><b>message</b></a>(constQString&amp;)</div>
<li><div class="fn">void<a href="#1167e5"><b>message</b></a>(constQString&amp;, int)</div>
<li><div class="fn">void<a href="#1a0b3d"><b>clear</b></a>()</div>
</ul>
<h2>Protected Members</h2>
<ul>
<li><div class="fn">virtualvoid<a href="#98074a"><b>paintEvent</b></a>(QPaintEvent*)</div>
<li><div class="fn">void<a href="#5dff34"><b>reformat</b></a>()</div>
<li><div class="fn">void<a href="#0db6e4"><b>hideOrShow</b></a>()</div>
</ul>
<h2>Properties</h2>
<table border=1 cellpadding=3 cellspacing=0>
<tr><th>Type<th>Name<th>READ<th>WRITE<th>Options
<tr><td>bool<td>sizeGripEnabled<td>isSizeGripEnabled<td>setSizeGripEnabled<td>&nbsp;
</table>
<hr><h2><a name="details"></a>Detailed Description</h2>
The QStatusBar class provides a horizontal bar suitable for presenting status information.
<p>
Each status indicator falls into one of three categories:
<p><ul>
<li> <em>Temporary</em> - occupies most of the status bar briefly.  Used
e.g. for explaining tool tip texts or menu entries.
<li> <em>Normal</em> - occupies part of the status bar and may be hidden
by temporary messages.  Used e.g. for displaying the page and line
number in a word processor.
<li> <em>Permanent</em> - is never hidden.  Used for important mode
indications.  Some applications put a Caps Lock indicator in the
status bar.
</ul>
<p>QStatusBar lets you display all three types of indicator.
<p>To display a <em>temporary</em> message, call <a href="#1167e5">message</a>(), perhaps by
connecting a suitable signal to it.  To remove a temporary message,
call <a href="#1a0b3d">clear</a>().
There are two variants of message(), one which displays the message
until the next clear() or mesage(), and one which also has a time limit:
<p><pre>     connect( loader, SIGNAL(progressMessage(const QString&amp;)),
              statusBar(), SLOT(message(const QString&amp;)) );

     statusBar()-&gt;message("Loading...");  // Initial message
     loader.loadStuff();                  // Emits progress messages
     statusBar()-&gt;message("Done.", 2000); // Final message for 2 seconds
</pre>
<p><em>Normal</em> and <em>permanent</em> messages are displayed by creating a small
widget then adding it to the status bar with <a href="#99b094">addWidget</a>().  Widgets
like <a href="qlabel.html">QLabel</a>, <a href="qprogressbar.html">QProgressBar</a>, or even <a href="qtoolbutton.html">QToolButton</a> are useful for adding
to status bars.  <a href="#dc867a">removeWidget</a>() is used to remove widgets.
<p><pre>     statusBar()-&gt;addWidget(new MyReadWriteIndication(statusBar()));
</pre>
<p>By default, QStatusBar provides a <a href="qsizegrip.html">QSizeGrip</a> in the lower-right corner.
You can disable this with <a href="#8b3acc">setSizeGripEnabled</a>(FALSE);
<p><img src=qstatusbar-m.png> <img src=qstatusbar-w.png>
<p>See also  <a href="qtoolbar.html">QToolBar</a>, <a href="qmainwindow.html">QMainWindow</a>, <a href="qlabel.html">QLabel</a> and <a href="guibooks.html#fowler">GUI Design Handbook: Status Bar.</a>

<hr><h2>Member Function Documentation</h2>
<h3 class="fn"><a name="86b1d1"></a>QStatusBar::QStatusBar(<a href="qwidget.html">QWidget</a>*parent=0, constchar*name=0)</h3>
<p>Constructs a status bar with just a size grip.
<p>See also  <a href="#8b3acc">setSizeGripEnabled</a>().
<h3 class="fn"><a name="dbacef"></a>QStatusBar::~QStatusBar()</h3>
<p>Destructs the status bar and frees any allocated resources.
<h3 class="fn">void<a name="99b094"></a>QStatusBar::addWidget(<a href="qwidget.html">QWidget</a>*widget, intstretch=0, boolpermanent=FALSE)</h3>
<p>Adds <em>widget</em> to this status bar.
<p><em>widget</em> is permanently visible if <em>permanent</em> is TRUE, and is
obscured by temporary messages if <em>permanent</em> is FALSE.  The
default is FALSE.
<p><em>stretch</em> is used to compute a suitable size for <em>widget</em> as the
status bar grows and shrinks. The default of 0 uses a minimum of space.
<p>If <em>permanent</em> is TRUE, <em>widget</em> is located at the far right of
the status bar.  If <em>permanent</em> is FALSE (the default) <em>widget</em> is
located just to the left of the first permanent widget.
<p>This function may cause some flicker.
<p>See also  <a href="#dc867a">removeWidget</a>().
<h3 class="fn">void<a name="1a0b3d"></a>QStatusBar::clear() <code>[slot]</code></h3>
<p>Removes any temporary message being shown.
<p>See also  <a href="#1167e5">message</a>().
<h3 class="fn">bool<a name="8964b0"></a>QStatusBar::event(<a href="qevent.html">QEvent</a>*e) <code>[virtualprotected]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qobject.html#c67adb">QObject.</a>
<h3 class="fn">void<a name="0db6e4"></a>QStatusBar::hideOrShow() <code>[protected]</code></h3>
<p>Ensures that the right widgets are visible.  Used by <a href="#1167e5">message</a>()
and <a href="#1a0b3d">clear</a>().
<h3 class="fn">bool<a name="938ad4"></a>QStatusBar::isSizeGripEnabled()const</h3>
<p>Returns whether the <a href="qsizegrip.html">QSizeGrip</a> in the bottom right of the status bar
is enabled.
<p>See also  <a href="#8b3acc">setSizeGripEnabled</a>().
<h3 class="fn">void<a name="16f76d"></a>QStatusBar::message(const<a href="qstring.html">QString</a>&amp;message) <code>[slot]</code></h3>
<p>Hide the normal status indicators and display <em>message,</em> until
<a href="#1a0b3d">clear</a>() or another <a href="#1167e5">message</a>() is called.
<p>See also  <a href="#1a0b3d">clear</a>().
<h3 class="fn">void<a name="1167e5"></a>QStatusBar::message(const<a href="qstring.html">QString</a>&amp;message, intms) <code>[slot]</code></h3>
<p>Hide the normal status indications and display <em>message</em> for <em>ms</em> milli-seconds, or until <a href="#1a0b3d">clear</a>() or another message() is called,
whichever is first.
<h3 class="fn">void<a name="98074a"></a>QStatusBar::paintEvent(<a href="qpaintevent.html">QPaintEvent</a>*) <code>[virtualprotected]</code></h3>
<p>Shows the temporary message, if appropriate.
<p>Reimplemented from <a href="qwidget.html#e3d821">QWidget.</a>
<h3 class="fn">void<a name="5dff34"></a>QStatusBar::reformat() <code>[protected]</code></h3>
<p>Changes the status bar's appearance to account for item
changes. Special subclasses may need this, but normally
geometry management will take care of any necessary
rearrangements.
<h3 class="fn">void<a name="dc867a"></a>QStatusBar::removeWidget(<a href="qwidget.html">QWidget</a>*widget)</h3>
<p>Removes <em>widget</em> from the status bar.
<p>This function may cause some flicker.
<p>Note that <em>widget</em> is not deleted.
<p>See also  <a href="#99b094">addWidget</a>().
<h3 class="fn">void<a name="ca8893"></a>QStatusBar::resizeEvent(<a href="qresizeevent.html">QResizeEvent</a>*e) <code>[virtualprotected]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qwidget.html#7d375f">QWidget.</a>
<h3 class="fn">void<a name="8b3acc"></a>QStatusBar::setSizeGripEnabled(boolenabled)</h3>
<p>Enables or disables the <a href="qsizegrip.html">QSizeGrip</a> in the bottom right of the status bar.
By default, the size grip is enabled.
<p>See also  <a href="#938ad4">isSizeGripEnabled</a>().
<hr><p>
Search the documentation, FAQ, qt-interest archive and more (uses
<a href="http://www.trolltech.com">www.trolltech.com</a>):<br>
<form method=post action="http://www.trolltech.com/search.cgi">
<input type=hidden name="version" value="2.3.2"><nobr>
<input size="50" name="search"><input type=submit value="Search">
</nobr></form><hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>,
copyright &copy; 1995-2001
<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  2001 Trolltech<td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align="right"><div align="right">Qt version 2.3.2</div>
</table></div></address></body></html>