~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to doc/html/q3mainwindow.html

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="iso-8859-1"?>
 
2
<!DOCTYPE html
 
3
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
 
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 
5
<!-- /tmp/qt-4.0.0-espenr-1119621036935/qt-x11-opensource-desktop-4.0.0/src/qt3support/widgets/q3mainwindow.cpp -->
 
6
<head>
 
7
    <title>Qt 4.0: Q3MainWindow Class Reference</title>
 
8
    <style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
 
9
a:link { color: #004faf; text-decoration: none }
 
10
a:visited { color: #672967; text-decoration: none }
 
11
td.postheader { font-family: sans-serif }
 
12
tr.address { font-family: sans-serif }
 
13
body { background: #ffffff; color: black; }</style>
 
14
</head>
 
15
<body>
 
16
<table border="0" cellpadding="0" cellspacing="0" width="100%">
 
17
<tr>
 
18
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></td>
 
19
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="annotated.html"><font color="#004faf">Annotated</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
 
20
<td align="right" valign="top" width="230"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></td></tr></table><h1 align="center">Q3MainWindow Class Reference</h1>
 
21
<p>The Q3MainWindow class provides a main application window, with a menu bar, dock windows (e.g. for toolbars), and a status bar. <a href="#details">More...</a></p>
 
22
<pre>#include &lt;Q3MainWindow&gt;</pre><p><b>This class is part of the Qt 3 support library.</b> It is provided to keep old source code working. We strongly advise against using it in new code. See the <a href="porting4.html">Porting Guide</a> for more information.</p>
 
23
<p>Part of the <a href="qt3support.html">Qt3Support</a> module.</p>
 
24
<p>Inherits <a href="qwidget.html">QWidget</a>.</p>
 
25
<ul>
 
26
<li><a href="q3mainwindow-members.html">List of all members, including inherited members</a></li>
 
27
</ul>
 
28
<a name="public-types"></a>
 
29
<h3>Public Types</h3>
 
30
<ul>
 
31
<li><div class="fn"/>enum <b><a href="q3mainwindow.html#DockWindows-enum">DockWindows</a></b> { OnlyToolBars, NoToolBars, AllDockWindows }</li>
 
32
</ul>
 
33
<a name="properties"></a>
 
34
<h3>Properties</h3>
 
35
<table width="100%" border="0" cellpadding="0" cellspacing="0">
 
36
<tr><td width="45%" valign="top"><ul>
 
37
<li><div class="fn"/><b><a href="q3mainwindow.html#dockWindowsMovable-prop">dockWindowsMovable</a></b> : bool</li>
 
38
<li><div class="fn"/><b><a href="q3mainwindow.html#opaqueMoving-prop">opaqueMoving</a></b> : bool</li>
 
39
<li><div class="fn"/><b><a href="q3mainwindow.html#rightJustification-prop">rightJustification</a></b> : bool</li>
 
40
</ul></td><td valign="top"><ul>
 
41
<li><div class="fn"/><b><a href="q3mainwindow.html#usesBigPixmaps-prop">usesBigPixmaps</a></b> : bool</li>
 
42
<li><div class="fn"/><b><a href="q3mainwindow.html#usesTextLabel-prop">usesTextLabel</a></b> : bool</li>
 
43
</ul>
 
44
</td></tr>
 
45
</table>
 
46
<ul>
 
47
<li><div class="fn"/>52 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
 
48
<li><div class="fn"/>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
 
49
</ul>
 
50
<a name="public-functions"></a>
 
51
<h3>Public Functions</h3>
 
52
<ul>
 
53
<li><div class="fn"/><b><a href="q3mainwindow.html#Q3MainWindow">Q3MainWindow</a></b> ( QWidget * <i>parent</i> = 0, const char * <i>name</i> = 0, Qt::WFlags <i>f</i> = Qt::WType_TopLevel )</li>
 
54
<li><div class="fn"/><b><a href="q3mainwindow.html#dtor.Q3MainWindow">~Q3MainWindow</a></b> ()</li>
 
55
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#addDockWindow">addDockWindow</a></b> ( Q3DockWindow * <i>dockWindow</i>, Qt::Dock <i>edge</i> = Qt::DockTop, bool <i>newLine</i> = false )</li>
 
56
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#addDockWindow-2">addDockWindow</a></b> ( Q3DockWindow * <i>dockWindow</i>, const QString &amp; <i>label</i>, Qt::Dock <i>edge</i> = Qt::DockTop, bool <i>newLine</i> = false )</li>
 
57
<li><div class="fn"/>void <b><a href="q3mainwindow.html#addToolBar">addToolBar</a></b> ( Q3DockWindow * <i>dockWindow</i>, Qt::Dock <i>position</i> = Qt::DockTop, bool <i>newLine</i> = false )</li>
 
58
<li><div class="fn"/>void <b><a href="q3mainwindow.html#addToolBar-2">addToolBar</a></b> ( Q3DockWindow * <i>dockWindow</i>, const QString &amp; <i>label</i>, Qt::Dock <i>position</i> = Qt::DockTop, bool <i>newLine</i> = false )</li>
 
59
<li><div class="fn"/>bool <b><a href="q3mainwindow.html#appropriate">appropriate</a></b> ( Q3DockWindow * <i>dw</i> ) const</li>
 
60
<li><div class="fn"/>Q3DockArea * <b><a href="q3mainwindow.html#bottomDock">bottomDock</a></b> () const</li>
 
61
<li><div class="fn"/>QWidget * <b><a href="q3mainwindow.html#centralWidget">centralWidget</a></b> () const</li>
 
62
<li><div class="fn"/>virtual Q3PopupMenu * <b><a href="q3mainwindow.html#createDockWindowMenu">createDockWindowMenu</a></b> ( DockWindows <i>dockWindows</i> = AllDockWindows ) const</li>
 
63
<li><div class="fn"/>QList&lt;Q3DockWindow *&gt; <b><a href="q3mainwindow.html#dockWindows">dockWindows</a></b> ( Qt::Dock <i>dock</i> ) const</li>
 
64
<li><div class="fn"/>QList&lt;Q3DockWindow *&gt; <b><a href="q3mainwindow.html#dockWindows-2">dockWindows</a></b> () const</li>
 
65
<li><div class="fn"/>bool <b><a href="q3mainwindow.html#dockWindowsMovable-prop">dockWindowsMovable</a></b> () const</li>
 
66
<li><div class="fn"/>bool <b><a href="q3mainwindow.html#getLocation">getLocation</a></b> ( Q3DockWindow * <i>dw</i>, Qt::Dock &amp; <i>dock</i>, int &amp; <i>index</i>, bool &amp; <i>nl</i>, int &amp; <i>extraOffset</i> ) const</li>
 
67
<li><div class="fn"/>bool <b><a href="q3mainwindow.html#hasDockWindow">hasDockWindow</a></b> ( Q3DockWindow * <i>dw</i> )</li>
 
68
<li><div class="fn"/>virtual bool <b><a href="q3mainwindow.html#isCustomizable">isCustomizable</a></b> () const</li>
 
69
<li><div class="fn"/>bool <b><a href="q3mainwindow.html#isDockEnabled">isDockEnabled</a></b> ( Qt::Dock <i>dock</i> ) const</li>
 
70
<li><div class="fn"/>bool <b><a href="q3mainwindow.html#isDockEnabled-2">isDockEnabled</a></b> ( Q3DockArea * <i>area</i> ) const</li>
 
71
<li><div class="fn"/>bool <b><a href="q3mainwindow.html#isDockEnabled-3">isDockEnabled</a></b> ( Q3DockWindow * <i>dw</i>, Q3DockArea * <i>area</i> ) const</li>
 
72
<li><div class="fn"/>bool <b><a href="q3mainwindow.html#isDockEnabled-4">isDockEnabled</a></b> ( Q3DockWindow * <i>tb</i>, Qt::Dock <i>dock</i> ) const</li>
 
73
<li><div class="fn"/>bool <b><a href="q3mainwindow.html#isDockMenuEnabled">isDockMenuEnabled</a></b> () const</li>
 
74
<li><div class="fn"/>Q3DockArea * <b><a href="q3mainwindow.html#leftDock">leftDock</a></b> () const</li>
 
75
<li><div class="fn"/>void <b><a href="q3mainwindow.html#lineUpDockWindows">lineUpDockWindows</a></b> ( bool <i>keepNewLines</i> = false )</li>
 
76
<li><div class="fn"/>void <b><a href="q3mainwindow.html#lineUpToolBars">lineUpToolBars</a></b> ( bool <i>keepNewLines</i> = false )</li>
 
77
<li><div class="fn"/>QMenuBar * <b><a href="q3mainwindow.html#menuBar">menuBar</a></b> () const</li>
 
78
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#moveDockWindow">moveDockWindow</a></b> ( Q3DockWindow * <i>dockWindow</i>, Qt::Dock <i>edge</i> = Qt::DockTop )</li>
 
79
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#moveDockWindow-2">moveDockWindow</a></b> ( Q3DockWindow * <i>dockWindow</i>, Qt::Dock <i>edge</i>, bool <i>nl</i>, int <i>index</i>, int <i>extraOffset</i> = -1 )</li>
 
80
<li><div class="fn"/>void <b><a href="q3mainwindow.html#moveToolBar">moveToolBar</a></b> ( Q3DockWindow * <i>dockWindow</i>, Qt::Dock <i>position</i> = Qt::DockTop )</li>
 
81
<li><div class="fn"/>void <b><a href="q3mainwindow.html#moveToolBar-2">moveToolBar</a></b> ( Q3DockWindow * <i>dockWindow</i>, Qt::Dock <i>position</i>, bool <i>nl</i>, int <i>index</i>, int <i>extraOffset</i> = -1 )</li>
 
82
<li><div class="fn"/>bool <b><a href="q3mainwindow.html#opaqueMoving-prop">opaqueMoving</a></b> () const</li>
 
83
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#removeDockWindow">removeDockWindow</a></b> ( Q3DockWindow * <i>dockWindow</i> )</li>
 
84
<li><div class="fn"/>void <b><a href="q3mainwindow.html#removeToolBar">removeToolBar</a></b> ( Q3DockWindow * <i>dockWindow</i> )</li>
 
85
<li><div class="fn"/>Q3DockArea * <b><a href="q3mainwindow.html#rightDock">rightDock</a></b> () const</li>
 
86
<li><div class="fn"/>bool <b><a href="q3mainwindow.html#rightJustification-prop">rightJustification</a></b> () const</li>
 
87
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#setCentralWidget">setCentralWidget</a></b> ( QWidget * <i>w</i> )</li>
 
88
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#setDockEnabled">setDockEnabled</a></b> ( Qt::Dock <i>dock</i>, bool <i>enable</i> )</li>
 
89
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#setDockEnabled-2">setDockEnabled</a></b> ( Q3DockWindow * <i>dw</i>, Qt::Dock <i>dock</i>, bool <i>enable</i> )</li>
 
90
<li><div class="fn"/>QStatusBar * <b><a href="q3mainwindow.html#statusBar">statusBar</a></b> () const</li>
 
91
<li><div class="fn"/>QList&lt;Q3ToolBar *&gt; <b><a href="q3mainwindow.html#toolBars">toolBars</a></b> ( Qt::Dock <i>dock</i> ) const</li>
 
92
<li><div class="fn"/>bool <b><a href="q3mainwindow.html#toolBarsMovable">toolBarsMovable</a></b> () const</li>
 
93
<li><div class="fn"/>Q3DockArea * <b><a href="q3mainwindow.html#topDock">topDock</a></b> () const</li>
 
94
<li><div class="fn"/>bool <b><a href="q3mainwindow.html#usesBigPixmaps-prop">usesBigPixmaps</a></b> () const</li>
 
95
<li><div class="fn"/>bool <b><a href="q3mainwindow.html#usesTextLabel-prop">usesTextLabel</a></b> () const</li>
 
96
</ul>
 
97
<ul>
 
98
<li><div class="fn"/>183 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
 
99
<li><div class="fn"/>28 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
 
100
<li><div class="fn"/>10 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
 
101
</ul>
 
102
<a name="public-slots"></a>
 
103
<h3>Public Slots</h3>
 
104
<ul>
 
105
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#customize">customize</a></b> ()</li>
 
106
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#setAppropriate">setAppropriate</a></b> ( Q3DockWindow * <i>dw</i>, bool <i>a</i> )</li>
 
107
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#setDockMenuEnabled">setDockMenuEnabled</a></b> ( bool <i>b</i> )</li>
 
108
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#dockWindowsMovable-prop">setDockWindowsMovable</a></b> ( bool )</li>
 
109
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#opaqueMoving-prop">setOpaqueMoving</a></b> ( bool )</li>
 
110
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#rightJustification-prop">setRightJustification</a></b> ( bool )</li>
 
111
<li><div class="fn"/>void <b><a href="q3mainwindow.html#setToolBarsMovable">setToolBarsMovable</a></b> ( bool <i>b</i> )</li>
 
112
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#usesBigPixmaps-prop">setUsesBigPixmaps</a></b> ( bool )</li>
 
113
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#usesTextLabel-prop">setUsesTextLabel</a></b> ( bool )</li>
 
114
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#whatsThis">whatsThis</a></b> ()</li>
 
115
</ul>
 
116
<ul>
 
117
<li><div class="fn"/>17 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
 
118
<li><div class="fn"/>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
 
119
</ul>
 
120
<a name="signals"></a>
 
121
<h3>Signals</h3>
 
122
<ul>
 
123
<li><div class="fn"/>void <b><a href="q3mainwindow.html#dockWindowPositionChanged">dockWindowPositionChanged</a></b> ( Q3DockWindow * <i>dockWindow</i> )</li>
 
124
<li><div class="fn"/>void <b><a href="q3mainwindow.html#pixmapSizeChanged">pixmapSizeChanged</a></b> ( bool <i>b</i> )</li>
 
125
<li><div class="fn"/>void <b><a href="q3mainwindow.html#toolBarPositionChanged">toolBarPositionChanged</a></b> ( Q3ToolBar * <i>toolbar</i> )</li>
 
126
<li><div class="fn"/>void <b><a href="q3mainwindow.html#usesTextLabelChanged">usesTextLabelChanged</a></b> ( bool <i>b</i> )</li>
 
127
</ul>
 
128
<ul>
 
129
<li><div class="fn"/>1 signal inherited from <a href="qwidget.html#signals">QWidget</a></li>
 
130
<li><div class="fn"/>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
 
131
</ul>
 
132
<a name="protected-functions"></a>
 
133
<h3>Protected Functions</h3>
 
134
<ul>
 
135
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#childEvent">childEvent</a></b> ( QChildEvent * <i>e</i> )</li>
 
136
</ul>
 
137
<ul>
 
138
<li><div class="fn"/>39 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
 
139
<li><div class="fn"/>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
 
140
</ul>
 
141
<a name="protected-slots"></a>
 
142
<h3>Protected Slots</h3>
 
143
<ul>
 
144
<li><div class="fn"/>virtual void <b><a href="q3mainwindow.html#setUpLayout">setUpLayout</a></b> ()</li>
 
145
<li><div class="fn"/>virtual bool <b><a href="q3mainwindow.html#showDockMenu">showDockMenu</a></b> ( const QPoint &amp; <i>globalPos</i> )</li>
 
146
</ul>
 
147
<a name="related-non-members"></a>
 
148
<h3>Related Non-Members</h3>
 
149
<ul>
 
150
<li><div class="fn"/>QTextStream &amp; <b><a href="q3mainwindow.html#operator-lt-lt-89">operator&lt;&lt;</a></b> ( QTextStream &amp; <i>ts</i>, const Q3MainWindow &amp; <i>mainWindow</i> )</li>
 
151
<li><div class="fn"/>QTextStream &amp; <b><a href="q3mainwindow.html#operator-gt-gt-62">operator&gt;&gt;</a></b> ( QTextStream &amp; <i>ts</i>, Q3MainWindow &amp; <i>mainWindow</i> )</li>
 
152
</ul>
 
153
<h3>Additional Inherited Members</h3>
 
154
<ul>
 
155
<li><div class="fn"/>4 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
 
156
<li><div class="fn"/>4 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
 
157
</ul>
 
158
<a name="details"></a>
 
159
<hr />
 
160
<h2>Detailed Description</h2>
 
161
<p>The Q3MainWindow class provides a main application window, with a menu bar, dock windows (e.g. for toolbars), and a status bar.</p>
 
162
<p>Main windows are most often used to provide menus, toolbars and a status bar around a large central widget, such as a text edit, drawing canvas or <a href="qworkspace.html">QWorkspace</a> (for MDI applications). Q3MainWindow is usually subclassed since this makes it easier to encapsulate the central widget, menus and toolbars as well as the window's state. Subclassing makes it possible to create the slots that are called when the user clicks menu items or toolbar buttons.</p>
 
163
<p>We'll briefly review adding menu items and toolbar buttons then describe the facilities of Q3MainWindow itself.</p>
 
164
<pre>&nbsp;   Q3MainWindow *mw = new Q3MainWindow;
 
165
    QTextEdit *edit = new QTextEdit(mw, &quot;editor&quot;);
 
166
    edit-&gt;setFocus();
 
167
    mw-&gt;setWindowTitle(&quot;Main Window&quot;);
 
168
    mw-&gt;setCentralWidget(edit);
 
169
    mw-&gt;show();</pre>
 
170
<p>Q3MainWindows may be created in their own right as shown above. The central widget is set with <a href="q3mainwindow.html#setCentralWidget">setCentralWidget</a>(). Popup menus can be added to the default menu bar, widgets can be added to the status bar, toolbars and dock windows can be added to any of the dock areas.</p>
 
171
<p>The main window will take care of the dock areas, and the geometry of the central widget, but all other aspects of the central widget are left to you. Q3MainWindow automatically detects the creation of a menu bar or status bar if you specify the Q3MainWindow as parent, or you can use the provided <a href="q3mainwindow.html#menuBar">menuBar</a>() and <a href="q3mainwindow.html#statusBar">statusBar</a>() functions. The functions <a href="q3mainwindow.html#menuBar">menuBar</a>() and <a href="q3mainwindow.html#statusBar">statusBar</a>() create a suitable widget if one doesn't exist, and update the window's layout to make space.</p>
 
172
<p>New dock windows and toolbars can be added to a Q3MainWindow using <a href="q3mainwindow.html#addDockWindow">addDockWindow</a>(). <a href="qt.html#Dock-enum">Qt::Dock</a> windows can be moved using <a href="q3mainwindow.html#moveDockWindow">moveDockWindow</a>() and removed with <a href="q3mainwindow.html#removeDockWindow">removeDockWindow</a>(). Q3MainWindow allows default dock window (toolbar) docking in all its dock areas (<tt>Top</tt>, <tt>Left</tt>, <tt>Right</tt>, <tt>Bottom</tt>). You can use <a href="q3mainwindow.html#setDockEnabled">setDockEnabled</a>() to enable and disable docking areas for dock windows. When adding or moving dock windows you can specify their 'edge' (dock area). The currently available edges are: <tt>Top</tt>, <tt>Left</tt>, <tt>Right</tt>, <tt>Bottom</tt>, <tt>Minimized</tt> (effectively a 'hidden' dock area) and <tt>TornOff</tt> (floating). See <a href="qt.html#Dock-enum">Qt::Dock</a> for an explanation of these areas. Note that the *ToolBar functions are included for backward compatibility; all new code should use the *DockWindow functions. <a href="porting4.html#qtoolbar">QToolbar</a> is a subclass of <a href="q3dockwindow.html">Q3DockWindow</a> so all functions that work with dock windows work on toolbars in the same way.</p>
 
173
<a name="dwm"></a><p>If the user clicks the close button, then the dock window is hidden. A dock window can be hidden or unhidden by the user by right clicking a dock area and clicking the name of the relevant dock window on the pop up dock window menu. This menu lists the names of every dock window; visible dock windows have a tick beside their names. The dock window menu is created automatically as required by <a href="q3mainwindow.html#createDockWindowMenu">createDockWindowMenu</a>(). Since it may not always be appropriate for a dock window to appear on this menu the <a href="q3mainwindow.html#setAppropriate">setAppropriate</a>() function is used to inform the main window whether or not the dock window menu should include a particular dock window. Double clicking a dock window handle (usually on the left-hand side of the dock window) undocks (floats) the dock window. Double clicking a floating dock window's title bar will dock the floating dock window. (See also <a href="q3mainwindow.html#DockWindows-enum">Q3MainWindow::DockWindows</a>.)</p>
 
174
<p>Some functions change the appearance of a Q3MainWindow globally:</p>
 
175
<ul>
 
176
<li><a href="q3dockwindow.html#setHorizontalStretchable">Q3DockWindow::setHorizontalStretchable</a>() and <a href="q3dockwindow.html#setVerticalStretchable">Q3DockWindow::setVerticalStretchable</a>() are used to make specific dock windows or toolbars stretchable.</li>
 
177
<li><a href="q3mainwindow.html#usesBigPixmaps-prop">setUsesBigPixmaps</a>() is used to set whether tool buttons should draw small or large pixmaps (see <a href="qicon.html">QIcon</a> for more information).</li>
 
178
<li><a href="q3mainwindow.html#usesTextLabel-prop">setUsesTextLabel</a>() is used to set whether tool buttons should display a textual label in addition to pixmaps (see <a href="qtoolbutton.html">QToolButton</a> for more information).</li>
 
179
</ul>
 
180
<p>The user can drag dock windows into any enabled docking area. <a href="qt.html#Dock-enum">Qt::Dock</a> windows can also be dragged <i>within</i> a docking area, for example to rearrange the order of some toolbars. <a href="qt.html#Dock-enum">Qt::Dock</a> windows can also be dragged outside any docking area (undocked or 'floated'). Being able to drag dock windows can be enabled (the default) and disabled using <a href="q3mainwindow.html#dockWindowsMovable-prop">setDockWindowsMovable</a>().</p>
 
181
<p>The <tt>Minimized</tt> edge is a hidden dock area. If this dock area is enabled the user can hide (minimize) a dock window or show (restore) a minimized dock window by clicking the dock window handle. If the user hovers the mouse cursor over one of the handles, the caption of the dock window is displayed in a tool tip (see <a href="q3dockwindow.html#windowTitle">Q3DockWindow::windowTitle</a>() or <a href="q3toolbar.html#label-prop">Q3ToolBar::label</a>()), so if you enable the <tt>Minimized</tt> dock area, it is best to specify a meaningful caption or label for each dock window. To minimize a dock window programmatically use <a href="q3mainwindow.html#moveDockWindow">moveDockWindow</a>() with an edge of <tt>Minimized</tt>.</p>
 
182
<p><a href="qt.html#Dock-enum">Qt::Dock</a> windows are moved transparently by default, i.e. during the drag an outline rectangle is drawn on the screen representing the position of the dock window as it moves. If you want the dock window to be shown normally whilst it is moved use <a href="q3mainwindow.html#opaqueMoving-prop">setOpaqueMoving</a>().</p>
 
183
<p>The location of a dock window, i.e. its dock area and position within the dock area, can be determined by calling <a href="q3mainwindow.html#getLocation">getLocation</a>(). Movable dock windows can be lined up to minimize wasted space with <a href="q3mainwindow.html#lineUpDockWindows">lineUpDockWindows</a>(). Pointers to the dock areas are available from <a href="q3mainwindow.html#topDock">topDock</a>(), <a href="q3mainwindow.html#leftDock">leftDock</a>(), <a href="q3mainwindow.html#rightDock">rightDock</a>() and <a href="q3mainwindow.html#bottomDock">bottomDock</a>(). A customize menu item is added to the pop up dock window menu if <a href="q3mainwindow.html#isCustomizable">isCustomizable</a>() returns true; it returns false by default. Reimplement <a href="q3mainwindow.html#isCustomizable">isCustomizable</a>() and <a href="q3mainwindow.html#customize">customize</a>() if you want to offer this extra menu item, for example, to allow the user to change settings relating to the main window and its toolbars and dock windows.</p>
 
184
<p>The main window's menu bar is fixed (at the top) by default. If you want a movable menu bar, create a <a href="qmenubar.html">QMenuBar</a> as a stretchable widget inside its own movable dock window and restrict this dock window to only live within the <tt>Top</tt> or <tt>Bottom</tt> dock:</p>
 
185
<pre>&nbsp;   Q3ToolBar *tb = new Q3ToolBar(this);
 
186
    addDockWindow(tb, tr(&quot;Menubar&quot;), Top, false);
 
187
    QMenuBar *mb = new QMenuBar(tb);
 
188
    mb-&gt;setFrameStyle(QFrame::NoFrame);
 
189
    tb-&gt;setStretchableWidget(mb);
 
190
    setDockEnabled(tb, Left, false);
 
191
    setDockEnabled(tb, Right, false);</pre>
 
192
<p>An application with multiple dock windows can choose to save the current dock window layout in order to restore it later, e.g. in the next session. You can do this by using the streaming operators for Q3MainWindow.</p>
 
193
<p>To save the layout and positions of all the dock windows do this:</p>
 
194
<pre>&nbsp;   QFile file(filename);
 
195
    if (file.open(IO_WriteOnly)) {
 
196
        QTextStream stream(&amp;file);
 
197
        stream &lt;&lt; *mainWindow;
 
198
        file.close();
 
199
    }</pre>
 
200
<p>To restore the dock window positions and sizes (normally when the application is next started), do the following:</p>
 
201
<pre>&nbsp;   QFile file(filename);
 
202
    if (file.open(IO_ReadOnly)) {
 
203
        QTextStream stream(&amp;file);
 
204
        stream &gt;&gt; *mainWindow;
 
205
        file.close();
 
206
    }</pre>
 
207
<p>The <a href="qsettings.html">QSettings</a> class can be used in conjunction with the streaming operators to store the application's settings.</p>
 
208
<p>Q3MainWindow's management of dock windows and toolbars is done transparently behind-the-scenes by <a href="q3dockarea.html">Q3DockArea</a>.</p>
 
209
<p>For multi-document interfaces (MDI), use a <a href="qworkspace.html">QWorkspace</a> as the central widget.</p>
 
210
<p>Adding dock windows, e.g. toolbars, to Q3MainWindow's dock areas is straightforward. If the supplied dock areas are not sufficient for your application we suggest that you create a <a href="qwidget.html">QWidget</a> subclass and add your own dock areas (see <a href="q3dockarea.html">Q3DockArea</a>) to the subclass since Q3MainWindow provides functionality specific to the standard dock areas it provides.</p>
 
211
<p>See also <a href="q3toolbar.html">Q3ToolBar</a>, <a href="q3dockwindow.html">Q3DockWindow</a>, <a href="qstatusbar.html">QStatusBar</a>, <a href="qaction.html">QAction</a>, <a href="qmenubar.html">QMenuBar</a>, <a href="q3popupmenu.html">Q3PopupMenu</a>, and <a href="qdialog.html">QDialog</a>.</p>
 
212
<hr />
 
213
<h2>Member Type Documentation</h2>
 
214
<h3 class="fn"><a name="DockWindows-enum"></a>enum Q3MainWindow::DockWindows</h3>
 
215
<p>Right-clicking a dock area will pop-up the dock window menu (<a href="q3mainwindow.html#createDockWindowMenu">createDockWindowMenu</a>() is called automatically). When called in code you can specify what items should appear on the menu with this enum.</p>
 
216
<table border="1" cellpadding="2" cellspacing="1" width="100%">
 
217
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
 
218
<tr><td valign="top"><tt>Q3MainWindow::OnlyToolBars</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">The menu will list all the toolbars, but not any other dock windows.</td></tr>
 
219
<tr><td valign="top"><tt>Q3MainWindow::NoToolBars</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">The menu will list dock windows but not toolbars.</td></tr>
 
220
<tr><td valign="top"><tt>Q3MainWindow::AllDockWindows</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">The menu will list all toolbars and other dock windows. (This is the default.)</td></tr>
 
221
</table>
 
222
<hr />
 
223
<h2>Property Documentation</h2>
 
224
<h3 class="fn"><a name="dockWindowsMovable-prop"></a>dockWindowsMovable : bool</h3>
 
225
<p>This property holds whether the dock windows are movable.</p>
 
226
<p>If true (the default), the user will be able to move movable dock windows from one <a href="q3mainwindow.html">Q3MainWindow</a> dock area to another, including the <tt>TearOff</tt> area (i.e. where the dock window floats freely as a window in its own right), and the <tt>Minimized</tt> area (where only the dock window's handle is shown below the menu bar). Movable dock windows can also be moved within <a href="q3mainwindow.html">Q3MainWindow</a> dock areas, i.e. to rearrange them within a dock area.</p>
 
227
<p>If false the user will not be able to move any dock windows.</p>
 
228
<p>By default dock windows are moved transparently (i.e. only an outline rectangle is shown during the drag), but this setting can be changed with <a href="q3mainwindow.html#opaqueMoving-prop">setOpaqueMoving</a>().</p>
 
229
<p>Access functions:</p>
 
230
<ul>
 
231
<li><div class="fn"/><b>bool dockWindowsMovable () const</b></li>
 
232
<li><div class="fn"/><b>virtual void setDockWindowsMovable ( bool )</b></li>
 
233
</ul>
 
234
<p>See also <a href="q3mainwindow.html#setDockEnabled">setDockEnabled</a>() and <a href="q3mainwindow.html#opaqueMoving-prop">setOpaqueMoving</a>().</p>
 
235
<h3 class="fn"><a name="opaqueMoving-prop"></a>opaqueMoving : bool</h3>
 
236
<p>This property holds whether dock windows are moved opaquely.</p>
 
237
<p>If true the dock windows of the main window are shown opaquely (i.e. it shows the toolbar as it looks when docked) whilst it is being moved. If false (the default) they are shown transparently, (i.e. as an outline rectangle).</p>
 
238
<p><b>Warning:</b> Opaque moving of toolbars and dockwindows is known to have several problems. We recommend avoiding the use of this feature for the time being. We intend fixing the problems in a future release.</p>
 
239
<p>Access functions:</p>
 
240
<ul>
 
241
<li><div class="fn"/><b>bool opaqueMoving () const</b></li>
 
242
<li><div class="fn"/><b>virtual void setOpaqueMoving ( bool )</b></li>
 
243
</ul>
 
244
<h3 class="fn"><a name="rightJustification-prop"></a>rightJustification : bool</h3>
 
245
<p>This property holds whether the main window right-justifies its dock windows.</p>
 
246
<p>If disabled (the default), stretchable dock windows are expanded, and non-stretchable dock windows are given the minimum space they need. Since most dock windows are not stretchable, this usually results in an unjustified right edge (or unjustified bottom edge for a vertical dock area). If enabled, the main window will right-justify its dock windows.</p>
 
247
<p>Access functions:</p>
 
248
<ul>
 
249
<li><div class="fn"/><b>bool rightJustification () const</b></li>
 
250
<li><div class="fn"/><b>virtual void setRightJustification ( bool )</b></li>
 
251
</ul>
 
252
<p>See also <a href="q3dockwindow.html#setVerticalStretchable">Q3DockWindow::setVerticalStretchable</a>() and <a href="q3dockwindow.html#setHorizontalStretchable">Q3DockWindow::setHorizontalStretchable</a>().</p>
 
253
<h3 class="fn"><a name="usesBigPixmaps-prop"></a>usesBigPixmaps : bool</h3>
 
254
<p>This property holds whether big pixmaps are enabled.</p>
 
255
<p>If false (the default), the tool buttons will use small pixmaps; otherwise big pixmaps will be used.</p>
 
256
<p>Tool buttons and other widgets that wish to respond to this setting are responsible for reading the correct state on startup, and for connecting to the main window's widget's <a href="q3mainwindow.html#pixmapSizeChanged">pixmapSizeChanged</a>() signal.</p>
 
257
<p>Access functions:</p>
 
258
<ul>
 
259
<li><div class="fn"/><b>bool usesBigPixmaps () const</b></li>
 
260
<li><div class="fn"/><b>virtual void setUsesBigPixmaps ( bool )</b></li>
 
261
</ul>
 
262
<h3 class="fn"><a name="usesTextLabel-prop"></a>usesTextLabel : bool</h3>
 
263
<p>This property holds whether text labels for toolbar buttons are enabled.</p>
 
264
<p>If disabled (the default), the tool buttons will not use text labels. If enabled, text labels will be used.</p>
 
265
<p>Tool buttons and other widgets that wish to respond to this setting are responsible for reading the correct state on startup, and for connecting to the main window's widget's <a href="q3mainwindow.html#usesTextLabelChanged">usesTextLabelChanged</a>() signal.</p>
 
266
<p>Access functions:</p>
 
267
<ul>
 
268
<li><div class="fn"/><b>bool usesTextLabel () const</b></li>
 
269
<li><div class="fn"/><b>virtual void setUsesTextLabel ( bool )</b></li>
 
270
</ul>
 
271
<p>See also <a href="qtoolbutton-qt3.html#setUsesTextLabel">QToolButton::setUsesTextLabel</a>().</p>
 
272
<hr />
 
273
<h2>Member Function Documentation</h2>
 
274
<h3 class="fn"><a name="Q3MainWindow"></a>Q3MainWindow::Q3MainWindow ( <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0, const char * <i>name</i> = 0, <a href="qt.html#WFlags-typedef">Qt::WFlags</a> <i>f</i> = Qt::WType_TopLevel )</h3>
 
275
<p>Constructs an empty main window. The <i>parent</i>, <i>name</i> and widget flags <i>f</i>, are passed on to the <a href="qwidget.html">QWidget</a> constructor.</p>
 
276
<p>By default, the widget flags are set to <tt>Qt::WType_TopLevel</tt> rather than 0 as they are with <a href="qwidget.html">QWidget</a>. If you don't want your <a href="q3mainwindow.html">Q3MainWindow</a> to be a top level widget then you will need to set <i>f</i> to 0.</p>
 
277
<h3 class="fn"><a name="dtor.Q3MainWindow"></a>Q3MainWindow::~Q3MainWindow ()</h3>
 
278
<p>Destroys the object and frees any allocated resources.</p>
 
279
<h3 class="fn"><a name="addDockWindow"></a>void Q3MainWindow::addDockWindow ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>dockWindow</i>, <a href="qt.html#Dock-enum">Qt::Dock</a> <i>edge</i> = Qt::DockTop, bool <i>newLine</i> = false )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
280
<p>Adds <i>dockWindow</i> to the <i>edge</i> dock area.</p>
 
281
<p>If <i>newLine</i> is false (the default) then the <i>dockWindow</i> is added at the end of the <i>edge</i>. For vertical edges the end is at the bottom, for horizontal edges (including <tt>Minimized</tt>) the end is at the right. If <i>newLine</i> is true a new line of dock windows is started with <i>dockWindow</i> as the first (left-most and top-most) dock window.</p>
 
282
<p>If <i>dockWindow</i> is managed by another main window, it is first removed from that window.</p>
 
283
<h3 class="fn"><a name="addDockWindow-2"></a>void Q3MainWindow::addDockWindow ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>dockWindow</i>, const <a href="qstring.html">QString</a> &amp; <i>label</i>, <a href="qt.html#Dock-enum">Qt::Dock</a> <i>edge</i> = Qt::DockTop, bool <i>newLine</i> = false )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
284
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
285
<p>Adds <i>dockWindow</i> to the dock area with label <i>label</i>.</p>
 
286
<p>If <i>newLine</i> is false (the default) the <i>dockWindow</i> is added at the end of the <i>edge</i>. For vertical edges the end is at the bottom, for horizontal edges (including <tt>Minimized</tt>) the end is at the right. If <i>newLine</i> is true a new line of dock windows is started with <i>dockWindow</i> as the first (left-most and top-most) dock window.</p>
 
287
<p>If <i>dockWindow</i> is managed by another main window, it is first removed from that window.</p>
 
288
<h3 class="fn"><a name="addToolBar"></a>void Q3MainWindow::addToolBar ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>dockWindow</i>, <a href="qt.html#Dock-enum">Qt::Dock</a> <i>position</i> = Qt::DockTop, bool <i>newLine</i> = false )</h3>
 
289
<p>Adds a new toolbar to the <i>dockWindow</i>. The toolbar is placed in the given <i>position</i>. If <i>newLine</i> is true the toolbar is put on a new line.</p>
 
290
<h3 class="fn"><a name="addToolBar-2"></a>void Q3MainWindow::addToolBar ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>dockWindow</i>, const <a href="qstring.html">QString</a> &amp; <i>label</i>, <a href="qt.html#Dock-enum">Qt::Dock</a> <i>position</i> = Qt::DockTop, bool <i>newLine</i> = false )</h3>
 
291
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
292
<p>The toolbar has the caption <i>label</i> and is placed in the given <i>position</i>.</p>
 
293
<h3 class="fn"><a name="appropriate"></a>bool Q3MainWindow::appropriate ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>dw</i> ) const</h3>
 
294
<p>Returns true if it is appropriate to include a menu item for the <i>dw</i> dock window in the dock window menu; otherwise returns false.</p>
 
295
<p>The user is able to change the state (show or hide) a dock window that has a menu item by clicking the item.</p>
 
296
<p>Call <a href="q3mainwindow.html#setAppropriate">setAppropriate</a>() to indicate whether or not a particular dock window should appear on the popup menu.</p>
 
297
<p>See also <a href="q3mainwindow.html#setAppropriate">setAppropriate</a>().</p>
 
298
<h3 class="fn"><a name="bottomDock"></a><a href="q3dockarea.html">Q3DockArea</a> * Q3MainWindow::bottomDock () const</h3>
 
299
<p>Returns a pointer the <tt>Bottom</tt> dock area</p>
 
300
<p>See also <a href="q3mainwindow.html#topDock">topDock</a>(), <a href="q3mainwindow.html#leftDock">leftDock</a>(), and <a href="q3mainwindow.html#rightDock">rightDock</a>().</p>
 
301
<h3 class="fn"><a name="centralWidget"></a><a href="qwidget.html">QWidget</a> * Q3MainWindow::centralWidget () const</h3>
 
302
<p>Returns a pointer to the main window's central widget.</p>
 
303
<p>The central widget is surrounded by the left, top, right and bottom dock areas. The menu bar is above the top dock area.</p>
 
304
<p>See also <a href="q3mainwindow.html#setCentralWidget">setCentralWidget</a>().</p>
 
305
<h3 class="fn"><a name="childEvent"></a>void Q3MainWindow::childEvent ( <a href="qchildevent.html">QChildEvent</a> * <i>e</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
 
306
<p>Monitors events, received in <i>e</i>, to ensure the layout is updated.</p>
 
307
<p>Reimplemented from <a href="qobject.html#childEvent">QObject</a>.</p>
 
308
<h3 class="fn"><a name="createDockWindowMenu"></a><a href="q3popupmenu.html">Q3PopupMenu</a> * Q3MainWindow::createDockWindowMenu ( <a href="q3mainwindow.html#DockWindows-enum">DockWindows</a> <i>dockWindows</i> = AllDockWindows ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
309
<p>Creates the dock window menu which contains all toolbars (if <i>dockWindows</i> is <tt>OnlyToolBars</tt>), all dock windows (if <i>dockWindows</i> is <tt>NoToolBars</tt>) or all toolbars and dock windows (if <i>dockWindows</i> is <tt>AllDockWindows</tt> - the default).</p>
 
310
<p>This function is called internally when necessary, e.g. when the user right clicks a dock area (providing <a href="q3mainwindow.html#isDockMenuEnabled">isDockMenuEnabled</a>() returns true). You can reimplement this function if you wish to customize the behavior.</p>
 
311
<p>The menu items representing the toolbars and dock windows are checkable. The visible dock windows are checked and the hidden dock windows are unchecked. The user can click a menu item to change its state (show or hide the dock window).</p>
 
312
<p>The list and the state are always kept up-to-date.</p>
 
313
<p>Toolbars and dock windows which are not appropriate in the current context (see <a href="q3mainwindow.html#setAppropriate">setAppropriate</a>()) are not listed in the menu.</p>
 
314
<p>The menu also has a menu item for lining up the dock windows.</p>
 
315
<p>If <a href="q3mainwindow.html#isCustomizable">isCustomizable</a>() returns true, a Customize menu item is added to the menu, which if clicked will call <a href="q3mainwindow.html#customize">customize</a>(). The <a href="q3mainwindow.html#isCustomizable">isCustomizable</a>() function we provide returns false and <a href="q3mainwindow.html#customize">customize</a>() does nothing, so they must be reimplemented in a subclass to be useful.</p>
 
316
<h3 class="fn"><a name="customize"></a>void Q3MainWindow::customize ()&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
317
<p>This function is called when the user clicks the Customize menu item on the dock window menu.</p>
 
318
<p>The customize menu item will only appear if <a href="q3mainwindow.html#isCustomizable">isCustomizable</a>() returns true (it returns false by default).</p>
 
319
<p>The function is intended, for example, to provide the user with a means of telling the application that they wish to customize the main window, dock windows or dock areas.</p>
 
320
<p>The default implementation does nothing and the Customize menu item is not shown on the right-click menu by default. If you want the item to appear then reimplement <a href="q3mainwindow.html#isCustomizable">isCustomizable</a>() to return true, and reimplement this function to do whatever you want.</p>
 
321
<p>See also <a href="q3mainwindow.html#isCustomizable">isCustomizable</a>().</p>
 
322
<h3 class="fn"><a name="dockWindowPositionChanged"></a>void Q3MainWindow::dockWindowPositionChanged ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>dockWindow</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
323
<p>This signal is emitted when the <i>dockWindow</i> has changed its position. A change in position occurs when a dock window is moved within its dock area or moved to another dock area (including the <tt>Minimized</tt> and <tt>TearOff</tt> dock areas).</p>
 
324
<p>See also <a href="q3mainwindow.html#getLocation">getLocation</a>().</p>
 
325
<h3 class="fn"><a name="dockWindows"></a><a href="qlist.html">QList</a>&lt;<a href="q3dockwindow.html">Q3DockWindow</a> *&gt; Q3MainWindow::dockWindows ( <a href="qt.html#Dock-enum">Qt::Dock</a> <i>dock</i> ) const</h3>
 
326
<p>Returns a list of all the dock windows which are in the <i>dock</i> dock area, regardless of their state.</p>
 
327
<p>For example, the <tt>Qt::DockTornOff</tt> dock area may contain closed dock windows but these are returned along with the visible dock windows.</p>
 
328
<h3 class="fn"><a name="dockWindows-2"></a><a href="qlist.html">QList</a>&lt;<a href="q3dockwindow.html">Q3DockWindow</a> *&gt; Q3MainWindow::dockWindows () const</h3>
 
329
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
330
<p>Returns the list of dock windows which belong to this main window, regardless of which dock area they are in or what their state is, (e.g. irrespective of whether they are visible or not).</p>
 
331
<h3 class="fn"><a name="getLocation"></a>bool Q3MainWindow::getLocation ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>dw</i>, <a href="qt.html#Dock-enum">Qt::Dock</a> &amp; <i>dock</i>, int &amp; <i>index</i>, bool &amp; <i>nl</i>, int &amp; <i>extraOffset</i> ) const</h3>
 
332
<p>Finds the location of the dock window <i>dw</i>.</p>
 
333
<p>If the <i>dw</i> dock window is found in the main window the function returns true and populates the <i>dock</i> variable with the dw's dock area and the <i>index</i> with the dw's position within the dock area. It also sets <i>nl</i> to true if the <i>dw</i> begins a new line (otherwise false), and <i>extraOffset</i> with the dock window's offset.</p>
 
334
<p>If the <i>dw</i> dock window is not found then the function returns false and the state of <i>dock</i>, <i>index</i>, <i>nl</i> and <i>extraOffset</i> is undefined.</p>
 
335
<p>If you want to save and restore dock window positions then use operator&gt;&gt;() and operator&lt;&lt;().</p>
 
336
<h3 class="fn"><a name="hasDockWindow"></a>bool Q3MainWindow::hasDockWindow ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>dw</i> )</h3>
 
337
<p>Returns true if <i>dw</i> is a dock window known to the main window; otherwise returns false.</p>
 
338
<h3 class="fn"><a name="isCustomizable"></a>bool Q3MainWindow::isCustomizable () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
339
<p>Returns true if the dock area dock window menu includes the Customize menu item (which calls <a href="q3mainwindow.html#customize">customize</a>() when clicked). Returns false by default, i.e. the popup menu will not contain a Customize menu item. You will need to reimplement this function and set it to return true if you wish the user to be able to see the dock window menu.</p>
 
340
<p>See also <a href="q3mainwindow.html#customize">customize</a>().</p>
 
341
<h3 class="fn"><a name="isDockEnabled"></a>bool Q3MainWindow::isDockEnabled ( <a href="qt.html#Dock-enum">Qt::Dock</a> <i>dock</i> ) const</h3>
 
342
<p>Returns true if the <i>dock</i> dock area is enabled, i.e. it can accept user dragged dock windows; otherwise returns false.</p>
 
343
<p>See also <a href="q3mainwindow.html#setDockEnabled">setDockEnabled</a>().</p>
 
344
<h3 class="fn"><a name="isDockEnabled-2"></a>bool Q3MainWindow::isDockEnabled ( <a href="q3dockarea.html">Q3DockArea</a> * <i>area</i> ) const</h3>
 
345
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
346
<p>Returns true if dock area <i>area</i> is enabled, i.e. it can accept user dragged dock windows; otherwise returns false.</p>
 
347
<p>See also <a href="q3mainwindow.html#setDockEnabled">setDockEnabled</a>().</p>
 
348
<h3 class="fn"><a name="isDockEnabled-3"></a>bool Q3MainWindow::isDockEnabled ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>dw</i>, <a href="q3dockarea.html">Q3DockArea</a> * <i>area</i> ) const</h3>
 
349
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
350
<p>Returns true if dock area <i>area</i> is enabled for the dock window <i>dw</i>; otherwise returns false.</p>
 
351
<p>See also <a href="q3mainwindow.html#setDockEnabled">setDockEnabled</a>().</p>
 
352
<h3 class="fn"><a name="isDockEnabled-4"></a>bool Q3MainWindow::isDockEnabled ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>tb</i>, <a href="qt.html#Dock-enum">Qt::Dock</a> <i>dock</i> ) const</h3>
 
353
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
354
<p>Returns true if dock area <i>dock</i> is enabled for the dock window <i>tb</i>; otherwise returns false.</p>
 
355
<p>See also <a href="q3mainwindow.html#setDockEnabled">setDockEnabled</a>().</p>
 
356
<h3 class="fn"><a name="isDockMenuEnabled"></a>bool Q3MainWindow::isDockMenuEnabled () const</h3>
 
357
<p>Returns true, if the dock window menu is enabled; otherwise returns false.</p>
 
358
<p>The menu lists the (<a href="q3mainwindow.html#appropriate">appropriate</a>()) dock windows (which may be shown or hidden), and has a &quot;Line Up Dock Windows&quot; menu item. It will also have a &quot;Customize&quot; menu item if <a href="q3mainwindow.html#isCustomizable">isCustomizable</a>() returns true.</p>
 
359
<p><a href="q3mainwindow.html#setAppropriate">setAppropriate</a>()</p>
 
360
<p>See also <a href="q3mainwindow.html#setDockEnabled">setDockEnabled</a>(), <a href="q3mainwindow.html#lineUpDockWindows">lineUpDockWindows</a>(), and <a href="q3mainwindow.html#appropriate">appropriate</a>().</p>
 
361
<h3 class="fn"><a name="leftDock"></a><a href="q3dockarea.html">Q3DockArea</a> * Q3MainWindow::leftDock () const</h3>
 
362
<p>Returns the <tt>Left</tt> dock area</p>
 
363
<p>See also <a href="q3mainwindow.html#rightDock">rightDock</a>(), <a href="q3mainwindow.html#topDock">topDock</a>(), and <a href="q3mainwindow.html#bottomDock">bottomDock</a>().</p>
 
364
<h3 class="fn"><a name="lineUpDockWindows"></a>void Q3MainWindow::lineUpDockWindows ( bool <i>keepNewLines</i> = false )</h3>
 
365
<p>This function will line up dock windows within the visible dock areas (<tt>Top</tt>, <tt>Left</tt>, <tt>Right</tt> and <tt>Bottom</tt>) as compactly as possible.</p>
 
366
<p>If <i>keepNewLines</i> is true, all dock windows stay on their original lines. If <i>keepNewLines</i> is false then newlines may be removed to achieve the most compact layout possible.</p>
 
367
<p>The method only works if <a href="q3mainwindow.html#dockWindowsMovable-prop">dockWindowsMovable</a>() returns true.</p>
 
368
<h3 class="fn"><a name="lineUpToolBars"></a>void Q3MainWindow::lineUpToolBars ( bool <i>keepNewLines</i> = false )</h3>
 
369
<p>Lines up the toolbars. Line breaks are preserved if <i>keepNewLines</i> is true.</p>
 
370
<h3 class="fn"><a name="menuBar"></a><a href="qmenubar.html">QMenuBar</a> * Q3MainWindow::menuBar () const</h3>
 
371
<p>Returns the menu bar for this window.</p>
 
372
<p>If there isn't one, then menuBar() creates an empty menu bar.</p>
 
373
<p>See also <a href="q3mainwindow.html#statusBar">statusBar</a>().</p>
 
374
<h3 class="fn"><a name="moveDockWindow"></a>void Q3MainWindow::moveDockWindow ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>dockWindow</i>, <a href="qt.html#Dock-enum">Qt::Dock</a> <i>edge</i> = Qt::DockTop )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
375
<p>Moves <i>dockWindow</i> to the end of the <i>edge</i>.</p>
 
376
<p>For vertical edges the end is at the bottom, for horizontal edges (including <tt>Minimized</tt>) the end is at the right.</p>
 
377
<p>If <i>dockWindow</i> is managed by another main window, it is first removed from that window.</p>
 
378
<h3 class="fn"><a name="moveDockWindow-2"></a>void Q3MainWindow::moveDockWindow ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>dockWindow</i>, <a href="qt.html#Dock-enum">Qt::Dock</a> <i>edge</i>, bool <i>nl</i>, int <i>index</i>, int <i>extraOffset</i> = -1 )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
379
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
380
<p>Moves <i>dockWindow</i> to position <i>index</i> within the <i>edge</i> dock area.</p>
 
381
<p>Any dock windows with positions <i>index</i> or higher have their position number incremented and any of these on the same line are moved right (down for vertical dock areas) to make room.</p>
 
382
<p>If <i>nl</i> is true, a new dock window line is created below the line in which the moved dock window appears and the moved dock window, with any others with higher positions on the same line, is moved to this new line.</p>
 
383
<p>The <i>extraOffset</i> is the space to put between the left side of the dock area (top side for vertical dock areas) and the dock window. (This is mostly used for restoring dock windows to the positions the user has dragged them to.)</p>
 
384
<p>If <i>dockWindow</i> is managed by another main window, it is first removed from that window.</p>
 
385
<h3 class="fn"><a name="moveToolBar"></a>void Q3MainWindow::moveToolBar ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>dockWindow</i>, <a href="qt.html#Dock-enum">Qt::Dock</a> <i>position</i> = Qt::DockTop )</h3>
 
386
<p>Moves the given <i>dockWindow</i> into the given <i>position</i>.</p>
 
387
<h3 class="fn"><a name="moveToolBar-2"></a>void Q3MainWindow::moveToolBar ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>dockWindow</i>, <a href="qt.html#Dock-enum">Qt::Dock</a> <i>position</i>, bool <i>nl</i>, int <i>index</i>, int <i>extraOffset</i> = -1 )</h3>
 
388
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
389
<p>The <i>dockWindow</i> is made the <i>index</i>-th item in the toolbar, moved over by <i>extraOffset</i>. If <i>nl</i> is true, the dock window is put on a new line.</p>
 
390
<h3 class="fn"><a name="pixmapSizeChanged"></a>void Q3MainWindow::pixmapSizeChanged ( bool <i>b</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
391
<p>This signal is emitted whenever the <a href="q3mainwindow.html#usesBigPixmaps-prop">setUsesBigPixmaps</a>() is called with a value different to the current setting. The new value is passed in <i>b</i>. All widgets that should respond to such changes, e.g. toolbar buttons, must connect to this signal.</p>
 
392
<h3 class="fn"><a name="removeDockWindow"></a>void Q3MainWindow::removeDockWindow ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>dockWindow</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
393
<p>Removes <i>dockWindow</i> from the main window's docking area, provided <i>dockWindow</i> is non-null and managed by this main window.</p>
 
394
<h3 class="fn"><a name="removeToolBar"></a>void Q3MainWindow::removeToolBar ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>dockWindow</i> )</h3>
 
395
<p>Removes the toolbar from the given <i>dockWindow</i>.</p>
 
396
<h3 class="fn"><a name="rightDock"></a><a href="q3dockarea.html">Q3DockArea</a> * Q3MainWindow::rightDock () const</h3>
 
397
<p>Returns the <tt>Right</tt> dock area</p>
 
398
<p>See also <a href="q3mainwindow.html#leftDock">leftDock</a>(), <a href="q3mainwindow.html#topDock">topDock</a>(), and <a href="q3mainwindow.html#bottomDock">bottomDock</a>().</p>
 
399
<h3 class="fn"><a name="setAppropriate"></a>void Q3MainWindow::setAppropriate ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>dw</i>, bool <i>a</i> )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
400
<p>Use this function to control whether or not the <i>dw</i> dock window's caption should appear as a menu item on the dock window menu that lists the dock windows.</p>
 
401
<p>If <i>a</i> is true then the <i>dw</i> will appear as a menu item on the dock window menu. The user is able to change the state (show or hide) a dock window that has a menu item by clicking the item; depending on the state of your application, this may or may not be appropriate. If <i>a</i> is false the <i>dw</i> will not appear on the popup menu.</p>
 
402
<p>See also <a href="q3mainwindow.html#showDockMenu">showDockMenu</a>(), <a href="q3mainwindow.html#isCustomizable">isCustomizable</a>(), and <a href="q3mainwindow.html#customize">customize</a>().</p>
 
403
<h3 class="fn"><a name="setCentralWidget"></a>void Q3MainWindow::setCentralWidget ( <a href="qwidget.html">QWidget</a> * <i>w</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
404
<p>Sets the central widget for this main window to <i>w</i>.</p>
 
405
<p>The central widget is surrounded by the left, top, right and bottom dock areas. The menu bar is above the top dock area.</p>
 
406
<p>See also <a href="q3mainwindow.html#centralWidget">centralWidget</a>().</p>
 
407
<h3 class="fn"><a name="setDockEnabled"></a>void Q3MainWindow::setDockEnabled ( <a href="qt.html#Dock-enum">Qt::Dock</a> <i>dock</i>, bool <i>enable</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
408
<p>If <i>enable</i> is true then users can dock windows in the <i>dock</i> area. If <i>enable</i> is false users cannot dock windows in the <i>dock</i> dock area.</p>
 
409
<p>Users can dock (drag) dock windows into any enabled dock area.</p>
 
410
<h3 class="fn"><a name="setDockEnabled-2"></a>void Q3MainWindow::setDockEnabled ( <a href="q3dockwindow.html">Q3DockWindow</a> * <i>dw</i>, <a href="qt.html#Dock-enum">Qt::Dock</a> <i>dock</i>, bool <i>enable</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
411
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
412
<p>If <i>enable</i> is true then users can dock the <i>dw</i> dock window in the <i>dock</i> area. If <i>enable</i> is false users cannot dock the <i>dw</i> dock window in the <i>dock</i> area.</p>
 
413
<p>In general users can dock (drag) dock windows into any enabled dock area. Using this function particular dock areas can be enabled (or disabled) as docking points for particular dock windows.</p>
 
414
<h3 class="fn"><a name="setDockMenuEnabled"></a>void Q3MainWindow::setDockMenuEnabled ( bool <i>b</i> )&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
415
<p>If <i>b</i> is true, then right clicking on a dock window or dock area will pop up the dock window menu. If <i>b</i> is false, right clicking a dock window or dock area will not pop up the menu.</p>
 
416
<p>The menu lists the (<a href="q3mainwindow.html#appropriate">appropriate</a>()) dock windows (which may be shown or hidden), and has a &quot;Line Up Dock Windows&quot; item. It will also have a &quot;Customize&quot; menu item if <a href="q3mainwindow.html#isCustomizable">isCustomizable</a>() returns true.</p>
 
417
<p>See also <a href="q3mainwindow.html#lineUpDockWindows">lineUpDockWindows</a>() and <a href="q3mainwindow.html#isDockMenuEnabled">isDockMenuEnabled</a>().</p>
 
418
<h3 class="fn"><a name="setToolBarsMovable"></a>void Q3MainWindow::setToolBarsMovable ( bool <i>b</i> )&nbsp;&nbsp;<tt> [slot]</tt></h3>
 
419
<p>If <i>b</i> is true the tool bars can be moved.</p>
 
420
<h3 class="fn"><a name="setUpLayout"></a>void Q3MainWindow::setUpLayout ()&nbsp;&nbsp;<tt> [virtual protected slot]</tt></h3>
 
421
<p>Sets up the geometry management of the window. It is called automatically when needed, so you shouldn't need to call it.</p>
 
422
<h3 class="fn"><a name="showDockMenu"></a>bool Q3MainWindow::showDockMenu ( const <a href="qpoint.html">QPoint</a> &amp; <i>globalPos</i> )&nbsp;&nbsp;<tt> [virtual protected slot]</tt></h3>
 
423
<p>Shows the dock menu at the position <i>globalPos</i>. The menu lists the dock windows so that they can be shown (or hidden), lined up, and possibly customized. Returns true if the menu is shown; otherwise returns false.</p>
 
424
<p>If you want a custom menu, reimplement this function. You can create the menu from scratch or call <a href="q3mainwindow.html#createDockWindowMenu">createDockWindowMenu</a>() and modify the result.</p>
 
425
<p>The default implementation uses the dock window menu which gets created by <a href="q3mainwindow.html#createDockWindowMenu">createDockWindowMenu</a>(). You can reimplement <a href="q3mainwindow.html#createDockWindowMenu">createDockWindowMenu</a>() if you want to use your own specialized popup menu.</p>
 
426
<h3 class="fn"><a name="statusBar"></a><a href="qstatusbar.html">QStatusBar</a> * Q3MainWindow::statusBar () const</h3>
 
427
<p>Returns this main window's status bar. If there isn't one, statusBar() creates an empty status bar, and if necessary a tool tip group too.</p>
 
428
<p>See also <a href="q3mainwindow.html#menuBar">menuBar</a>().</p>
 
429
<h3 class="fn"><a name="toolBarPositionChanged"></a>void Q3MainWindow::toolBarPositionChanged ( <a href="q3toolbar.html">Q3ToolBar</a> * <i>toolbar</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
430
<p>This signal is emitted when a <i>toolbar</i> is moved.</p>
 
431
<h3 class="fn"><a name="toolBars"></a><a href="qlist.html">QList</a>&lt;<a href="q3toolbar.html">Q3ToolBar</a> *&gt; Q3MainWindow::toolBars ( <a href="qt.html#Dock-enum">Qt::Dock</a> <i>dock</i> ) const</h3>
 
432
<p>Returns a list of all the toolbars which are in the <i>dock</i> dock area, regardless of their state.</p>
 
433
<p>For example, the <tt>TornOff</tt> dock area may contain closed toolbars but these are returned along with the visible toolbars.</p>
 
434
<p>See also <a href="q3mainwindow.html#dockWindows">dockWindows</a>().</p>
 
435
<h3 class="fn"><a name="toolBarsMovable"></a>bool Q3MainWindow::toolBarsMovable () const</h3>
 
436
<h3 class="fn"><a name="topDock"></a><a href="q3dockarea.html">Q3DockArea</a> * Q3MainWindow::topDock () const</h3>
 
437
<p>Returns the <tt>Top</tt> dock area</p>
 
438
<p>See also <a href="q3mainwindow.html#bottomDock">bottomDock</a>(), <a href="q3mainwindow.html#leftDock">leftDock</a>(), and <a href="q3mainwindow.html#rightDock">rightDock</a>().</p>
 
439
<h3 class="fn"><a name="usesTextLabelChanged"></a>void Q3MainWindow::usesTextLabelChanged ( bool <i>b</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
440
<p>This signal is emitted whenever the <a href="q3mainwindow.html#usesTextLabel-prop">setUsesTextLabel</a>() is called with a value different to the current setting. The new value is passed in <i>b</i>. All widgets that should respond to such changes, e.g. toolbar buttons, must connect to this signal.</p>
 
441
<h3 class="fn"><a name="whatsThis"></a>void Q3MainWindow::whatsThis ()&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
 
442
<p>Enters 'What's This?' mode and returns immediately.</p>
 
443
<p>This is the same as <a href="qwhatsthis.html#enterWhatsThisMode">QWhatsThis::enterWhatsThisMode</a>(), but implemented as a main window object's slot. This way it can easily be used for popup menus, for example:</p>
 
444
<pre>&nbsp;   Q3PopupMenu * help = new Q3PopupMenu(this);
 
445
    help-&gt;insertItem(&quot;What's &amp;This&quot;, this , SLOT(enterWhatsThis()), Qt::SHIFT+Qt::Key_F1);</pre>
 
446
<p>See also <a href="q3whatsthis.html#enterWhatsThisMode">Q3WhatsThis::enterWhatsThisMode</a>().</p>
 
447
<hr />
 
448
<h2>Related Non-Members</h2>
 
449
<h3 class="fn"><a name="operator-lt-lt-89"></a><a href="qtextstream.html">QTextStream</a> &amp; operator&lt;&lt; ( <a href="qtextstream.html">QTextStream</a> &amp; <i>ts</i>, const Q3MainWindow &amp; <i>mainWindow</i> )</h3>
 
450
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
451
<p>Writes the layout (sizes and positions) of the dock windows in the dock areas of the <a href="q3mainwindow.html">Q3MainWindow</a> <i>mainWindow</i>, including <tt>Minimized</tt> and <tt>TornOff</tt> dock windows, to the text stream <i>ts</i>.</p>
 
452
<p>This can be used, for example, in conjunction with <a href="qsettings.html">QSettings</a> to save the user's layout when the <i>mainWindow</i> receives a close event.</p>
 
453
<p>See also <a href="qwidget.html#closeEvent">QWidget::closeEvent</a>().</p>
 
454
<h3 class="fn"><a name="operator-gt-gt-62"></a><a href="qtextstream.html">QTextStream</a> &amp; operator&gt;&gt; ( <a href="qtextstream.html">QTextStream</a> &amp; <i>ts</i>, Q3MainWindow &amp; <i>mainWindow</i> )</h3>
 
455
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
456
<p>Reads the layout (sizes and positions) of the dock windows in the dock areas of the <a href="q3mainwindow.html">Q3MainWindow</a> <i>mainWindow</i> from the text stream, <i>ts</i>, including <tt>Minimized</tt> and <tt>TornOff</tt> dock windows. Restores the dock windows and dock areas to these sizes and positions. The layout information must be in the format produced by operator&lt;&lt;().</p>
 
457
<p>This can be used, for example, in conjunction with <a href="qsettings.html">QSettings</a> to restore the user's layout.</p>
 
458
<p /><address><hr /><div align="center">
 
459
<table width="100%" cellspacing="0" border="0"><tr class="address">
 
460
<td width="30%">Copyright &copy; 2005 <a href="trolltech.html">Trolltech</a></td>
 
461
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
 
462
<td width="30%" align="right"><div align="right">Qt 4.0.0</div></td>
 
463
</tr></table></div></address></body>
 
464
</html>