File: qheader.html

package info (click to toggle)
qt-x11 3%3A2.3.1-22
  • links: PTS
  • area: main
  • in suites: woody
  • size: 48,524 kB
  • ctags: 46,337
  • sloc: cpp: 260,077; ansic: 32,457; makefile: 31,131; yacc: 2,444; sh: 1,513; lex: 480; perl: 422; xml: 68; lisp: 15
file content (355 lines) | stat: -rw-r--r-- 26,736 bytes parent folder | download | duplicates (2)
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
<!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 - QHeader 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>QHeader Class Reference</h1><br clear="all">
<p>
The QHeader class provides a table header.
<a href="#details">More...</a>
<p>
<code>#include &lt;<a href="qheader-h.html">qheader.h</a>&gt;</code>
<p>
Inherits <a href="qwidget.html">QWidget</a>.
<p>Inherited by QTableHeader.
<p><a href="qheader-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li><div class="fn"><a href="#9983e0"><b>QHeader</b></a>(QWidget*parent=0, constchar*name=0)</div>
<li><div class="fn"><a href="#9a5fe9"><b>QHeader</b></a>(int, QWidget*parent=0, constchar*name=0)</div>
<li><div class="fn"><a href="#8ef76c"><b>~QHeader</b></a>()</div>
<li><div class="fn">int<a href="#4fb124"><b>addLabel</b></a>(constQString&amp;, intsize=-1)</div>
<li><div class="fn">int<a href="#4e26cb"><b>addLabel</b></a>(constQIconSet&amp;, constQString&amp;, intsize=-1)</div>
<li><div class="fn">void<a href="#c6deac"><b>removeLabel</b></a>(intsection)</div>
<li><div class="fn">virtualvoid<a href="#0009c8"><b>setLabel</b></a>(int, constQString&amp;, intsize=-1)</div>
<li><div class="fn">virtualvoid<a href="#6abb67"><b>setLabel</b></a>(int, constQIconSet&amp;, constQString&amp;, intsize=-1)</div>
<li><div class="fn">QString<a href="#e5a24f"><b>label</b></a>(intsection)const</div>
<li><div class="fn">QIconSet*<a href="#5478fa"><b>iconSet</b></a>(intsection)const</div>
<li><div class="fn">virtualvoid<a href="#c7c41b"><b>setOrientation</b></a>(Orientation)</div>
<li><div class="fn">Orientation<a href="#128d96"><b>orientation</b></a>()const</div>
<li><div class="fn">virtualvoid<a href="#fa228a"><b>setTracking</b></a>(boolenable)</div>
<li><div class="fn">bool<a href="#6be9b1"><b>tracking</b></a>()const</div>
<li><div class="fn">virtualvoid<a href="#be08d1"><b>setClickEnabled</b></a>(bool, intsection=-1)</div>
<li><div class="fn">virtualvoid<a href="#e7ae94"><b>setResizeEnabled</b></a>(bool, intsection=-1)</div>
<li><div class="fn">virtualvoid<a href="#6b779c"><b>setMovingEnabled</b></a>(bool)</div>
<li><div class="fn">bool<a href="#86115e"><b>isClickEnabled</b></a>(intsection=-1)const</div>
<li><div class="fn">bool<a href="#9d200e"><b>isResizeEnabled</b></a>(intsection=-1)const</div>
<li><div class="fn">bool<a href="#02e6e3"><b>isMovingEnabled</b></a>()const</div>
<li><div class="fn">void<a href="#2a52d4"><b>resizeSection</b></a>(intsection, ints)</div>
<li><div class="fn">int<a href="#da4058"><b>sectionSize</b></a>(intsection)const</div>
<li><div class="fn">int<a href="#20a3f9"><b>sectionPos</b></a>(intsection)const</div>
<li><div class="fn">int<a href="#a8b879"><b>sectionAt</b></a>(intpos)const</div>
<li><div class="fn">int<a href="#36a53c"><b>count</b></a>()const</div>
<li><div class="fn">virtualvoidsetCellSize(int, int)<em>(obsolete)</em></div>
<li><div class="fn">intcellSize(int)const<em>(obsolete)</em></div>
<li><div class="fn">intcellPos(int)const<em>(obsolete)</em></div>
<li><div class="fn">intcellAt(int)const<em>(obsolete)</em></div>
<li><div class="fn">int<a href="#873b80"><b>offset</b></a>()const</div>
<li><div class="fn">int<a href="#900a80"><b>mapToSection</b></a>(intindex)const</div>
<li><div class="fn">int<a href="#a5a6ff"><b>mapToIndex</b></a>(intsection)const</div>
<li><div class="fn">intmapToLogical(int)const<em>(obsolete)</em></div>
<li><div class="fn">intmapToActual(int)const<em>(obsolete)</em></div>
<li><div class="fn">void<a href="#4d544c"><b>moveSection</b></a>(intsection, inttoIndex)</div>
<li><div class="fn">virtualvoidmoveCell(int, int)<em>(obsolete)</em></div>
<li><div class="fn">void<a href="#1c1fc3"><b>setSortIndicator</b></a>(intsection, boolincreasing=TRUE)</div>
</ul>
<h2>Public Slots</h2>
<ul>
<li><div class="fn">virtualvoid<a href="#ef898e"><b>setUpdatesEnabled</b></a>(boolenable)</div>
<li><div class="fn">virtualvoid<a href="#442086"><b>setOffset</b></a>(intpos)</div>
</ul>
<h2>Signals</h2>
<ul>
<li><div class="fn">void<a href="#fcdf79"><b>clicked</b></a>(intsection)</div>
<li><div class="fn">void<a href="#942e94"><b>pressed</b></a>(intsection)</div>
<li><div class="fn">void<a href="#948fd5"><b>released</b></a>(intsection)</div>
<li><div class="fn">void<a href="#bc053c"><b>sizeChange</b></a>(intsection, intoldSize, intnewSize)</div>
<li><div class="fn">void<a href="#8dd30d"><b>indexChange</b></a>(intsection, intfromIndex, inttoIndex)</div>
<li><div class="fn">voidsectionClicked(int)<em>(obsolete)</em></div>
<li><div class="fn">voidmoved(int, int)<em>(obsolete)</em></div>
</ul>
<h2>Protected Members</h2>
<ul>
<li><div class="fn">QRect<a href="#a98e60"><b>sRect</b></a>(intindex)</div>
<li><div class="fn">void<a href="#2cb0f1"><b>paintSection</b></a>(QPainter*p, intindex, QRectfr)</div>
<li><div class="fn">void<a href="#b4930e"><b>paintSectionLabel</b></a>(QPainter*p, intindex, constQRect&amp;fr)</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>Orientation<td>orientation<td>orientation<td>setOrientation<td>&nbsp;
<tr><td>bool<td>tracking<td>tracking<td>setTracking<td>&nbsp;
<tr><td>int<td>count<td>count<td>&nbsp;<td>&nbsp;
<tr><td>int<td>offset<td>offset<td>setOffset<td>&nbsp;
<tr><td>bool<td>moving<td>isMovingEnabled<td>setMovingEnabled<td>&nbsp;
</table>
<hr><h2><a name="details"></a>Detailed Description</h2>
The QHeader class provides a table header.
<p>
This class provides a table header as known from spreadsheet-like widgets.
QHeader can be used vertically or horizontally (see <a href="#c7c41b">setOrientation</a>()).
<p>With <a href="#4e26cb">addLabel</a>() you can add sections, and with <a href="#c6deac">removeLabel</a>() you can remove
them. If you enabled clicking for one or all sections (see <a href="#be08d1">setClickEnabled</a>()),
the user can reorder the sections and click on them which may be used for
sorting (see also <a href="#1c1fc3">setSortIndicator</a>()). This feature is turned on by default.
<p>So, if the user reorders the sections by clicking and moving them with the mouse the index
of a section may change. This means, the section you inserted at the first
position might be displayed at a different index then. To get the index at which e.g
the first section is displayed, use <a href="#a5a6ff">mapToIndex</a>() with 0 as argument for our example.
<p>If you want e.g. to know which section is displayed at e.g. index 3 use
<a href="#900a80">mapToSection</a>() with 3 as argument.
<p>So, you can always work with the section numbers as you inserted them
without caring about the index at which they are displayed at the moment. Also
the API of QHeader works with the section numbers.
<p><img src=qheader-m.png> <img src=qheader-w.png>
<p>See also  <a href="qlistview.html">QListView</a> and <a href="qtableview.html">QTableView</a>.

<hr><h2>Member Function Documentation</h2>
<h3 class="fn"><a name="9983e0"></a>QHeader::QHeader(<a href="qwidget.html">QWidget</a>*parent=0, constchar*name=0)</h3>
<p>Constructs a horizontal header.
<p>The <em>parent</em> and <em>name</em> arguments are sent to the <a href="qwidget.html">QWidget</a> constructor.
<h3 class="fn"><a name="9a5fe9"></a>QHeader::QHeader(int<a href="n.html">n</a>, <a href="qwidget.html">QWidget</a>*parent=0, constchar*name=0)</h3>
<p>Constructs a horizontal header with <em><a href="n.html">n</a></em> sections.
<p>The <em>parent</em> and <em>name</em> arguments are sent to the <a href="qwidget.html">QWidget</a> constructor.
<h3 class="fn"><a name="8ef76c"></a>QHeader::~QHeader()</h3>
<p>Destructs the header.
<h3 class="fn">int<a name="4e26cb"></a>QHeader::addLabel(const<a href="qiconset.html">QIconSet</a>&amp;iconset, const<a href="qstring.html">QString</a>&amp;s, intsize=-1)</h3>
<p>Adds a new section, with icon set <em>iconset</em> and label text <em>s.</em> Returns the index.  If <em>size</em> is non-negative, the section width
is set to <em>size,</em> otherwise a size currently sufficient for the
label is used.
<h3 class="fn">int<a name="4fb124"></a>QHeader::addLabel(const<a href="qstring.html">QString</a>&amp;s, intsize=-1)</h3>
<p>Adds a new section, with label text <em>s.</em> Returns the index.
If <em>size</em> is non-negative, the section width is set to <em>size,</em>
otherwise a size currently sufficient for the label text is used.
<h3 class="fn">int<a name="1543ea"></a>QHeader::cellAt(intpos)const</h3>
<p><b>This function is obsolete.</b> It is provided to keep old source working, and will probably be removed in a future version of Qt.  We strongly advise against using it in new code.<p>
<p>Use <a href="#a8b879">sectionAt</a>() instead!
<p>Returns the index at which the section is displayed, which contains
<em>pos</em> in widget coordinates, or -1 if <em>pos</em> is outside the header
sections.
<h3 class="fn">int<a name="0b8a04"></a>QHeader::cellPos(inti)const</h3>
<p><b>This function is obsolete.</b> It is provided to keep old source working, and will probably be removed in a future version of Qt.  We strongly advise against using it in new code.<p>
<p>Use <a href="#20a3f9">sectionPos</a>() instead!
<p>Returns the position in pixels of the section which is displayed at the
index <em>i.</em> The  position is measured from the start of the header.
<h3 class="fn">int<a name="3dd62f"></a>QHeader::cellSize(inti)const</h3>
<p><b>This function is obsolete.</b> It is provided to keep old source working, and will probably be removed in a future version of Qt.  We strongly advise against using it in new code.<p>
<p>Use <a href="#da4058">sectionSize</a>() instead!
<p>Returns the size in pixels of the section which is displayed at
the index <em>i.</em>
<h3 class="fn">void<a name="fcdf79"></a>QHeader::clicked(intsection) <code>[signal]</code></h3>
<p>This signal is emitted when the user clicked onto the section
<em>section.</em>
<p>See also  <a href="#942e94">pressed</a>() and <a href="#948fd5">released</a>().
<h3 class="fn">int<a name="36a53c"></a>QHeader::count()const</h3>
<p>Returns the number of sections in the header.
<h3 class="fn"><a href="qiconset.html">QIconSet</a>*<a name="5478fa"></a>QHeader::iconSet(intsection)const</h3>
<p>Returns the icon set set on section <em>section.</em>
<h3 class="fn">void<a name="8dd30d"></a>QHeader::indexChange(intsection, intfromIndex, inttoIndex) <code>[signal]</code></h3>
<p>This signal is emitted if the user moved the section <em>section,</em> which
was displayed at the index <em>fromIndex</em> to the new index <em>toIndex.</em>
<h3 class="fn">bool<a name="86115e"></a>QHeader::isClickEnabled(intsection=-1)const</h3>
<p>Returns whether the section <em>section</em> is clickable or not.
If <em>section</em> is out of range (negative or larger than <a href="#36a53c">count</a>() - 1),
TRUE is returned if all sections are clickable, else FALSE.
<p>See also  <a href="#be08d1">setClickEnabled</a>().
<h3 class="fn">bool<a name="02e6e3"></a>QHeader::isMovingEnabled()const</h3>
<p>Returns TRUE if the sections of the header can be moved around be the user,
otherwise FALSE.
<p>See also  <a href="#6b779c">setMovingEnabled</a>().
<h3 class="fn">bool<a name="9d200e"></a>QHeader::isResizeEnabled(intsection=-1)const</h3>
<p>Returns whether the section <em>section</em> is resizeable or not.
If <em>section</em> is out of range (negative or larger than <a href="#36a53c">count</a>() - 1),
TRUE is returned if all sections are resizeable, else FALSE.
<p>See also  <a href="#e7ae94">setResizeEnabled</a>().
<h3 class="fn"><a href="qstring.html">QString</a><a name="e5a24f"></a>QHeader::label(intsection)const</h3>
<p>Returns the text set on section <em>section.</em>
<h3 class="fn">int<a name="6871e9"></a>QHeader::mapToActual(intl)const</h3>
<p><b>This function is obsolete.</b> It is provided to keep old source working, and will probably be removed in a future version of Qt.  We strongly advise against using it in new code.<p>
<p>Use <a href="#a5a6ff">mapToIndex</a>() instead!
<p>Translates from logical index <em>l</em> to actual index (index, at which the section <em>l</em> is displayed) .
Returns -1 if <em>l</em> is outside the legal range.
<p>See also  <a href="#327525">mapToLogical</a>().
<h3 class="fn">int<a name="a5a6ff"></a>QHeader::mapToIndex(intsection)const</h3>
<p>Returns the index at which the section <em>section</em> is
currently displayed.
<h3 class="fn">int<a name="327525"></a>QHeader::mapToLogical(inta)const</h3>
<p><b>This function is obsolete.</b> It is provided to keep old source working, and will probably be removed in a future version of Qt.  We strongly advise against using it in new code.<p>
<p>Use <a href="#900a80">mapToSection</a>() instead!
<p>Translates from actual index <em>a</em> (index at which the section is displayed)  to
logical index of the section.  Returns -1 if <em>a</em> is outside the legal range.
<p>See also  <a href="#6871e9">mapToActual</a>().
<h3 class="fn">int<a name="900a80"></a>QHeader::mapToSection(intindex)const</h3>
<p>Returns the section which is displayed at the index <em>index.</em>
<h3 class="fn">void<a name="284c02"></a>QHeader::mouseMoveEvent(<a href="qmouseevent.html">QMouseEvent</a>*e) <code>[virtualprotected]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qwidget.html#8b6935">QWidget.</a>
<h3 class="fn">void<a name="7ba5a2"></a>QHeader::mousePressEvent(<a href="qmouseevent.html">QMouseEvent</a>*e) <code>[virtualprotected]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qwidget.html#fb611b">QWidget.</a>
<h3 class="fn">void<a name="76cd98"></a>QHeader::mouseReleaseEvent(<a href="qmouseevent.html">QMouseEvent</a>*e) <code>[virtualprotected]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qwidget.html#773a0f">QWidget.</a>
<h3 class="fn">void<a name="d324de"></a>QHeader::moveCell(intfromIdx, inttoIdx) <code>[virtual]</code></h3>
<p><b>This function is obsolete.</b> It is provided to keep old source working, and will probably be removed in a future version of Qt.  We strongly advise against using it in new code.<p>
<p>Use <a href="#4d544c">moveSection</a>() instead!
<p>Moves the section which is currently displayed at the index <em>fromIndex</em>
to the index <em>toIdx.</em>
<h3 class="fn">void<a name="4d544c"></a>QHeader::moveSection(intsection, inttoIndex)</h3>
<p>Moves the section <em>section</em> to be displayed at the index
<em>toIndex.</em>
<h3 class="fn">void<a name="d41f5d"></a>QHeader::moved(intfromIndex, inttoIndex) <code>[signal]</code></h3>
<p><b>This function is obsolete.</b> It is provided to keep old source working, and will probably be removed in a future version of Qt.  We strongly advise against using it in new code.<p>
<p>Use <a href="#8dd30d">indexChange</a>() instead!
<p>This signal is emitted when the user has moved the section which
is displayed at the index <em>fromIndex</em> to the index <em>toIndex.</em>
<h3 class="fn">int<a name="873b80"></a>QHeader::offset()const</h3>
<p>Returns the leftmost (or uppermost for vertical headers) visible pixel.
<h3 class="fn"><a href="qt.html#Orientation">Orientation</a><a name="128d96"></a>QHeader::orientation()const</h3>
<p>Returns <code>Horizontal</code> if the header is horizontal, <code>Vertical</code> if
the header is vertical.
<h3 class="fn">void<a name="89a8a3"></a>QHeader::paintEvent(<a href="qpaintevent.html">QPaintEvent</a>*e) <code>[virtualprotected]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qwidget.html#ef2069">QWidget.</a>
<h3 class="fn">void<a name="2cb0f1"></a>QHeader::paintSection(<a href="qpainter.html">QPainter</a>*p, intindex, <a href="qrect.html">QRect</a>fr) <code>[protected]</code></h3>
<p>Paints actual section <em>index</em> of the header, inside rectangle <em>fr</em> in
widget coordinates.
<p>Calls <a href="#b4930e">paintSectionLabel</a>().
<h3 class="fn">void<a name="b4930e"></a>QHeader::paintSectionLabel(<a href="qpainter.html">QPainter</a>*p, intindex, const<a href="qrect.html">QRect</a>&amp;fr) <code>[protected]</code></h3>
<p>Paints the label of actual section <em>index</em> of the header, inside rectangle <em>fr</em> in
widget coordinates.
<p>Called by <a href="#2cb0f1">paintSection</a>().
<h3 class="fn">void<a name="942e94"></a>QHeader::pressed(intsection) <code>[signal]</code></h3>
<p>This signal is emitted when the user presses section <em>section</em> down.
<p>See also  <a href="#948fd5">released</a>().
<h3 class="fn">void<a name="948fd5"></a>QHeader::released(intsection) <code>[signal]</code></h3>
<p>This signal is emitted when section <em>section</em> is released.
<p>See also  <a href="#942e94">pressed</a>().
<h3 class="fn">void<a name="c6deac"></a>QHeader::removeLabel(intsection)</h3>
<p>Removes the section <em>section.</em>
<h3 class="fn">void<a name="2a52d4"></a>QHeader::resizeSection(intsection, ints)</h3>
<p>Resizes the section <em>section</em> to <em>s</em> pixels.
<h3 class="fn"><a href="qrect.html">QRect</a><a name="a98e60"></a>QHeader::sRect(intindex) <code>[protected]</code></h3>
<p>Returns the rectangle covered by index <em>index.</em>
<h3 class="fn">int<a name="a8b879"></a>QHeader::sectionAt(intpos)const</h3>
<p>Returns the <em>section</em> which contains the position <em>pos</em> given in pixels.
<p>See also  <a href="#873b80">offset</a>().
<h3 class="fn">void<a name="c3cfc3"></a>QHeader::sectionClicked(intindex) <code>[signal]</code></h3>
<p><b>This function is obsolete.</b> It is provided to keep old source working, and will probably be removed in a future version of Qt.  We strongly advise against using it in new code.<p>
<p>Use <a href="#fcdf79">clicked</a>() instead!
<p>This signal is emitted when a part of the header is clicked. <em>index</em> is the index at which the section is displayed.
<p>In a list view, this signal would typically be connected to a slot
which sorts the specified column (or row).
<h3 class="fn">int<a name="20a3f9"></a>QHeader::sectionPos(intsection)const</h3>
<p>Returns the position (in pixels) at which the <em>section</em> starts.
<p>See also  <a href="#873b80">offset</a>().
<h3 class="fn">int<a name="da4058"></a>QHeader::sectionSize(intsection)const</h3>
<p>Returns the size of the <em>section</em> in pixels.
<h3 class="fn">void<a name="85d5f9"></a>QHeader::setCellSize(intsection, ints) <code>[virtual]</code></h3>
<p><b>This function is obsolete.</b> It is provided to keep old source working, and will probably be removed in a future version of Qt.  We strongly advise against using it in new code.<p>
<p>Use <a href="#2a52d4">resizeSection</a>() instead!
<p>Sets the size of the section <em>section</em> to <em>s</em> pixels.<p><b>Warning:</b> does not repaint or send out signals.
<h3 class="fn">void<a name="be08d1"></a>QHeader::setClickEnabled(boolenable, intsection=-1) <code>[virtual]</code></h3>
<p>Enable clicking in section <em>section</em> if <em>enable</em> is TRUE, disable
otherwise.  If <em>section</em> is negative (as it is by default), clicking is
enabled/disabled for all current and new sections.
<p>If enabled, the <a href="#fcdf79">clicked</a>() signal is emitted when the user clicks.
<p>See also  <a href="#6b779c">setMovingEnabled</a>() and <a href="#e7ae94">setResizeEnabled</a>().
<h3 class="fn">void<a name="6abb67"></a>QHeader::setLabel(intsection, const<a href="qiconset.html">QIconSet</a>&amp;iconset, const<a href="qstring.html">QString</a>&amp;s, intsize=-1) <code>[virtual]</code></h3>
<p>Sets the icon on the section <em>section</em> to <em>iconset</em> and the text to <em>s.</em>
If the section does not exist, nothing happens.
If <em>size</em> is non-negative, the section width is set to <em>size.</em>
<p>Any icon set that has been defined for this section remains
unchanged.
<h3 class="fn">void<a name="0009c8"></a>QHeader::setLabel(intsection, const<a href="qstring.html">QString</a>&amp;s, intsize=-1) <code>[virtual]</code></h3>
<p>Sets the text on section <em>section</em> to <em>s.</em> If the section does not exist,
nothing happens.
If <em>size</em> is non-negative, the section width is set to <em>size.</em>
<p>Any icon set that has been defined for this section remains
unchanged.
<h3 class="fn">void<a name="6b779c"></a>QHeader::setMovingEnabled(boolenable) <code>[virtual]</code></h3>
<p>Enable the user to exchange sections if <em>enable</em> is TRUE,
disable otherwise.
<p>If you enable moving here, the <a href="#8dd30d">indexChange</a>() signal is emitted if
the user moves a section.
<p>See also  <a href="#be08d1">setClickEnabled</a>() and <a href="#e7ae94">setResizeEnabled</a>().
<h3 class="fn">void<a name="442086"></a>QHeader::setOffset(intx) <code>[virtualslot]</code></h3>
<p>Scrolls the header such that <em>x</em> becomes the leftmost (or uppermost
for vertical headers) visible pixel.
<h3 class="fn">void<a name="c7c41b"></a>QHeader::setOrientation(<a href="qt.html#Orientation">Orientation</a>orientation) <code>[virtual]</code></h3>
<p>Sets the header orientation.  The <em>orientation</em> must be
QHeader::Vertical or QHeader::Horizontal.
<p>When adding labels without the size parameter, setOrientation
should be called first, otherwise labels will be sized incorrectly.
<p>See also  <a href="#128d96">orientation</a>().
<h3 class="fn">void<a name="e7ae94"></a>QHeader::setResizeEnabled(boolenable, intsection=-1) <code>[virtual]</code></h3>
<p>Enable user resizing of the section <em>section</em> if <em>enable</em> is TRUE,
disable otherwise.  If <em>section</em> is negative (as it is by default), resizing is
enabled/disabled for all current and new sections.
<p>If the user resizes a section (because this feature enabled it), a <a href="#bc053c">sizeChange</a>()
signal is emitted.
<p>See also  <a href="#6b779c">setMovingEnabled</a>() and <a href="#be08d1">setClickEnabled</a>().
<h3 class="fn">void<a name="1c1fc3"></a>QHeader::setSortIndicator(intsection, boolincreasing=TRUE)</h3>
<p>As often the QHeader is used together with a list widget,
QHeader can indicate a sort order. This is done using an arrow at
the right edge of a section which points up or down. <em>section</em>
specifies in which section this arrow should be drawn, and <em>increasing,</em> if the arrow should point to the bottom (TRUE) or the
the top (FALSE).  If <em>section</em> is -1, no arrow is drawn.
<p>See also  <a href="qlistview.html#49a59f">QListView::setShowSortIndicator</a>().
<h3 class="fn">void<a name="fa228a"></a>QHeader::setTracking(boolenable) <code>[virtual]</code></h3>
<p>Sets tracking if <em>enable</em> is TRUE, otherwise turns off tracking.
If tracking is on, the <a href="#bc053c">sizeChange</a>() signal is emitted continuously
while the mouse is moved, otherwise it is only emitted when the
mouse button is released.
<p>See also  <a href="#6be9b1">tracking</a>().
<h3 class="fn">void<a name="ef898e"></a>QHeader::setUpdatesEnabled(boolenable) <code>[virtualslot]</code></h3>
<p>reimp.
<p>Reimplemented from <a href="qwidget.html#f4ffd3">QWidget.</a>
<h3 class="fn">void<a name="54a441"></a>QHeader::showEvent(<a href="qshowevent.html">QShowEvent</a>*e) <code>[virtualprotected]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qwidget.html#add426">QWidget.</a>
<h3 class="fn">void<a name="bc053c"></a>QHeader::sizeChange(intsection, intoldSize, intnewSize) <code>[signal]</code></h3>
<p>This signal is emitted when the user has changed the size of some
of a <em>section</em> of the header from <em>oldSize</em> to <em>newSize.</em> This signal is
typically connected to a slot that repaints the table.
<h3 class="fn"><a href="qsize.html">QSize</a><a name="24d828"></a>QHeader::sizeHint()const <code>[virtual]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qwidget.html#290bcd">QWidget.</a>
<h3 class="fn"><a href="qsizepolicy.html">QSizePolicy</a><a name="9df67b"></a>QHeader::sizePolicy()const <code>[virtual]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qwidget.html#2d5d13">QWidget.</a>
<h3 class="fn">bool<a name="6be9b1"></a>QHeader::tracking()const</h3>
<p>Returns TRUE if tracking is on, FALSE otherwise.
<p>See also  <a href="#fa228a">setTracking</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.1"><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-2000
<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  2000 Trolltech<td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align="right"><div align="right">Qt version 2.3.1</div>
</table></div></address></body></html>