File: qmainwindow.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 (408 lines) | stat: -rw-r--r-- 29,230 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
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
<!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 - QMainWindow 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>QMainWindow Class Reference</h1><br clear="all">
<p>
The QMainWindow class provides a typical application window, with a menu bar, some tool bars and a status bar.
<a href="#details">More...</a>
<p>
<code>#include &lt;<a href="qmainwindow-h.html">qmainwindow.h</a>&gt;</code>
<p>
Inherits <a href="qwidget.html">QWidget</a>.
<p><a href="qmainwindow-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li><div class="fn"><a href="#9a91e1"><b>QMainWindow</b></a>(QWidget*parent=0, constchar*name=0, WFlagsf=WType_TopLevel)</div>
<li><div class="fn"><a href="#8832d5"><b>~QMainWindow</b></a>()</div>
<li><div class="fn">QMenuBar*<a href="#2fcbc3"><b>menuBar</b></a>()const</div>
<li><div class="fn">QStatusBar*<a href="#14153d"><b>statusBar</b></a>()const</div>
<li><div class="fn">QToolTipGroup*<a href="#4f5d02"><b>toolTipGroup</b></a>()const</div>
<li><div class="fn">virtualvoid<a href="#0983b6"><b>setCentralWidget</b></a>(QWidget*)</div>
<li><div class="fn">QWidget*<a href="#874e7d"><b>centralWidget</b></a>()const</div>
<li><div class="fn">enum<a href="#ToolBarDock"><b>ToolBarDock</b></a>{Unmanaged, TornOff, Top, Bottom, Right, Left, Minimized}</div>
<li><div class="fn">virtualvoid<a href="#6c19ce"><b>setDockEnabled</b></a>(ToolBarDockdock, boolenable)</div>
<li><div class="fn">bool<a href="#492e75"><b>isDockEnabled</b></a>(ToolBarDockdock)const</div>
<li><div class="fn">void<a href="#dee7ae"><b>setDockEnabled</b></a>(QToolBar*tb, ToolBarDockdock, boolenable)</div>
<li><div class="fn">bool<a href="#eed6b5"><b>isDockEnabled</b></a>(QToolBar*tb, ToolBarDockdock)const</div>
<li><div class="fn">void<a href="#95dc7d"><b>addToolBar</b></a>(QToolBar*, ToolBarDock=Top, boolnewLine=FALSE)</div>
<li><div class="fn">void<a href="#63cf8b"><b>addToolBar</b></a>(QToolBar*, constQString&amp;label, ToolBarDock=Top, boolnewLine=FALSE)</div>
<li><div class="fn">void<a href="#3c1688"><b>moveToolBar</b></a>(QToolBar*, ToolBarDock=Top)</div>
<li><div class="fn">void<a href="#5d7a7b"><b>moveToolBar</b></a>(QToolBar*, ToolBarDock, boolnl, intindex, intextraOffset=-1)</div>
<li><div class="fn">void<a href="#9d9d21"><b>removeToolBar</b></a>(QToolBar*)</div>
<li><div class="fn">bool<a href="#b667ba"><b>rightJustification</b></a>()const</div>
<li><div class="fn">bool<a href="#725ddd"><b>usesBigPixmaps</b></a>()const</div>
<li><div class="fn">bool<a href="#609172"><b>usesTextLabel</b></a>()const</div>
<li><div class="fn">bool<a href="#308027"><b>toolBarsMovable</b></a>()const</div>
<li><div class="fn">bool<a href="#22f243"><b>opaqueMoving</b></a>()const</div>
<li><div class="fn">bool<a href="#a2d60b"><b>getLocation</b></a>(QToolBar*tb, ToolBarDock&amp;dock, int&amp;index, bool&amp;nl, int&amp;extraOffset)const</div>
<li><div class="fn">void<a href="#eedf5e"><b>lineUpToolBars</b></a>(boolkeepNewLines=FALSE)</div>
<li><div class="fn">bool<a href="#026ae1"><b>isDockMenuEnabled</b></a>()const</div>
</ul>
<h2>Public Slots</h2>
<ul>
<li><div class="fn">virtualvoid<a href="#deadb2"><b>setRightJustification</b></a>(bool)</div>
<li><div class="fn">virtualvoid<a href="#44e8cb"><b>setUsesBigPixmaps</b></a>(bool)</div>
<li><div class="fn">void<a href="#0e35cf"><b>setUsesTextLabel</b></a>(bool)</div>
<li><div class="fn">void<a href="#aa099c"><b>setToolBarsMovable</b></a>(bool)</div>
<li><div class="fn">void<a href="#3d6632"><b>setOpaqueMoving</b></a>(bool)</div>
<li><div class="fn">void<a href="#382603"><b>setDockMenuEnabled</b></a>(bool)</div>
<li><div class="fn">void<a href="#db02bc"><b>whatsThis</b></a>()</div>
</ul>
<h2>Signals</h2>
<ul>
<li><div class="fn">void<a href="#f392de"><b>pixmapSizeChanged</b></a>(bool)</div>
<li><div class="fn">void<a href="#ad6a70"><b>usesTextLabelChanged</b></a>(bool)</div>
<li><div class="fn">void<a href="#ac17f3"><b>startMovingToolBar</b></a>(QToolBar*)</div>
<li><div class="fn">void<a href="#6a1195"><b>endMovingToolBar</b></a>(QToolBar*)</div>
<li><div class="fn">void<a href="#f678e3"><b>toolBarPositionChanged</b></a>(QToolBar*)</div>
</ul>
<h2>Protected Members</h2>
<ul>
<li><div class="fn">virtualvoid<a href="#c1fe7b"><b>resizeEvent</b></a>(QResizeEvent*)</div>
<li><div class="fn">virtualvoid<a href="#366599"><b>childEvent</b></a>(QChildEvent*)</div>
</ul>
<h2>Protected Slots</h2>
<ul>
<li><div class="fn">virtualvoid<a href="#bafbe0"><b>setUpLayout</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>rightJustification<td>rightJustification<td>setRightJustification<td>&nbsp;
<tr><td>bool<td>usesBigPixmaps<td>usesBigPixmaps<td>setUsesBigPixmaps<td>&nbsp;
<tr><td>bool<td>usesTextLabel<td>usesTextLabel<td>setUsesTextLabel<td>&nbsp;
<tr><td>bool<td>toolBarsMovable<td>toolBarsMovable<td>setToolBarsMovable<td>&nbsp;
<tr><td>bool<td>opaqueMoving<td>opaqueMoving<td>setOpaqueMoving<td>&nbsp;
</table>
<hr><h2><a name="details"></a>Detailed Description</h2>
The QMainWindow class provides a typical application window, with a menu bar, some tool bars and a status bar.
<p>
In addition, you need the large central widget, which you supply and
tell QMainWindow about using <a href="#0983b6">setCentralWidget</a>(), and perhaps a few
tool bars, which you can add using <a href="#63cf8b">addToolBar</a>().
<p>The central widget is not touched by QMainWindow.  QMainWindow
manages its geometry, and that is all.  For example, the
application/application.cpp example (an editor) sets a <a href="qmultilineedit.html">QMultiLineEdit</a>
to be the central widget.
<p>QMainWindow automatically detects the creation of a menu bar or
status bar if you specify the QMainWindow as parent, or you can use
the provided <a href="#2fcbc3">menuBar</a>() and <a href="#14153d">statusBar</a>() functions.  menuBar() and
statusBar() create a suitable widget if one doesn't exist, and
updates the window's layout to make space.
<p>QMainWindow also provides a <a href="qtooltipgroup.html">QToolTipGroup</a> connected to the status
bar.  <a href="#4f5d02">toolTipGroup</a>() provides access to the QToolTipGroup, but there
is no way to set the tool tip group.
<p>The QMainWindow allows by default toolbars in all docking areas.
You can use <a href="#6c19ce">setDockEnabled</a>() to enable and disable docking areas
for toolbars. Currently, only <code>Top, Left, Right, Bottom</code>
and <code>Minimized</code> are meaningful.
<p>Several functions let you change the appearance of a QMainWindow
globally: <ul>
<li> <a href="#deadb2">setRightJustification</a>() determines whether QMainWindow
should ensure that the toolbars fill the available space
(see also <a href="qtoolbar.html#511ffc">QToolBar::setHorizontalStretchable</a>() and <a href="qtoolbar.html#6dbf4a">QToolBar::setVerticalStretchable</a>()),
<li>  <a href="#44e8cb">setUsesBigPixmaps</a>() determines whether <a href="qtoolbutton.html">QToolButton</a> (and other
classes) should draw small or large pixmaps (see <a href="qiconset.html">QIconSet</a> for more
about that),
<li> <a href="#0e35cf">setUsesTextLabel</a>() determines whether the toolbar buttons (and
other classes), should display a textlabel in addition to pixmaps (see
QToolButton for more about that).
</ul>
<p>Toolbars can be dragged by the user into each enabled docking area
and inside each docking area to change the order of the toolbars
there. This feature can be enabled and disabled using <a href="#aa099c">setToolBarsMovable</a>().
By default this feature is enabled. If the <code>Minimized</code> dock is enabled the user
can <a href="qwidget.html#bc7c6a">hide</a>(minimize)/<a href="#e71bb3">show</a>(restore) a toolbar with a click on the toolbar handle. The handles of
all minimized toolbars are drawn below the menu bar in one row, and if the user
moves the mouse cursor onto such a handle, the label of the toolbar
is displayed in a tool tip (see <a href="qtoolbar.html#63c372">QToolBar::label</a>()). So if you enable the Minimized dock,
you should specify a meaningful label for each toolbar.
<p>Normally toolbars are moved transparently (this means while the user
drags one, a rectangle is drawn on the screen). With <a href="#3d6632">setOpaqueMoving</a>()
it's possible to switch between opaque and transparent moving
of toolbars.
<p>The main window's menubar is static (on the top) by default. If you want a movable
menubar, create a <a href="qmenubar.html">QMenuBar</a> as stretchable widget inside its
own movable toolbar and restrict this toolbar to only live within the
Top or Bottom dock:
<pre>  <a href="qtoolbar.html">QToolBar</a> *tb = new <a href="qtoolbar.html">QToolBar</a>( this );
  addToolBar( tb, tr( "Menubar" ), Top, FALSE );
  <a href="qmenubar.html">QMenuBar</a> *mb = new <a href="qmenubar.html">QMenuBar</a>( tb );
  mb-&gt;<a href="qframe.html#c0d758">setFrameStyle</a>( QFrame::NoFrame );
  tb-&gt;<a href="qtoolbar.html#cf1b0e">setStretchableWidget</a>( mb );
  setDockEnabled( tb, Left, FALSE );
  setDockEnabled( tb, Right, FALSE );
</pre>
<p>An application with multiple toolbars can choose to save the current
toolbar layout in order to restore it in the next session. To do so,
use <a href="#a2d60b">getLocation</a>() on each toolbar, store the data and restore the
layout using <a href="#052329">moveToolBar</a>() on each toolbar again. When restoring,
ensure to move the toolbars in exactly the same order in which you
got the information.
<p>For multi-document interfaces (MDI), use a <a href="qworkspace.html">QWorkspace</a> as central
widget.
<p><img src=qmainwindow-m.png> <img src=qmainwindow-w.png>
<p>See also  <a href="qtoolbar.html">QToolBar</a>, <a href="qstatusbar.html">QStatusBar</a>, <a href="qmenubar.html">QMenuBar</a>, <a href="qtooltipgroup.html">QToolTipGroup</a> and <a href="qdialog.html">QDialog</a>.
<p>Examples:
 <a href="mainlyQt-editor-cpp.html#QMainWindow">mainlyQt/editor.cpp</a>

<hr><h2>Member Type Documentation</h2>
<h3 class="fn"><a name="ToolBarDock">QMainWindow::ToolBarDock</a></h3>
Each toolbar can be in one of the following positions:
<ul>
<li><code>Top</code> - above the central widget, below the menubar.
<li><code>Bottom</code> - below the central widget, above the status bar.
<li><code>Left</code> - to the left of the central widget.
<li><code>Right</code> - to the left of the central widget.
<li><code>Minimized</code> - the toolbar is not shown - all handles of minimized toolbars
are drawn in one row below the menu bar.
</ul>
<p>Other values are also defined for future expansion.
<hr><h2>Member Function Documentation</h2>
<h3 class="fn"><a name="9a91e1"></a>QMainWindow::QMainWindow(<a href="qwidget.html">QWidget</a>*parent=0, constchar*name=0, WFlagsf=WType_TopLevel)</h3>
<p>Constructs an empty main window.
<h3 class="fn"><a name="8832d5"></a>QMainWindow::~QMainWindow()</h3>
<p>Destructs the object and frees any allocated resources.
<h3 class="fn">void<a name="95dc7d"></a>QMainWindow::addToolBar(<a href="qtoolbar.html">QToolBar</a>*toolBar, <a href="qmainwindow.html#ToolBarDock">ToolBarDock</a>edge=Top, boolnewLine=FALSE)</h3>
<p>Adds <em>toolBar</em> to this the end of <em>edge</em> and makes it start a
new line of tool bars if <em>nl</em> is TRUE.
<p>If <em>toolBar</em> is already managed by some main window, it is first
removed from that window.
<h3 class="fn">void<a name="63cf8b"></a>QMainWindow::addToolBar(<a href="qtoolbar.html">QToolBar</a>*toolBar, const<a href="qstring.html">QString</a>&amp;label, <a href="qmainwindow.html#ToolBarDock">ToolBarDock</a>edge=Top, boolnewLine=FALSE)</h3>
<p>Adds <em>toolBar</em> to this the end of <em>edge,</em> labelling it <em>label</em>
and makes it start a new line of tool bars if <em>newLine</em> is TRUE.
<p>If <em>toolBar</em> is already managed by some main window, it is first
removed from that window.
<h3 class="fn"><a href="qwidget.html">QWidget</a>*<a name="874e7d"></a>QMainWindow::centralWidget()const</h3>
<p>Returns a pointer to the main child of this main widget.  The
main child is the big widget around which the tool bars are
arranged.
<p>See also  <a href="#0983b6">setCentralWidget</a>().
<p>Examples:
 <a href="qfd-qfd-cpp.html#centralWidget">qfd/qfd.cpp</a>
<h3 class="fn">void<a name="366599"></a>QMainWindow::childEvent(<a href="qchildevent.html">QChildEvent</a>*e) <code>[virtualprotected]</code></h3>
<p>Monitors events to ensure layout is updated.
<p>Reimplemented from <a href="qobject.html#5c5734">QObject.</a>
<h3 class="fn">void<a name="6a1195"></a>QMainWindow::endMovingToolBar(<a href="qtoolbar.html">QToolBar</a>*toolbar) <code>[signal]</code></h3>
<p>This signal is emitted if the <em>toolbar</em> has been moved by
the user and he/she released the mouse button now, so he/she
stopped the moving.
<h3 class="fn">bool<a name="7568fa"></a>QMainWindow::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#c8b023">QObject.</a>
<h3 class="fn">bool<a name="cc031a"></a>QMainWindow::eventFilter(<a href="qobject.html">QObject</a>*o, <a href="qevent.html">QEvent</a>*e) <code>[virtual]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qobject.html#bb8547">QObject.</a>
<h3 class="fn">bool<a name="a2d60b"></a>QMainWindow::getLocation(<a href="qtoolbar.html">QToolBar</a>*tb, <a href="qmainwindow.html#ToolBarDock">ToolBarDock</a>&amp;dock, int&amp;index, bool&amp;nl, int&amp;extraOffset)const</h3>
<p>Finds and gives back the <em>dock</em> and the <em>index</em> there of the toolbar <em>tb. dock</em> is
set to the dock of the mainwindow in which <em>tb</em> is and <em>index</em> is set to the
position of the toolbar in this dock. If the toolbar has a new line, <em>nl</em> is set to TRUE,
else to FALSE.
<p>This method returns TRUE if the information could be found out, otherwise FALSE
(e.g. because the toolbar <em>tb</em> was not found in this mainwindow).
<h3 class="fn">bool<a name="492e75"></a>QMainWindow::isDockEnabled(<a href="qmainwindow.html#ToolBarDock">ToolBarDock</a>dock)const</h3>
<p>Returns TRUE if <em>dock</em> is enabled, or FALSE if it is not.
<p>See also  <a href="#6c19ce">setDockEnabled</a>().
<h3 class="fn">bool<a name="eed6b5"></a>QMainWindow::isDockEnabled(<a href="qtoolbar.html">QToolBar</a>*tb, <a href="qmainwindow.html#ToolBarDock">ToolBarDock</a>dock)const</h3>
<p>Returns TRUE if <em>dock</em> is enabled for the toolbar <em>tb</em> , or FALSE if it is not.
<p>See also  <a href="#6c19ce">setDockEnabled</a>().
<h3 class="fn">bool<a name="026ae1"></a>QMainWindow::isDockMenuEnabled()const</h3>
<p>Returns TRUE, if rightclicking on an empty space on a toolbar dock
or rightclicking on a toolbar handle opens a popup menu which allows
lining up toolbars and hiding/showing toolbars.
<p>See also  <a href="#6c19ce">setDockEnabled</a>() and <a href="#eedf5e">lineUpToolBars</a>().
<h3 class="fn">void<a name="eedf5e"></a>QMainWindow::lineUpToolBars(boolkeepNewLines=FALSE)</h3>
<p>As toolbars can be freely moved inside docks, it's possible to line them
up nicely with this method to get rid of all the unused space. If <em>keepNewLines</em>
is TRUE, all toolbars stay in the line in which they are, else they are packed
together as compact as possible.
<p>The method only works if movable() returns TRUE.
<h3 class="fn"><a href="qmenubar.html">QMenuBar</a>*<a name="2fcbc3"></a>QMainWindow::menuBar()const</h3>
<p>Returns the menu bar for this window.  If there isn't any,
menuBar() creates an empty menu bar on the fly.
<p>See also  <a href="#14153d">statusBar</a>().
<h3 class="fn"><a href="qsize.html">QSize</a><a name="090eac"></a>QMainWindow::minimumSizeHint()const <code>[virtual]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qwidget.html#3f0fc2">QWidget.</a>
<h3 class="fn">void<a name="3c1688"></a>QMainWindow::moveToolBar(<a href="qtoolbar.html">QToolBar</a>*toolBar, <a href="qmainwindow.html#ToolBarDock">ToolBarDock</a>edge=Top)</h3>
<p>Moves <em>toolBar</em> to this the end of <em>edge.</em>
<p>If <em>toolBar</em> is already managed by some main window, it is moved from
that window to this.
<h3 class="fn">void<a name="5d7a7b"></a>QMainWindow::moveToolBar(<a href="qtoolbar.html">QToolBar</a>*toolBar, <a href="qmainwindow.html#ToolBarDock">ToolBarDock</a>edge, boolnl, intindex, intextraOffset=-1)</h3>
<p>Moves <em>toolBar</em> to the position <em>index</em> of <em>edge.</em>
<p>If <em>toolBar</em> is already managed by some main window, it is moved from
that window to this.
<h3 class="fn">bool<a name="22f243"></a>QMainWindow::opaqueMoving()const</h3>
<p>Returns whether the toolbars of the mainwindow can
be moved opaque or transparent.
<p>See also  <a href="#3d6632">setOpaqueMoving</a>().
<h3 class="fn">void<a name="2ead64"></a>QMainWindow::paintEvent(<a href="qpaintevent.html">QPaintEvent</a>*) <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="f392de"></a>QMainWindow::pixmapSizeChanged(bool) <code>[signal]</code></h3>
<p>This signal is called whenever the <a href="#44e8cb">setUsesBigPixmaps</a>() is called
with a value which is different from the current setting.  All
relevant widgets must connect to this signal.
<h3 class="fn">void<a name="9d9d21"></a>QMainWindow::removeToolBar(<a href="qtoolbar.html">QToolBar</a>*toolBar)</h3>
<p>Removes <em>toolBar</em> from this main window's docking area, if <em>toolBar</em> is
non-null and known by this main window.
<h3 class="fn">void<a name="c1fe7b"></a>QMainWindow::resizeEvent(<a href="qresizeevent.html">QResizeEvent</a>*) <code>[virtualprotected]</code></h3>
<p>Monitors events to ensure layout is updated.
<p>Reimplemented from <a href="qwidget.html#28c156">QWidget.</a>
<h3 class="fn">bool<a name="b667ba"></a>QMainWindow::rightJustification()const</h3>
<p>Returns TRUE if this main windows right-justifies its toolbars, and
FALSE if it uses a ragged right edge.
<p>The default is to use a ragged right edge.
<p>("Right edge" sometimes means "bottom edge".)
<p>See also  <a href="#deadb2">setRightJustification</a>().
<h3 class="fn">void<a name="0983b6"></a>QMainWindow::setCentralWidget(<a href="qwidget.html">QWidget</a>*w) <code>[virtual]</code></h3>
<p>Sets the central widget for this window to <em>w.</em>  The central
widget is the one around which the toolbars etc. are arranged.
<h3 class="fn">void<a name="6c19ce"></a>QMainWindow::setDockEnabled(<a href="qmainwindow.html#ToolBarDock">ToolBarDock</a>dock, boolenable)</h3>
<p>Sets <em>dock</em> to be available if <em>enable</em> is TRUE, and not
available if <em>enable</em> is FALSE.
<p>The user can drag a toolbar to any enabled dock.
<h3 class="fn">void<a name="dee7ae"></a>QMainWindow::setDockEnabled(<a href="qtoolbar.html">QToolBar</a>*tb, <a href="qmainwindow.html#ToolBarDock">ToolBarDock</a>dock, boolenable)</h3>
<p>Sets <em>dock</em> to be available for the toolbar <em>tb</em> if <em>enable</em> is TRUE, and not
available if <em>enable</em> is FALSE.
<p>The user can drag the toolbar to any enabled dock.
<h3 class="fn">void<a name="382603"></a>QMainWindow::setDockMenuEnabled(boolb) <code>[slot]</code></h3>
<p>When passing TRUE for <em>b</em> here, rightclicking on an empty space on a toolbar dock
or rightclicking on a toolbar handle opens a popup menu which allows lining up toolbars
and hiding/showing toolbars.
<p>See also  <a href="#eedf5e">lineUpToolBars</a>() and <a href="#026ae1">isDockMenuEnabled</a>().
<h3 class="fn">void<a name="3d6632"></a>QMainWindow::setOpaqueMoving(boolb) <code>[slot]</code></h3>
<p>If you set <em>b</em> to TRUE, the use can move the
toolbars opaque, otherwise this is done transparent. This
setting makes only sense, if <a href="#308027">toolBarsMovable</a>() is set to TRUE.
<p>See also  setToolbarsMovable().
<h3 class="fn">void<a name="deadb2"></a>QMainWindow::setRightJustification(boolenable) <code>[virtualslot]</code></h3>
<p>Sets this main window to right-justifies its toolbars if <em>enable</em>
is TRUE. If enable is FALSE, only stretchable toolbars are expanded,
while non-stretchable toolbars get just the space they need. Given
that most toolbars are not stretchable, this usually results in a
ragged right edge.
<p>The default is FALSE.
<p>See also  <a href="#b667ba">rightJustification</a>(), <a href="qtoolbar.html#6dbf4a">QToolBar::setVerticalStretchable</a>() and <a href="qtoolbar.html#511ffc">QToolBar::setHorizontalStretchable</a>().
<h3 class="fn">void<a name="aa099c"></a>QMainWindow::setToolBarsMovable(boolenable) <code>[slot]</code></h3>
<p>Sets the toolbars to be movable if <em>enable</em> is TRUE, or static
otherwise.
<p>Movable toolbars can be dragged around between and within the
different toolbar docks by the user. By default toolbars are moved
transparent, but this setting can be changed by <a href="#3d6632">setOpaqueMoving</a>().
<p>The default is TRUE.
<p>See also  <a href="#6c19ce">setDockEnabled</a>(), <a href="#308027">toolBarsMovable</a>() and <a href="#3d6632">setOpaqueMoving</a>().
<h3 class="fn">void<a name="bafbe0"></a>QMainWindow::setUpLayout() <code>[virtualprotected slot]</code></h3>
<p>Sets up the geometry management of this window.  Called
automatically when needed, so you should never need to call this.
<h3 class="fn">void<a name="44e8cb"></a>QMainWindow::setUsesBigPixmaps(boolenable) <code>[virtualslot]</code></h3>
<p>Sets tool buttons in this main windows to use big pixmaps if <em>enable</em> is TRUE, and small pixmaps if <em>enable</em> is FALSE.
<p>The default is FALSE.
<p>Tool buttons and other interested widgets are responsible for
reading the correct state on startup, and for connecting to this
widget's <a href="#f392de">pixmapSizeChanged</a>() signal.
<p>See also  <a href="qtoolbutton.html#3e8336">QToolButton::setUsesBigPixmap</a>().
<h3 class="fn">void<a name="0e35cf"></a>QMainWindow::setUsesTextLabel(boolenable) <code>[slot]</code></h3>
<p>Sets tool buttons in this main windows to use text labels if <em>enable</em> is TRUE, and no text labels otherwise.
<p>The default is FALSE.
<p>Tool buttons and other interested widgets are responsible for
reading the correct state on startup, and for connecting to this
widget's <a href="#ad6a70">usesTextLabelChanged</a>() signal.
<p>See also  <a href="qtoolbutton.html#46ee3e">QToolButton::setUsesTextLabel</a>().
<h3 class="fn">void<a name="e71bb3"></a>QMainWindow::show() <code>[virtual]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Examples:
 <a href="action-main-cpp.html#show">action/main.cpp</a>
 <a href="themes-main-cpp.html#show">themes/main.cpp</a>
 <a href="mainlyQt-editor-cpp.html#show">mainlyQt/editor.cpp</a>
 <a href="application-main-cpp.html#show">application/main.cpp</a>
 <a href="helpviewer-main-cpp.html#show">helpviewer/main.cpp</a>
 <a href="i18n-main-cpp.html#show">i18n/main.cpp</a>
 <a href="fileiconview-main-cpp.html#show">fileiconview/main.cpp</a>
 <a href="scribble-main-cpp.html#show">scribble/main.cpp</a>
 <a href="qfd-qfd-cpp.html#show">qfd/qfd.cpp</a>
 <a href="addressbook-main-cpp.html#show">addressbook/main.cpp</a>
 <a href="mdi-main-cpp.html#show">mdi/main.cpp</a>
<p>Reimplemented from <a href="qwidget.html#ccc8f7">QWidget.</a>
<h3 class="fn"><a href="qsize.html">QSize</a><a name="d76edc"></a>QMainWindow::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">void<a name="ac17f3"></a>QMainWindow::startMovingToolBar(<a href="qtoolbar.html">QToolBar</a>*toolbar) <code>[signal]</code></h3>
<p>This signal is emitted when the <em>toolbar</em> starts moving because
the user started dragging it.
<h3 class="fn"><a href="qstatusbar.html">QStatusBar</a>*<a name="14153d"></a>QMainWindow::statusBar()const</h3>
<p>Returns the status bar for this window.  If there isn't any,
statusBar() creates an empty status bar on the fly, and if necessary
a tool tip group too.
<p>See also  <a href="#2fcbc3">menuBar</a>() and <a href="#4f5d02">toolTipGroup</a>().
<p>Examples:
 <a href="qfd-qfd-cpp.html#statusBar">qfd/qfd.cpp</a>
<h3 class="fn">void<a name="be8549"></a>QMainWindow::styleChange(<a href="qstyle.html">QStyle</a>&amp;old) <code>[virtualprotected]</code></h3>
<p>Reimplemented for internal reasons; the API is not affected.
<p>Reimplemented from <a href="qwidget.html#7a14f4">QWidget.</a>
<h3 class="fn">void<a name="f678e3"></a>QMainWindow::toolBarPositionChanged(<a href="qtoolbar.html">QToolBar</a>*toolbar) <code>[signal]</code></h3>
<p>This signal is emitted when the <em>toolbar</em> has changed its position.
This means it has been moved to another dock or inside the dock.
<p>See also  <a href="#a2d60b">getLocation</a>().
<h3 class="fn">bool<a name="308027"></a>QMainWindow::toolBarsMovable()const</h3>
<p>Returns whether or not the toolbars of this main window are movable.
<p>See also  <a href="#aa099c">setToolBarsMovable</a>().
<h3 class="fn"><a href="qtooltipgroup.html">QToolTipGroup</a>*<a name="4f5d02"></a>QMainWindow::toolTipGroup()const</h3>
<p>Returns the tool tip group for this window.  If there isn't any,
toolTipGroup() creates an empty tool tip group on the fly.
<p>See also  <a href="#2fcbc3">menuBar</a>() and <a href="#14153d">statusBar</a>().
<h3 class="fn">bool<a name="725ddd"></a>QMainWindow::usesBigPixmaps()const</h3>
<p>Returns the state last set by <a href="#44e8cb">setUsesBigPixmaps</a>().  The initial
state is FALSE.
<p>See also  <a href="#44e8cb">setUsesBigPixmaps</a>();.
<h3 class="fn">bool<a name="609172"></a>QMainWindow::usesTextLabel()const</h3>
<p>Returns the state last set by <a href="#0e35cf">setUsesTextLabel</a>().  The initial
state is FALSE.
<p>See also  <a href="#0e35cf">setUsesTextLabel</a>();.
<h3 class="fn">void<a name="ad6a70"></a>QMainWindow::usesTextLabelChanged(bool) <code>[signal]</code></h3>
<p>This signal is called whenever the <a href="#0e35cf">setUsesTextLabel</a>() is called
with a value which is different from the current setting.  All
relevant widgets must connect to this signal.
<h3 class="fn">void<a name="db02bc"></a>QMainWindow::whatsThis() <code>[slot]</code></h3>
<p>Enters What's This? question mode and returns immediately.
<p>This is the same as <a href="qwhatsthis.html#8d84ad">QWhatsThis::enterWhatsThisMode</a>(), but as a slot of of a
main window object. This way it can be easily used for popup menus
as in the code fragment:
<p><pre>    <a href="qpopupmenu.html">QPopupMenu</a> * help = new <a href="qpopupmenu.html">QPopupMenu</a>( this );
    help-&gt;<a href="qmenudata.html#43c652">insertItem</a>( "What's &amp;This", this , SLOT(whatsThis()), SHIFT+Key_F1);
</pre>
<p>See also  <a href="qwhatsthis.html#8d84ad">QWhatsThis::enterWhatsThisMode</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>