File: qmainwindow.html

package info (click to toggle)
python-qt4 4.0.1-5
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 18,632 kB
  • ctags: 2,639
  • sloc: python: 29,409; sh: 5,646; cpp: 3,168; xml: 149; makefile: 109
file content (120 lines) | stat: -rw-r--r-- 28,445 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QMainWindow Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QMainWindow Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QMainWindow class provides a main application window. <a href="#details">More...</a></p>
<p>Inherits <a href="qwidget.html">QWidget</a>.</p><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qmainwindow.html#QMainWindow">__init__</a></b> (<i>self</i>, QWidget&#160;<i>parent</i>&#160;=&#160;None, Qt.WindowFlags&#160;<i>flags</i>&#160;=&#160;0)</li><li><div class="fn" /><b><a href="qmainwindow.html#addDockWidget">addDockWidget</a></b> (<i>self</i>, Qt.DockWidgetArea&#160;<i>area</i>, QDockWidget&#160;<i>dockwidget</i>)</li><li><div class="fn" /><b><a href="qmainwindow.html#addDockWidget-2">addDockWidget</a></b> (<i>self</i>, Qt.DockWidgetArea&#160;<i>area</i>, QDockWidget&#160;<i>dockwidget</i>, Qt.Orientation&#160;<i>orientation</i>)</li><li><div class="fn" /><b><a href="qmainwindow.html#addToolBar">addToolBar</a></b> (<i>self</i>, Qt.ToolBarArea&#160;<i>area</i>, QToolBar&#160;<i>toolbar</i>)</li><li><div class="fn" /><b><a href="qmainwindow.html#addToolBar-2">addToolBar</a></b> (<i>self</i>, QToolBar&#160;<i>toolbar</i>)</li><li><div class="fn" />QToolBar <b><a href="qmainwindow.html#addToolBar-3">addToolBar</a></b> (<i>self</i>, QString&#160;<i>title</i>)</li><li><div class="fn" /><b><a href="qmainwindow.html#addToolBarBreak">addToolBarBreak</a></b> (<i>self</i>, Qt.ToolBarArea&#160;<i>area</i>&#160;=&#160;Qt.TopToolBarArea)</li><li><div class="fn" />QWidget <b><a href="qmainwindow.html#centralWidget">centralWidget</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qmainwindow.html#contextMenuEvent">contextMenuEvent</a></b> (<i>self</i>, QContextMenuEvent&#160;<i>event</i>)</li><li><div class="fn" />Qt.DockWidgetArea <b><a href="qmainwindow.html#corner">corner</a></b> (<i>self</i>, Qt.Corner&#160;<i>corner</i>)</li><li><div class="fn" />QMenu <b><a href="qmainwindow.html#createPopupMenu">createPopupMenu</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.DockWidgetArea <b><a href="qmainwindow.html#dockWidgetArea">dockWidgetArea</a></b> (<i>self</i>, QDockWidget&#160;<i>dockwidget</i>)</li><li><div class="fn" />bool <b><a href="qmainwindow.html#event">event</a></b> (<i>self</i>, QEvent&#160;<i>event</i>)</li><li><div class="fn" />QSize <b><a href="qmainwindow.html#iconSize">iconSize</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qmainwindow.html#insertToolBar">insertToolBar</a></b> (<i>self</i>, QToolBar&#160;<i>before</i>, QToolBar&#160;<i>toolbar</i>)</li><li><div class="fn" /><b><a href="qmainwindow.html#insertToolBarBreak">insertToolBarBreak</a></b> (<i>self</i>, QToolBar&#160;<i>before</i>)</li><li><div class="fn" />QMenuBar <b><a href="qmainwindow.html#menuBar">menuBar</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qmainwindow.html#removeDockWidget">removeDockWidget</a></b> (<i>self</i>, QDockWidget&#160;<i>dockwidget</i>)</li><li><div class="fn" /><b><a href="qmainwindow.html#removeToolBar">removeToolBar</a></b> (<i>self</i>, QToolBar&#160;<i>toolbar</i>)</li><li><div class="fn" />bool <b><a href="qmainwindow.html#restoreState">restoreState</a></b> (<i>self</i>, QByteArray&#160;<i>state</i>, int&#160;<i>version</i>&#160;=&#160;0)</li><li><div class="fn" />QByteArray <b><a href="qmainwindow.html#saveState">saveState</a></b> (<i>self</i>, int&#160;<i>version</i>&#160;=&#160;0)</li><li><div class="fn" /><b><a href="qmainwindow.html#setCentralWidget">setCentralWidget</a></b> (<i>self</i>, QWidget&#160;<i>widget</i>)</li><li><div class="fn" /><b><a href="qmainwindow.html#setCorner">setCorner</a></b> (<i>self</i>, Qt.Corner&#160;<i>corner</i>, Qt.DockWidgetArea&#160;<i>area</i>)</li><li><div class="fn" /><b><a href="qmainwindow.html#setIconSize">setIconSize</a></b> (<i>self</i>, QSize&#160;<i>iconSize</i>)</li><li><div class="fn" /><b><a href="qmainwindow.html#setMenuBar">setMenuBar</a></b> (<i>self</i>, QMenuBar&#160;<i>menubar</i>)</li><li><div class="fn" /><b><a href="qmainwindow.html#setStatusBar">setStatusBar</a></b> (<i>self</i>, QStatusBar&#160;<i>statusbar</i>)</li><li><div class="fn" /><b><a href="qmainwindow.html#setToolButtonStyle">setToolButtonStyle</a></b> (<i>self</i>, Qt.ToolButtonStyle&#160;<i>toolButtonStyle</i>)</li><li><div class="fn" /><b><a href="qmainwindow.html#splitDockWidget">splitDockWidget</a></b> (<i>self</i>, QDockWidget&#160;<i>after</i>, QDockWidget&#160;<i>dockwidget</i>, Qt.Orientation&#160;<i>orientation</i>)</li><li><div class="fn" />QStatusBar <b><a href="qmainwindow.html#statusBar">statusBar</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.ToolBarArea <b><a href="qmainwindow.html#toolBarArea">toolBarArea</a></b> (<i>self</i>, QToolBar&#160;<i>toolbar</i>)</li><li><div class="fn" />Qt.ToolButtonStyle <b><a href="qmainwindow.html#toolButtonStyle">toolButtonStyle</a></b> (<i>self</i>)</li></ul><h3>Qt Signals</h3><ul><li><div class="fn" />void <b><a href="qmainwindow.html#iconSizeChanged">iconSizeChanged</a></b> (const QSize&amp;)</li><li><div class="fn" />void <b><a href="qmainwindow.html#toolButtonStyleChanged">toolButtonStyleChanged</a></b> (Qt::ToolButtonStyle)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QMainWindow class provides a main application window.</p>
<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 <a href="qworkspace.html">QWorkspace</a> (for MDI applications).</p>
<p>Note that QMainWindow comes with its own customized layout and that setting a layout on a QMainWindow, or creating a layout with a QMainWindow as a parent is considered an error. You should set your own layout on the <a href="qmainwindow.html#centralWidget">central widget</a> instead.</p>
<p>Topics:</p>
<ul>
<li><a href="#saving-and-restoring-state">Saving and restoring state</a></li>
<li><a href="#behavior-of-dock-widgets">Behavior of Dock Widgets</a></li>
<li style="list-style: none">
<ul>
<li><a href="#dock-widget-separators">Dock Widget Separators</a></li>
<li><a href="#dragging-dock-widgets">Dragging Dock Widgets</a></li>
<li><a href="#dragging-over-neighbors">Dragging over Neighbors</a></li>
<li><a href="#dragging-over-other-qdockwidgets">Dragging over other QDockWidgets</a></li>
<li><a href="#dragging-to-a-different-qt-dockwidgetarea">Dragging to a Different Qt.DockWidgetArea</a></li>
</ul>
</li>
</ul>
<a id="saving-and-restoring-state" name="saving-and-restoring-state" />
<h3>Saving and restoring state</h3>
<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>
<a id="behavior-of-dock-widgets" name="behavior-of-dock-widgets" />
<h3>Behavior of Dock Widgets</h3>
<a id="dock-widget-separators" name="dock-widget-separators" /><a id="dock-widget-separators" name="dock-widget-separators" />
<h4>Dock Widget Separators</h4>
<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>
<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>
<a id="dragging-dock-widgets" name="dragging-dock-widgets" /><a id="dragging-dock-widgets" name="dragging-dock-widgets" />
<h4>Dragging Dock Widgets</h4>
<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>
<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>
<a id="dragging-over-neighbors" name="dragging-over-neighbors" />
<h4>Dragging over Neighbors</h4>
<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>
<ul>
<li>QMainWindow will split the neighbor perpendicularly to the direction of the QDockWidgets.</li>
<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>
</ul>
<p>The following diagram depicts this behavior:</p>
<p align="center"><img alt="Diagram" src="images/dockwidget-neighbors.png" /></p>
<a id="dragging-over-other-qdockwidgets" name="dragging-over-other-qdockwidgets" />
<h4>Dragging over other QDockWidgets</h4>
<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>
<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>
<p align="center"><img alt="Diagram" src="images/dockwidget-cross.png" /></p>
<a id="dragging-to-a-different-qt-dockwidgetarea" name="dragging-to-a-different-qt-dockwidgetarea" />
<h4>Dragging to a Different Qt.DockWidgetArea</h4>
<p>The QDockWidget.floatable property influences feedback when the user drags a <a href="qdockwidget.html">QDockWidget</a> over the central widget:</p>
<ul>
<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>
<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>
</ul>
<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>
<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>
<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>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QMainWindow" />QMainWindow.__init__ (<i>self</i>, <a href="qwidget.html">QWidget</a>&#160;<i>parent</i>&#160;=&#160;None, <a href="qt-windowflags.html">Qt.WindowFlags</a>&#160;<i>flags</i>&#160;=&#160;0)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a <a href="qmainwindow.html">QMainWindow</a> with the given <i>parent</i> and the specified widget <i>flags</i>.</p>
<h3 class="fn"><a name="addDockWidget" />QMainWindow.addDockWidget (<i>self</i>, <a href="qt.html#DockWidgetArea-enum">Qt.DockWidgetArea</a>&#160;<i>area</i>, <a href="qdockwidget.html">QDockWidget</a>&#160;<i>dockwidget</i>)</h3><p>Adds the given <i>dockwidget</i> to the specified <i>area</i>.</p>
<h3 class="fn"><a name="addDockWidget-2" />QMainWindow.addDockWidget (<i>self</i>, <a href="qt.html#DockWidgetArea-enum">Qt.DockWidgetArea</a>&#160;<i>area</i>, <a href="qdockwidget.html">QDockWidget</a>&#160;<i>dockwidget</i>, <a href="qt.html#Orientation-enum">Qt.Orientation</a>&#160;<i>orientation</i>)</h3><p>This is an overloaded member function, provided for convenience.</p>
<p>Adds <i>dockwidget</i> into the given <i>area</i> in the direction specified by the <i>orientation</i>.</p>
<h3 class="fn"><a name="addToolBar" />QMainWindow.addToolBar (<i>self</i>, <a href="qt.html#ToolBarArea-enum">Qt.ToolBarArea</a>&#160;<i>area</i>, <a href="qtoolbar.html">QToolBar</a>&#160;<i>toolbar</i>)</h3><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). If the main window already manages <i>toolbar</i> then it will only move the toolbar to <i>area</i>.</p>
<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>
<h3 class="fn"><a name="addToolBar-2" />QMainWindow.addToolBar (<i>self</i>, <a href="qtoolbar.html">QToolBar</a>&#160;<i>toolbar</i>)</h3><p>This is an overloaded member function, provided for convenience.</p>
<p>Equivalent of calling addToolBar(<a href="qt.html#ToolBarArea-enum">Qt.TopToolBarArea</a>, <i>toolbar</i>)</p>
<h3 class="fn"><a name="addToolBar-3" /><a href="qtoolbar.html">QToolBar</a> QMainWindow.addToolBar (<i>self</i>, <a href="qstring.html">QString</a>&#160;<i>title</i>)</h3><p>This is an overloaded member function, provided for convenience.</p>
<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>
<p>See also <a href="qwidget.html#windowTitle-prop">setWindowTitle</a>().</p>
<h3 class="fn"><a name="addToolBarBreak" />QMainWindow.addToolBarBreak (<i>self</i>, <a href="qt.html#ToolBarArea-enum">Qt.ToolBarArea</a>&#160;<i>area</i>&#160;=&#160;Qt.TopToolBarArea)</h3><p>Adds a toolbar break to the given <i>area</i> after all the other objects that are present.</p>
<h3 class="fn"><a name="centralWidget" /><a href="qwidget.html">QWidget</a> QMainWindow.centralWidget (<i>self</i>)</h3><p>Returns the central widget for the main window. This function returns zero if the central widget has not been set.</p>
<p>See also <a href="qmainwindow.html#setCentralWidget">setCentralWidget</a>().</p>
<h3 class="fn"><a name="contextMenuEvent" />QMainWindow.contextMenuEvent (<i>self</i>, <a href="qcontextmenuevent.html">QContextMenuEvent</a>&#160;<i>event</i>)</h3><h3 class="fn"><a name="corner" /><a href="qt.html#DockWidgetArea-enum">Qt.DockWidgetArea</a> QMainWindow.corner (<i>self</i>, <a href="qt.html#Corner-enum">Qt.Corner</a>&#160;<i>corner</i>)</h3><p>Returns the dock widget area that occupies the specified <i>corner</i>.</p>
<p>See also <a href="qmainwindow.html#setCorner">setCorner</a>().</p>
<h3 class="fn"><a name="createPopupMenu" /><a href="qmenu.html">QMenu</a> QMainWindow.createPopupMenu (<i>self</i>)</h3><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>
<h3 class="fn"><a name="dockWidgetArea" /><a href="qt.html#DockWidgetArea-enum">Qt.DockWidgetArea</a> QMainWindow.dockWidgetArea (<i>self</i>, <a href="qdockwidget.html">QDockWidget</a>&#160;<i>dockwidget</i>)</h3><p>Returns the <a href="qt.html#DockWidgetArea-enum">Qt.DockWidgetArea</a> for <i>dockwidget</i>. If <i>dockwidget</i> has not been added to the main window, this function returns zero.</p>
<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>
<h3 class="fn"><a name="event" />bool QMainWindow.event (<i>self</i>, <a href="qevent.html">QEvent</a>&#160;<i>event</i>)</h3><h3 class="fn"><a name="iconSize" /><a href="qsize.html">QSize</a> QMainWindow.iconSize (<i>self</i>)</h3><h3 class="fn"><a name="insertToolBar" />QMainWindow.insertToolBar (<i>self</i>, <a href="qtoolbar.html">QToolBar</a>&#160;<i>before</i>, <a href="qtoolbar.html">QToolBar</a>&#160;<i>toolbar</i>)</h3><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>
<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>
<h3 class="fn"><a name="insertToolBarBreak" />QMainWindow.insertToolBarBreak (<i>self</i>, <a href="qtoolbar.html">QToolBar</a>&#160;<i>before</i>)</h3><p>Inserts a toolbar break before the toolbar specified by <i>before</i>.</p>
<h3 class="fn"><a name="menuBar" /><a href="qmenubar.html">QMenuBar</a> QMainWindow.menuBar (<i>self</i>)</h3><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>
<p>See also <a href="qmainwindow.html#setMenuBar">setMenuBar</a>().</p>
<h3 class="fn"><a name="removeDockWidget" />QMainWindow.removeDockWidget (<i>self</i>, <a href="qdockwidget.html">QDockWidget</a>&#160;<i>dockwidget</i>)</h3><p>Removes the <i>dockwidget</i> from the main window layout and hides it. Note that the <i>dockwidget</i> is <i>not</i> deleted.</p>
<h3 class="fn"><a name="removeToolBar" />QMainWindow.removeToolBar (<i>self</i>, <a href="qtoolbar.html">QToolBar</a>&#160;<i>toolbar</i>)</h3><p>Removes the <i>toolbar</i> from the main window layout and hides it. Note that the <i>toolbar</i> is <i>not</i> deleted.</p>
<h3 class="fn"><a name="restoreState" />bool QMainWindow.restoreState (<i>self</i>, <a href="qbytearray.html">QByteArray</a>&#160;<i>state</i>, int&#160;<i>version</i>&#160;=&#160;0)</h3><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>
<p>See also <a href="qmainwindow.html#saveState">saveState</a>().</p>
<h3 class="fn"><a name="saveState" /><a href="qbytearray.html">QByteArray</a> QMainWindow.saveState (<i>self</i>, int&#160;<i>version</i>&#160;=&#160;0)</h3><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>
<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>
<p>To restore the saved state, pass the return value and <i>version</i> number to <a href="qmainwindow.html#restoreState">restoreState</a>().</p>
<p>See also <a href="qmainwindow.html#restoreState">restoreState</a>().</p>
<h3 class="fn"><a name="setCentralWidget" />QMainWindow.setCentralWidget (<i>self</i>, <a href="qwidget.html">QWidget</a>&#160;<i>widget</i>)</h3><p>The <i>widget</i> argument has it's ownership transferred to Qt.</p><p>Sets the given <i>widget</i> to be the main window's central widget.</p>
<p>Note: <a href="qmainwindow.html">QMainWindow</a> takes ownership of the <i>widget</i> pointer and deletes it at the appropriate time.</p>
<p>See also <a href="qmainwindow.html#centralWidget">centralWidget</a>().</p>
<h3 class="fn"><a name="setCorner" />QMainWindow.setCorner (<i>self</i>, <a href="qt.html#Corner-enum">Qt.Corner</a>&#160;<i>corner</i>, <a href="qt.html#DockWidgetArea-enum">Qt.DockWidgetArea</a>&#160;<i>area</i>)</h3><p>Sets the given dock widget <i>area</i> to occupy the specified <i>corner</i>.</p>
<p>See also <a href="qmainwindow.html#corner">corner</a>().</p>
<h3 class="fn"><a name="setIconSize" />QMainWindow.setIconSize (<i>self</i>, <a href="qsize.html">QSize</a>&#160;<i>iconSize</i>)</h3><h3 class="fn"><a name="setMenuBar" />QMainWindow.setMenuBar (<i>self</i>, <a href="qmenubar.html">QMenuBar</a>&#160;<i>menubar</i>)</h3><p>The <i>menubar</i> argument has it's ownership transferred to Qt.</p><p>Sets the menu bar for the main window to <i>menuBar</i>.</p>
<p>Note: <a href="qmainwindow.html">QMainWindow</a> takes ownership of the <i>menuBar</i> pointer and deletes it at the appropriate time.</p>
<p>See also <a href="qmainwindow.html#menuBar">menuBar</a>().</p>
<h3 class="fn"><a name="setStatusBar" />QMainWindow.setStatusBar (<i>self</i>, <a href="qstatusbar.html">QStatusBar</a>&#160;<i>statusbar</i>)</h3><p>The <i>statusbar</i> argument has it's ownership transferred to Qt.</p><p>Sets the status bar for the main window to <i>statusbar</i>.</p>
<p>Setting the status bar to 0 will remove it from the main window. Note that <a href="qmainwindow.html">QMainWindow</a> takes ownership of the <i>statusbar</i> pointer and deletes it at the appropriate time.</p>
<p>See also <a href="qmainwindow.html#statusBar">statusBar</a>().</p>
<h3 class="fn"><a name="setToolButtonStyle" />QMainWindow.setToolButtonStyle (<i>self</i>, <a href="qt.html#ToolButtonStyle-enum">Qt.ToolButtonStyle</a>&#160;<i>toolButtonStyle</i>)</h3><h3 class="fn"><a name="splitDockWidget" />QMainWindow.splitDockWidget (<i>self</i>, <a href="qdockwidget.html">QDockWidget</a>&#160;<i>after</i>, <a href="qdockwidget.html">QDockWidget</a>&#160;<i>dockwidget</i>, <a href="qt.html#Orientation-enum">Qt.Orientation</a>&#160;<i>orientation</i>)</h3><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>
<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>
<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>
<h3 class="fn"><a name="statusBar" /><a href="qstatusbar.html">QStatusBar</a> QMainWindow.statusBar (<i>self</i>)</h3><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>
<p>See also <a href="qmainwindow.html#setStatusBar">setStatusBar</a>().</p>
<h3 class="fn"><a name="toolBarArea" /><a href="qt.html#ToolBarArea-enum">Qt.ToolBarArea</a> QMainWindow.toolBarArea (<i>self</i>, <a href="qtoolbar.html">QToolBar</a>&#160;<i>toolbar</i>)</h3><p>Returns the <a href="qt.html#ToolBarArea-enum">Qt.ToolBarArea</a> for <i>toolbar</i>. If <i>toolbar</i> has not been added to the main window, this function returns zero.</p>
<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>
<h3 class="fn"><a name="toolButtonStyle" /><a href="qt.html#ToolButtonStyle-enum">Qt.ToolButtonStyle</a> QMainWindow.toolButtonStyle (<i>self</i>)</h3><hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="iconSizeChanged" />void iconSizeChanged (const QSize&amp;)</h3><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>
<p>You can connect this signal to other components to help maintain a consistent appearance for your application.</p>
<p>See also <a href="qmainwindow.html#iconSize-prop">setIconSize</a>().</p>
<h3 class="fn"><a name="toolButtonStyleChanged" />void toolButtonStyleChanged (Qt::ToolButtonStyle)</h3><p>This signal is emitted when the style used for tool buttons in the window is changed. The new style is passed in <i>toolButtonStyle</i>.</p>
<p>You can connect this signal to other components to help maintain a consistent appearance for your application.</p>
<p>See also <a href="qmainwindow.html#toolButtonStyle-prop">setToolButtonStyle</a>().</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td width="25%">PyQt&#160;4.0.1 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.trolltech.com">Trolltech&#160;AS</a> 2006</td><td align="right" width="25%">Qt&#160;4.1.4</td></tr></table></div></address></body></html>