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

« back to all changes in this revision

Viewing changes to doc/html/qmainwindow.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/gui/widgets/qmainwindow.cpp -->
 
6
<head>
 
7
    <title>Qt 4.0: QMainWindow 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">QMainWindow Class Reference</h1>
 
21
<p>The QMainWindow class provides a main application window. <a href="#details">More...</a></p>
 
22
<pre>#include &lt;QMainWindow&gt;</pre><p>Part of the <a href="qtgui.html">QtGui</a> module.</p>
 
23
<p>Inherits <a href="qwidget.html">QWidget</a>.</p>
 
24
<ul>
 
25
<li><a href="qmainwindow-members.html">List of all members, including inherited members</a></li>
 
26
<li><a href="qmainwindow-qt3.html">Qt 3 support members</a></li>
 
27
</ul>
 
28
<a name="properties"></a>
 
29
<h3>Properties</h3>
 
30
<ul>
 
31
<li><div class="fn"/><b><a href="qmainwindow.html#iconSize-prop">iconSize</a></b> : QSize</li>
 
32
<li><div class="fn"/><b><a href="qmainwindow.html#toolButtonStyle-prop">toolButtonStyle</a></b> : Qt::ToolButtonStyle</li>
 
33
</ul>
 
34
<ul>
 
35
<li><div class="fn"/>52 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
 
36
<li><div class="fn"/>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
 
37
</ul>
 
38
<a name="public-functions"></a>
 
39
<h3>Public Functions</h3>
 
40
<ul>
 
41
<li><div class="fn"/><b><a href="qmainwindow.html#QMainWindow">QMainWindow</a></b> ( QWidget * <i>parent</i> = 0, Qt::WFlags <i>flags</i> = 0 )</li>
 
42
<li><div class="fn"/><b><a href="qmainwindow.html#dtor.QMainWindow">~QMainWindow</a></b> ()</li>
 
43
<li><div class="fn"/>void <b><a href="qmainwindow.html#addDockWidget">addDockWidget</a></b> ( Qt::DockWidgetArea <i>area</i>, QDockWidget * <i>dockwidget</i> )</li>
 
44
<li><div class="fn"/>void <b><a href="qmainwindow.html#addDockWidget-2">addDockWidget</a></b> ( Qt::DockWidgetArea <i>area</i>, QDockWidget * <i>dockwidget</i>, Qt::Orientation <i>orientation</i> )</li>
 
45
<li><div class="fn"/>void <b><a href="qmainwindow.html#addToolBar">addToolBar</a></b> ( Qt::ToolBarArea <i>area</i>, QToolBar * <i>toolbar</i> )</li>
 
46
<li><div class="fn"/>void <b><a href="qmainwindow.html#addToolBar-2">addToolBar</a></b> ( QToolBar * <i>toolbar</i> )</li>
 
47
<li><div class="fn"/>QToolBar * <b><a href="qmainwindow.html#addToolBar-3">addToolBar</a></b> ( const QString &amp; <i>title</i> )</li>
 
48
<li><div class="fn"/>void <b><a href="qmainwindow.html#addToolBarBreak">addToolBarBreak</a></b> ( Qt::ToolBarArea <i>area</i> = Qt::TopToolBarArea )</li>
 
49
<li><div class="fn"/>QWidget * <b><a href="qmainwindow.html#centralWidget">centralWidget</a></b> () const</li>
 
50
<li><div class="fn"/>Qt::DockWidgetArea <b><a href="qmainwindow.html#corner">corner</a></b> ( Qt::Corner <i>corner</i> ) const</li>
 
51
<li><div class="fn"/>virtual QMenu * <b><a href="qmainwindow.html#createPopupMenu">createPopupMenu</a></b> ()</li>
 
52
<li><div class="fn"/>Qt::DockWidgetArea <b><a href="qmainwindow.html#dockWidgetArea">dockWidgetArea</a></b> ( QDockWidget * <i>dockwidget</i> ) const</li>
 
53
<li><div class="fn"/>QSize <b><a href="qmainwindow.html#iconSize-prop">iconSize</a></b> () const</li>
 
54
<li><div class="fn"/>void <b><a href="qmainwindow.html#insertToolBar">insertToolBar</a></b> ( QToolBar * <i>before</i>, QToolBar * <i>toolbar</i> )</li>
 
55
<li><div class="fn"/>void <b><a href="qmainwindow.html#insertToolBarBreak">insertToolBarBreak</a></b> ( QToolBar * <i>before</i> )</li>
 
56
<li><div class="fn"/>QMenuBar * <b><a href="qmainwindow.html#menuBar">menuBar</a></b> () const</li>
 
57
<li><div class="fn"/>void <b><a href="qmainwindow.html#removeDockWidget">removeDockWidget</a></b> ( QDockWidget * <i>dockwidget</i> )</li>
 
58
<li><div class="fn"/>void <b><a href="qmainwindow.html#removeToolBar">removeToolBar</a></b> ( QToolBar * <i>toolbar</i> )</li>
 
59
<li><div class="fn"/>bool <b><a href="qmainwindow.html#restoreState">restoreState</a></b> ( const QByteArray &amp; <i>state</i>, int <i>version</i> = 0 )</li>
 
60
<li><div class="fn"/>QByteArray <b><a href="qmainwindow.html#saveState">saveState</a></b> ( int <i>version</i> = 0 ) const</li>
 
61
<li><div class="fn"/>void <b><a href="qmainwindow.html#setCentralWidget">setCentralWidget</a></b> ( QWidget * <i>widget</i> )</li>
 
62
<li><div class="fn"/>void <b><a href="qmainwindow.html#setCorner">setCorner</a></b> ( Qt::Corner <i>corner</i>, Qt::DockWidgetArea <i>area</i> )</li>
 
63
<li><div class="fn"/>void <b><a href="qmainwindow.html#iconSize-prop">setIconSize</a></b> ( const QSize &amp; <i>iconSize</i> )</li>
 
64
<li><div class="fn"/>void <b><a href="qmainwindow.html#setMenuBar">setMenuBar</a></b> ( QMenuBar * <i>menuBar</i> )</li>
 
65
<li><div class="fn"/>void <b><a href="qmainwindow.html#setStatusBar">setStatusBar</a></b> ( QStatusBar * <i>statusbar</i> )</li>
 
66
<li><div class="fn"/>void <b><a href="qmainwindow.html#toolButtonStyle-prop">setToolButtonStyle</a></b> ( Qt::ToolButtonStyle <i>toolButtonStyle</i> )</li>
 
67
<li><div class="fn"/>void <b><a href="qmainwindow.html#splitDockWidget">splitDockWidget</a></b> ( QDockWidget * <i>first</i>, QDockWidget * <i>second</i>, Qt::Orientation <i>orientation</i> )</li>
 
68
<li><div class="fn"/>QStatusBar * <b><a href="qmainwindow.html#statusBar">statusBar</a></b> () const</li>
 
69
<li><div class="fn"/>Qt::ToolBarArea <b><a href="qmainwindow.html#toolBarArea">toolBarArea</a></b> ( QToolBar * <i>toolbar</i> ) const</li>
 
70
<li><div class="fn"/>Qt::ToolButtonStyle <b><a href="qmainwindow.html#toolButtonStyle-prop">toolButtonStyle</a></b> () const</li>
 
71
</ul>
 
72
<ul>
 
73
<li><div class="fn"/>183 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
 
74
<li><div class="fn"/>28 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
 
75
<li><div class="fn"/>10 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
 
76
</ul>
 
77
<a name="signals"></a>
 
78
<h3>Signals</h3>
 
79
<ul>
 
80
<li><div class="fn"/>void <b><a href="qmainwindow.html#iconSizeChanged">iconSizeChanged</a></b> ( const QSize &amp; <i>iconSize</i> )</li>
 
81
<li><div class="fn"/>void <b><a href="qmainwindow.html#toolButtonStyleChanged">toolButtonStyleChanged</a></b> ( Qt::ToolButtonStyle <i>toolButtonStyle</i> )</li>
 
82
</ul>
 
83
<ul>
 
84
<li><div class="fn"/>1 signal inherited from <a href="qwidget.html#signals">QWidget</a></li>
 
85
<li><div class="fn"/>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
 
86
</ul>
 
87
<h3>Additional Inherited Members</h3>
 
88
<ul>
 
89
<li><div class="fn"/>17 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
 
90
<li><div class="fn"/>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
 
91
<li><div class="fn"/>4 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
 
92
<li><div class="fn"/>4 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
 
93
<li><div class="fn"/>39 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
 
94
<li><div class="fn"/>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
 
95
</ul>
 
96
<a name="details"></a>
 
97
<hr />
 
98
<h2>Detailed Description</h2>
 
99
<p>The QMainWindow class provides a main application window.</p>
 
100
<p>QMainWindow provides a main application window, with a menu bar, tool bars, dock widgets and a status bar around a large central widget, such as a text edit, drawing canvas or Q3Workspace (for MDI applications).</p>
 
101
<p>Topics:</p>
 
102
<ul><li><a href="#saving-and-restoring-state">Saving and restoring state</a></li>
 
103
<li><a href="#behavior-of-dock-widgets">Behavior of Dock Widgets</a></li>
 
104
<ul><li><a href="#dock-widget-separators">Dock Widget Separators</a></li>
 
105
<li><a href="#dragging-dock-widgets">Dragging Dock Widgets</a></li>
 
106
<li><a href="#dragging-over-neighbors">Dragging over Neighbors</a></li>
 
107
<li><a href="#dragging-over-other-qdockwidgets">Dragging over other QDockWidgets</a></li>
 
108
<li><a href="#dragging-to-a-different-qt-dockwidgetarea">Dragging to a Different Qt::DockWidgetArea</a></li>
 
109
</ul>
 
110
</ul>
 
111
<a name="saving-and-restoring-state"></a>
 
112
<h3>Saving and restoring state</h3>
 
113
<p>The <a href="qmainwindow.html#saveState">saveState</a>() and <a href="qmainwindow.html#restoreState">restoreState</a>() functions provide a means to save and restore the layout of the QToolBars and QDockWidgets in the QMainWindow. These functions work by storing the <a href="qobject.html#objectName-prop">objectName</a> of each <a href="qtoolbar.html">QToolBar</a> and <a href="qdockwidget.html">QDockWidget</a> together with information about placement, size, etc.</p>
 
114
<a name="behavior-of-dock-widgets"></a>
 
115
<h3>Behavior of Dock Widgets</h3>
 
116
<a name="dock-widget-separators"></a><a name="dock-widget-separators"></a>
 
117
<h4>Dock Widget Separators</h4>
 
118
<p>QMainWindow uses separators to separate QDockWidgets from each other and the <a href="qmainwindow.html#centralWidget">central widget</a>. These separators let the user control the size of QDockWidgets by dragging the boundary between them.</p>
 
119
<p>A <a href="qdockwidget.html">QDockWidget</a> can be as large or as small as the user wishes, between the <a href="qwidget.html#minimumSizeHint-prop">minimumSizeHint</a>() (or <a href="qwidget.html#minimumSize-prop">minimumSize</a>()) and <a href="qwidget.html#maximumSize-prop">maximumSize</a>() of the <a href="qdockwidget.html">QDockWidget</a>. When a <a href="qdockwidget.html">QDockWidget</a> reaches its minimum size, space will be taken from other QDockWidgets in the direction of the user's drag, if possible. Once all QDockWidgets have reached their minimum sizes, further dragging does nothing. When a <a href="qdockwidget.html">QDockWidget</a> reaches its maximium size, space will be given to other QDockWidgets in the opposite direction of the user's drag, if possible. Once all QDockWidgets have reached their minimum size, futher dragging does nothing.</p>
 
120
<a name="dragging-dock-widgets"></a><a name="dragging-dock-widgets"></a>
 
121
<h4>Dragging Dock Widgets</h4>
 
122
<p><a href="qdockwidget.html">QDockWidget</a> displays a title bar to let the user drag the dock widget to a new location. A <a href="qdockwidget.html">QDockWidget</a> can be moved to any location provided enough space is available. (QMainWindow won't resize itself to a larger size in an attempt to provide more space.)</p>
 
123
<p>A <a href="qrubberband.html">QRubberBand</a> is shown while dragging the <a href="qdockwidget.html">QDockWidget</a>. This <a href="qrubberband.html">QRubberBand</a> provides an indication to the user about where the <a href="qdockwidget.html">QDockWidget</a> will be placed when the mouse button is released.</p>
 
124
<a name="dragging-over-neighbors"></a>
 
125
<h4>Dragging over Neighbors</h4>
 
126
<p>All un-nested QDockWidgets in the same dock area are considered neighbors. When dragging a <a href="qdockwidget.html">QDockWidget</a> over its neighbor:</p>
 
127
<ul>
 
128
<li>QMainWindow will split the neighbor perpendicularly to the direction of the QDockWidgets.</li>
 
129
<li>QMainWindow will swap the position of the <a href="qdockwidget.html">QDockWidget</a> being dragged and its neighbor once the user has dragged the mouse past the center point of the neighboring <a href="qdockwidget.html">QDockWidget</a>.</li>
 
130
</ul>
 
131
<p>The following diagram depicts this behavior:</p>
 
132
<center><img src="images/dockwidget-neighbors.png" alt="Diagram" /></center><a name="dragging-over-other-qdockwidgets"></a>
 
133
<h4>Dragging over other QDockWidgets</h4>
 
134
<p>When dragging nested QDockWidgets, or when dragging to a different dock area, QMainWindow will split the <a href="porting4.html#qdockwindow">QDockWindow</a> under the mouse. Be aware that the <a href="qdockwidget.html">QDockWidget</a> under the mouse will only be split by the <a href="qdockwidget.html">QDockWidget</a> being dragged if both can fit in the space currently occupied by the <a href="qdockwidget.html">QDockWidget</a> under the mouse.</p>
 
135
<p>A <a href="qdockwidget.html">QDockWidget</a> can be split horizontally or vertically, with the <a href="qdockwidget.html">QDockWidget</a> being dragged being placed in one of four possible locations, as shown in the diagram below:</p>
 
136
<center><img src="images/dockwidget-cross.png" alt="Diagram" /></center><a name="dragging-to-a-different-qt-dockwidgetarea"></a>
 
137
<h4>Dragging to a Different Qt::DockWidgetArea</h4>
 
138
<p>The QDockWidget::floatable property influences feedback when the user drags a <a href="qdockwidget.html">QDockWidget</a> over the central widget:</p>
 
139
<ul>
 
140
<li>If <a href="qdockwidget.html#floating-prop">floating</a> is <tt>true</tt>, QMainWindow chooses a dock area based on the position of the mouse pointer. If the mouse is within 50 pixels of the central widget's edge, the adjacent dock area is chosen. When dragging into the corners of these 50 pixel regions, the current <a href="qmainwindow.html#corner">corner</a>() configuration is used to make the decision. Otherwise, the <a href="qrubberband.html">QRubberBand</a> is shown under the mouse pointer, as above.</li>
 
141
<li>If <a href="qdockwidget.html#floating-prop">floating</a> is <tt>false</tt>, QMainWindow chooses a dock area based on the distance between the mouse pointer and the center of the central widget. If the mouse comes within 50 pixels of the central widget's edge, the adjacent dock area is always chosen. When dragging into the corners of these 50 pixel regions, the current <a href="qmainwindow.html#corner">corner</a>() configuration is used to make the decision.</li>
 
142
</ul>
 
143
<p>In either case, dragging the mouse over another <a href="qdockwidget.html">QDockWidget</a> causes QMainWindow to choose the other <a href="qdockwidget.html">QDockWidget</a>'s dock area.</p>
 
144
<p>When dragging outside the QMainWindow, the <a href="qdockwidget.html#floating-prop">QDockWidget::floating</a> property again controls feedback during dragging. When the property is <tt>false</tt>, dragging outside of the QMainWindow will show the rubberband over the <a href="qdockwidget.html">QDockWidget</a>'s current location. This indicates that the <a href="qdockwidget.html">QDockWidget</a> cannot be moved outside of the QMainWindow. When the QDockWidget::floatable property is <tt>true</tt>, dragging outside of the QMainWindow will show the <a href="qrubberband.html">QRubberBand</a> under the mouse pointer. This indicates that the <a href="qdockwidget.html">QDockWidget</a> will be floating when the mouse button is released.</p>
 
145
<p>See also <a href="qmenubar.html">QMenuBar</a>, <a href="qtoolbar.html">QToolBar</a>, <a href="qstatusbar.html">QStatusBar</a>, and <a href="qdockwidget.html">QDockWidget</a>.</p>
 
146
<hr />
 
147
<h2>Property Documentation</h2>
 
148
<h3 class="fn"><a name="iconSize-prop"></a>iconSize : <a href="qsize.html">QSize</a></h3>
 
149
<p>This property holds size of toolbar icons in this mainwindow.</p>
 
150
<p>The default is the default tool bar icon size of the GUI style.</p>
 
151
<p>Access functions:</p>
 
152
<ul>
 
153
<li><div class="fn"/><b>QSize iconSize () const</b></li>
 
154
<li><div class="fn"/><b>void setIconSize ( const QSize &amp; <i>iconSize</i> )</b></li>
 
155
</ul>
 
156
<h3 class="fn"><a name="toolButtonStyle-prop"></a>toolButtonStyle : <a href="qt.html#ToolButtonStyle-enum">Qt::ToolButtonStyle</a></h3>
 
157
<p>This property holds style of toolbar buttons in this mainwindow.</p>
 
158
<p>The default is <a href="qt.html#ToolButtonStyle-enum">Qt::ToolButtonIconOnly</a>.</p>
 
159
<p>Access functions:</p>
 
160
<ul>
 
161
<li><div class="fn"/><b>Qt::ToolButtonStyle toolButtonStyle () const</b></li>
 
162
<li><div class="fn"/><b>void setToolButtonStyle ( Qt::ToolButtonStyle <i>toolButtonStyle</i> )</b></li>
 
163
</ul>
 
164
<hr />
 
165
<h2>Member Function Documentation</h2>
 
166
<h3 class="fn"><a name="QMainWindow"></a>QMainWindow::QMainWindow ( <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0, <a href="qt.html#WFlags-typedef">Qt::WFlags</a> <i>flags</i> = 0 )</h3>
 
167
<p>Constructs a <a href="qmainwindow.html">QMainWindow</a> with the given <i>parent</i> and the specified widget <i>flags</i>.</p>
 
168
<h3 class="fn"><a name="dtor.QMainWindow"></a>QMainWindow::~QMainWindow ()</h3>
 
169
<p>Destroys the main window.</p>
 
170
<h3 class="fn"><a name="addDockWidget"></a>void QMainWindow::addDockWidget ( <a href="qt.html#DockWidgetArea-enum">Qt::DockWidgetArea</a> <i>area</i>, <a href="qdockwidget.html">QDockWidget</a> * <i>dockwidget</i> )</h3>
 
171
<p>Adds the given <i>dockwidget</i> to the specified <i>area</i>.</p>
 
172
<h3 class="fn"><a name="addDockWidget-2"></a>void QMainWindow::addDockWidget ( <a href="qt.html#DockWidgetArea-enum">Qt::DockWidgetArea</a> <i>area</i>, <a href="qdockwidget.html">QDockWidget</a> * <i>dockwidget</i>, <a href="qt.html#Orientation-enum">Qt::Orientation</a> <i>orientation</i> )</h3>
 
173
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
174
<p>Adds <i>dockwidget</i> into the given <i>area</i> in the direction specified by the <i>orientation</i>.</p>
 
175
<h3 class="fn"><a name="addToolBar"></a>void QMainWindow::addToolBar ( <a href="qt.html#ToolBarArea-enum">Qt::ToolBarArea</a> <i>area</i>, <a href="qtoolbar.html">QToolBar</a> * <i>toolbar</i> )</h3>
 
176
<p>Adds the <i>toolbar</i> into the specified <i>area</i> in this main window. The <i>toolbar</i> is placed at the end of the current tool bar block (i.e. line).</p>
 
177
<p>See also <a href="qmainwindow.html#insertToolBar">insertToolBar</a>(), <a href="qmainwindow.html#addToolBarBreak">addToolBarBreak</a>(), and <a href="qmainwindow.html#insertToolBarBreak">insertToolBarBreak</a>().</p>
 
178
<h3 class="fn"><a name="addToolBar-2"></a>void QMainWindow::addToolBar ( <a href="qtoolbar.html">QToolBar</a> * <i>toolbar</i> )</h3>
 
179
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
180
<p>Equivalent of calling addToolBar(<a href="qt.html#ToolBarArea-enum">Qt::TopToolBarArea</a>, <i>toolbar</i>)</p>
 
181
<h3 class="fn"><a name="addToolBar-3"></a><a href="qtoolbar.html">QToolBar</a> * QMainWindow::addToolBar ( const <a href="qstring.html">QString</a> &amp; <i>title</i> )</h3>
 
182
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
183
<p>Creates a <a href="qtoolbar.html">QToolBar</a> object, setting its window title to <i>title</i>, and inserts it into the top toolbar area.</p>
 
184
<p>See also <a href="qwidget.html#windowTitle-prop">setWindowTitle</a>().</p>
 
185
<h3 class="fn"><a name="addToolBarBreak"></a>void QMainWindow::addToolBarBreak ( <a href="qt.html#ToolBarArea-enum">Qt::ToolBarArea</a> <i>area</i> = Qt::TopToolBarArea )</h3>
 
186
<p>Adds a toolbar break to the given <i>area</i> after all the other objects that are present.</p>
 
187
<h3 class="fn"><a name="centralWidget"></a><a href="qwidget.html">QWidget</a> * QMainWindow::centralWidget () const</h3>
 
188
<p>Returns the central widget for the main window. This function returns zero if the central widget has not been set.</p>
 
189
<p>See also <a href="qmainwindow.html#setCentralWidget">setCentralWidget</a>().</p>
 
190
<h3 class="fn"><a name="corner"></a><a href="qt.html#DockWidgetArea-enum">Qt::DockWidgetArea</a> QMainWindow::corner ( <a href="qt.html#Corner-enum">Qt::Corner</a> <i>corner</i> ) const</h3>
 
191
<p>Returns the dock widget area that occupies the specified <i>corner</i>.</p>
 
192
<p>See also <a href="qmainwindow.html#setCorner">setCorner</a>().</p>
 
193
<h3 class="fn"><a name="createPopupMenu"></a><a href="qmenu.html">QMenu</a> * QMainWindow::createPopupMenu ()&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
194
<p>This function is called to create a popup menu when the user right-clicks on the menu bar, a toolbar or a dock widget. If you want to create a custom popup menu, reimplement this function and return the created popup menu. Ownership of the popup menu is transferred to the caller.</p>
 
195
<h3 class="fn"><a name="dockWidgetArea"></a><a href="qt.html#DockWidgetArea-enum">Qt::DockWidgetArea</a> QMainWindow::dockWidgetArea ( <a href="qdockwidget.html">QDockWidget</a> * <i>dockwidget</i> ) const</h3>
 
196
<p>Returns the <tt>Qt::DockWidgetArea</tt> for <i>dockwidget</i>.</p>
 
197
<p>See also <a href="qmainwindow.html#addDockWidget">addDockWidget</a>(), <a href="qmainwindow.html#splitDockWidget">splitDockWidget</a>(), and <a href="qt.html#DockWidgetArea-enum">Qt::DockWidgetArea</a>.</p>
 
198
<h3 class="fn"><a name="iconSizeChanged"></a>void QMainWindow::iconSizeChanged ( const <a href="qsize.html">QSize</a> &amp; <i>iconSize</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
199
<p>This signal is emitted when the size of the icons used in the window is changed. The new icon size is passed in <i>iconSize</i>.</p>
 
200
<p>You can connect this signal to other components to help maintain a consistent appearance for your application.</p>
 
201
<p>See also <a href="qmainwindow.html#iconSize-prop">setIconSize</a>().</p>
 
202
<h3 class="fn"><a name="insertToolBar"></a>void QMainWindow::insertToolBar ( <a href="qtoolbar.html">QToolBar</a> * <i>before</i>, <a href="qtoolbar.html">QToolBar</a> * <i>toolbar</i> )</h3>
 
203
<p>Inserts the <i>toolbar</i> into the area occupied by the <i>before</i> toolbar so that it appears before it. For example, in normal left-to-right layout operation, this means that <i>toolbar</i> will appear to the left of the toolbar specified by <i>before</i> in a horizontal toolbar area.</p>
 
204
<p>See also <a href="qmainwindow.html#insertToolBarBreak">insertToolBarBreak</a>(), <a href="qmainwindow.html#addToolBar">addToolBar</a>(), and <a href="qmainwindow.html#addToolBarBreak">addToolBarBreak</a>().</p>
 
205
<h3 class="fn"><a name="insertToolBarBreak"></a>void QMainWindow::insertToolBarBreak ( <a href="qtoolbar.html">QToolBar</a> * <i>before</i> )</h3>
 
206
<p>Inserts a toolbar break before the toolbar specified by <i>before</i>.</p>
 
207
<h3 class="fn"><a name="menuBar"></a><a href="qmenubar.html">QMenuBar</a> * QMainWindow::menuBar () const</h3>
 
208
<p>Returns the menu bar for the main window. This function creates and returns an empty menu bar if the menu bar does not exist.</p>
 
209
<p>See also <a href="qmainwindow.html#setMenuBar">setMenuBar</a>().</p>
 
210
<h3 class="fn"><a name="removeDockWidget"></a>void QMainWindow::removeDockWidget ( <a href="qdockwidget.html">QDockWidget</a> * <i>dockwidget</i> )</h3>
 
211
<p>Removes the <i>dockwidget</i> from the main window.</p>
 
212
<h3 class="fn"><a name="removeToolBar"></a>void QMainWindow::removeToolBar ( <a href="qtoolbar.html">QToolBar</a> * <i>toolbar</i> )</h3>
 
213
<p>Removes the <i>toolbar</i> from the main window.</p>
 
214
<h3 class="fn"><a name="restoreState"></a>bool QMainWindow::restoreState ( const <a href="qbytearray.html">QByteArray</a> &amp; <i>state</i>, int <i>version</i> = 0 )</h3>
 
215
<p>Restores the <i>state</i> of this mainwindow's toolbars and dockwidgets. The <i>version</i> number is compared with that stored in <i>state</i>. If they do not match, the mainwindow's state is left unchanged, and this function returns <tt>false</tt>; otherwise, the state is restored, and this function returns <tt>true</tt>.</p>
 
216
<p>See also <a href="qmainwindow.html#saveState">saveState</a>().</p>
 
217
<h3 class="fn"><a name="saveState"></a><a href="qbytearray.html">QByteArray</a> QMainWindow::saveState ( int <i>version</i> = 0 ) const</h3>
 
218
<p>Saves the current state of this mainwindow's toolbars and dockwidgets. The <i>version</i> number is stored as part of the data.</p>
 
219
<p>The <a href="qobject.html#objectName-prop">objectName</a> property is used to identify each <a href="qtoolbar.html">QToolBar</a> and <a href="qdockwidget.html">QDockWidget</a>. You should make sure that this property is unique for each <a href="qtoolbar.html">QToolBar</a> and <a href="qdockwidget.html">QDockWidget</a> you add to the <a href="qmainwindow.html">QMainWindow</a></p>
 
220
<p>To restore the saved state, pass the return value and <i>version</i> number to <a href="qmainwindow.html#restoreState">restoreState</a>().</p>
 
221
<p>See also <a href="qmainwindow.html#restoreState">restoreState</a>().</p>
 
222
<h3 class="fn"><a name="setCentralWidget"></a>void QMainWindow::setCentralWidget ( <a href="qwidget.html">QWidget</a> * <i>widget</i> )</h3>
 
223
<p>Sets the given <i>widget</i> to be the main window's central widget.</p>
 
224
<p><b>Warning:</b> This function should be called at most once for each main window instance</p>
 
225
<p>Note: <a href="qmainwindow.html">QMainWindow</a> takes ownership of the <i>widget</i> pointer and deletes it at the appropriate time.</p>
 
226
<p>See also <a href="qmainwindow.html#centralWidget">centralWidget</a>().</p>
 
227
<h3 class="fn"><a name="setCorner"></a>void QMainWindow::setCorner ( <a href="qt.html#Corner-enum">Qt::Corner</a> <i>corner</i>, <a href="qt.html#DockWidgetArea-enum">Qt::DockWidgetArea</a> <i>area</i> )</h3>
 
228
<p>Sets the given dock widget <i>area</i> to occupy the specified <i>corner</i>.</p>
 
229
<p>See also <a href="qmainwindow.html#corner">corner</a>().</p>
 
230
<h3 class="fn"><a name="setMenuBar"></a>void QMainWindow::setMenuBar ( <a href="qmenubar.html">QMenuBar</a> * <i>menuBar</i> )</h3>
 
231
<p>Sets the menu bar for the main window to <i>menuBar</i>.</p>
 
232
<p>Note: <a href="qmainwindow.html">QMainWindow</a> takes ownership of the <i>menuBar</i> pointer and deletes it at the appropriate time.</p>
 
233
<p>See also <a href="qmainwindow.html#menuBar">menuBar</a>().</p>
 
234
<h3 class="fn"><a name="setStatusBar"></a>void QMainWindow::setStatusBar ( <a href="qstatusbar.html">QStatusBar</a> * <i>statusbar</i> )</h3>
 
235
<p>Sets the status bar for the main window to <i>statusbar</i>.</p>
 
236
<p>Note: <a href="qmainwindow.html">QMainWindow</a> takes ownership of the <i>statusbar</i> pointer and deletes it at the appropriate time.</p>
 
237
<p>See also <a href="qmainwindow.html#statusBar">statusBar</a>().</p>
 
238
<h3 class="fn"><a name="splitDockWidget"></a>void QMainWindow::splitDockWidget ( <a href="qdockwidget.html">QDockWidget</a> * <i>first</i>, <a href="qdockwidget.html">QDockWidget</a> * <i>second</i>, <a href="qt.html#Orientation-enum">Qt::Orientation</a> <i>orientation</i> )</h3>
 
239
<p>Splits the space covered by the <i>first</i> dock widget into two parts, moves the <i>first</i> dock widget into the first part, and moves the <i>second</i> dock widget into the second part.</p>
 
240
<p>The <i>orientation</i> specifies how the space is divided: A <a href="qt.html#Orientation-enum">Qt::Horizontal</a> split places the second dock widget to the right of the first; a <a href="qt.html#Orientation-enum">Qt::Vertical</a> split places the second dock widget below the first.</p>
 
241
<p><i>Note</i>: The <a href="qt.html#LayoutDirection-enum">Qt::LayoutDirection</a> influences the order of the dock widgets in the two parts of the divided area. When right-to-left layout direction is enabled, the placing of the dock widgets will be reversed.</p>
 
242
<h3 class="fn"><a name="statusBar"></a><a href="qstatusbar.html">QStatusBar</a> * QMainWindow::statusBar () const</h3>
 
243
<p>Returns the status bar for the main window. This function creates and returns an empty status bar if the status bar does not exist.</p>
 
244
<p>See also <a href="qmainwindow.html#setStatusBar">setStatusBar</a>().</p>
 
245
<h3 class="fn"><a name="toolBarArea"></a><a href="qt.html#ToolBarArea-enum">Qt::ToolBarArea</a> QMainWindow::toolBarArea ( <a href="qtoolbar.html">QToolBar</a> * <i>toolbar</i> ) const</h3>
 
246
<p>Returns the tool bar area for <i>toolbar</i>.</p>
 
247
<p>See also <a href="qmainwindow.html#addToolBar">addToolBar</a>(), <a href="qmainwindow.html#addToolBarBreak">addToolBarBreak</a>(), and <a href="qt.html#ToolBarArea-enum">Qt::ToolBarArea</a>.</p>
 
248
<h3 class="fn"><a name="toolButtonStyleChanged"></a>void QMainWindow::toolButtonStyleChanged ( <a href="qt.html#ToolButtonStyle-enum">Qt::ToolButtonStyle</a> <i>toolButtonStyle</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
249
<p>This signal is emiited when the style used for tool buttons in the window is changed. The new style is passed in <i>toolButtonStyle</i>.</p>
 
250
<p>You can connect this signal to other components to help maintain a consistent appearance for your application.</p>
 
251
<p>See also <a href="qmainwindow.html#toolButtonStyle-prop">setToolButtonStyle</a>().</p>
 
252
<p /><address><hr /><div align="center">
 
253
<table width="100%" cellspacing="0" border="0"><tr class="address">
 
254
<td width="30%">Copyright &copy; 2005 <a href="trolltech.html">Trolltech</a></td>
 
255
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
 
256
<td width="30%" align="right"><div align="right">Qt 4.0.0</div></td>
 
257
</tr></table></div></address></body>
 
258
</html>