Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > ff187cb994c94c614ecc64c5a8528b1b > files > 5697

qt-doc-4.8.5-10.fc18.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qmainwindow.cpp -->
  <title>Qt 4.8: QMainWindow Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->

<script src="scripts/superfish.js" type="text/javascript"></script>
<script src="scripts/narrow.js" type="text/javascript"></script>

</head>
<body class="" onload="CheckEmptyAndLoadList();">
 <div class="header" id="qtdocheader">
    <div class="content"> 
    <div id="nav-logo">
      <a href="index.html">Home</a></div>
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
    <div id="narrowsearch"></div>
    <div id="nav-topright">
      <ul>
        <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
        <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
        <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
          DOC</a></li>
        <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
      </ul>
    </div>
    <div id="shortCut">
      <ul>
        <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
        <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS        </a></li>
      </ul>
     </div>
 <ul class="sf-menu" id="narrowmenu"> 
             <li><a href="#">API Lookup</a> 
                 <ul> 
                     <li><a href="classes.html">Class index</a></li> 
           <li><a href="functions.html">Function index</a></li> 
           <li><a href="modules.html">Modules</a></li> 
           <li><a href="namespaces.html">Namespaces</a></li> 
           <li><a href="qtglobal.html">Global Declarations</a></li> 
           <li><a href="qdeclarativeelements.html">QML elements</a></li> 
             </ul> 
             </li> 
             <li><a href="#">Qt Topics</a> 
                 <ul> 
                        <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>  
                        <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>  
                        <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>  
                        <li><a href="supported-platforms.html">Supported Platforms</a></li>  
                        <li><a href="technology-apis.html">Qt and Key Technologies</a></li>  
                        <li><a href="best-practices.html">How-To's and Best Practices</a></li>  
              </ul> 
                 </li> 
                 <li><a href="#">Examples</a> 
                     <ul> 
                       <li><a href="all-examples.html">Examples</a></li> 
                       <li><a href="tutorials.html">Tutorials</a></li> 
                       <li><a href="demos.html">Demos</a></li> 
                       <li><a href="qdeclarativeexamples.html">QML Examples</a></li> 
                </ul> 
                     </li> 
                 </ul> 
    </div>
  </div>
  <div class="wrapper">
    <div class="hd">
      <span></span>
    </div>
    <div class="bd group">
      <div class="sidebar">
        <div class="searchlabel">
          Search index:</div>
        <div class="search" id="sidebarsearch">
          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />
 <div id="resultdialog"> 
 <a href="#" id="resultclose">Close</a> 
 <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> 
 <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> 
 <ul id="resultlist" class="all"> 
 </ul> 
 </div> 
            </fieldset>
          </form>
        </div>
        <div class="box first bottombar" id="lookup">
          <h2 title="API Lookup"><span></span>
            API Lookup</h2>
          <div  id="list001" class="list">
          <ul id="ul001" >
              <li class="defaultLink"><a href="classes.html">Class index</a></li>
              <li class="defaultLink"><a href="functions.html">Function index</a></li>
              <li class="defaultLink"><a href="modules.html">Modules</a></li>
              <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
              <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
              <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
            </ul> 
          </div>
        </div>
        <div class="box bottombar" id="topics">
          <h2 title="Qt Topics"><span></span>
            Qt Topics</h2>
          <div id="list002" class="list">
            <ul id="ul002" >
               <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> 
               <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> 
               <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> 
               <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>  
               <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> 
               <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> 
            </ul>  
          </div>
        </div>
        <div class="box" id="examples">
          <h2 title="Examples"><span></span>
            Examples</h2>
          <div id="list003" class="list">
        <ul id="ul003">
              <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
              <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
              <li class="defaultLink"><a href="demos.html">Demos</a></li>
              <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
            </ul> 
          </div>
        </div>
      </div>
      <div class="wrap">
        <div class="toolbar">
          <div class="breadcrumb toolblock">
            <ul>
              <li class="first"><a href="index.html">Home</a></li>
              <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtgui.html">QtGui</a></li>
<li>QMainWindow</li>
            </ul>
          </div>
          <div class="toolbuttons toolblock">
            <ul>
              <li id="smallA" class="t_button">A</li>
              <li id="medA" class="t_button active">A</li>
              <li id="bigA" class="t_button">A</li>
              <li id="print" class="t_button"><a href="javascript:this.print();">
                <span>Print</span></a></li>
            </ul>
        </div>
        </div>
        <div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#public-slots">Public Slots</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#qt-main-window-framework">Qt Main Window Framework</a></li>
<li class="level2"><a href="#creating-main-window-components">Creating Main Window Components</a></li>
<li class="level3"><a href="#creating-menus">Creating Menus</a></li>
<li class="level3"><a href="#creating-toolbars">Creating Toolbars</a></li>
<li class="level3"><a href="#creating-dock-widgets">Creating Dock Widgets</a></li>
<li class="level3"><a href="#the-status-bar">The Status Bar</a></li>
<li class="level2"><a href="#storing-state">Storing State</a></li>
</ul>
</div>
<h1 class="title">QMainWindow Class Reference</h1>
<!-- $$$QMainWindow-brief -->
<p>The QMainWindow class provides a main application window. <a href="#details">More...</a></p>
<!-- @@@QMainWindow -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QMainWindow&gt;</span></pre><p><b>Inherits: </b><a href="qwidget.html">QWidget</a>.</p>
<ul>
<li><a href="qmainwindow-members.html">List of all members, including inherited members</a></li>
<li><a href="qmainwindow-qt3.html">Qt 3 support members</a></li>
</ul>
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#DockOption-enum">DockOption</a></b> { AnimatedDocks, AllowNestedDocks, AllowTabbedDocks, ForceTabbedDocks, VerticalTabs }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> flags </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#DockOption-enum">DockOptions</a></b></td></tr>
</table>
<a name="properties"></a>
<h2>Properties</h2>
<table class="propsummary">
<tr><td class="topAlign"><ul>
<li class="fn"><b><a href="qmainwindow.html#animated-prop">animated</a></b> : bool</li>
<li class="fn"><b><a href="qmainwindow.html#dockNestingEnabled-prop">dockNestingEnabled</a></b> : bool</li>
<li class="fn"><b><a href="qmainwindow.html#dockOptions-prop">dockOptions</a></b> : DockOptions</li>
<li class="fn"><b><a href="qmainwindow.html#documentMode-prop">documentMode</a></b> : bool</li>
</ul></td><td class="topAlign"><ul>
<li class="fn"><b><a href="qmainwindow.html#iconSize-prop">iconSize</a></b> : QSize</li>
<li class="fn"><b><a href="qmainwindow.html#tabShape-prop">tabShape</a></b> : QTabWidget::TabShape</li>
<li class="fn"><b><a href="qmainwindow.html#toolButtonStyle-prop">toolButtonStyle</a></b> : Qt::ToolButtonStyle</li>
<li class="fn"><b><a href="qmainwindow.html#unifiedTitleAndToolBarOnMac-prop">unifiedTitleAndToolBarOnMac</a></b> : bool</li>
</ul>
</td></tr>
</table>
<ul>
<li class="fn">58 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
<li class="fn">1 property inherited from <a href="qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#QMainWindow">QMainWindow</a></b> ( QWidget * <i>parent</i> = 0, Qt::WindowFlags <i>flags</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#dtor.QMainWindow">~QMainWindow</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#addDockWidget">addDockWidget</a></b> ( Qt::DockWidgetArea <i>area</i>, QDockWidget * <i>dockwidget</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#addDockWidget-2">addDockWidget</a></b> ( Qt::DockWidgetArea <i>area</i>, QDockWidget * <i>dockwidget</i>, Qt::Orientation <i>orientation</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#addToolBar">addToolBar</a></b> ( Qt::ToolBarArea <i>area</i>, QToolBar * <i>toolbar</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#addToolBar-2">addToolBar</a></b> ( QToolBar * <i>toolbar</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QToolBar * </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#addToolBar-3">addToolBar</a></b> ( const QString &amp; <i>title</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#addToolBarBreak">addToolBarBreak</a></b> ( Qt::ToolBarArea <i>area</i> = Qt::TopToolBarArea )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QWidget * </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#centralWidget">centralWidget</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::DockWidgetArea </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#corner">corner</a></b> ( Qt::Corner <i>corner</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QMenu * </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#createPopupMenu">createPopupMenu</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> DockOptions </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#dockOptions-prop">dockOptions</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::DockWidgetArea </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#dockWidgetArea">dockWidgetArea</a></b> ( QDockWidget * <i>dockwidget</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#documentMode-prop">documentMode</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QSize </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#iconSize-prop">iconSize</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#insertToolBar">insertToolBar</a></b> ( QToolBar * <i>before</i>, QToolBar * <i>toolbar</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#insertToolBarBreak">insertToolBarBreak</a></b> ( QToolBar * <i>before</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#animated-prop">isAnimated</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#dockNestingEnabled-prop">isDockNestingEnabled</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QMenuBar * </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#menuBar">menuBar</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QWidget * </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#menuWidget">menuWidget</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#removeDockWidget">removeDockWidget</a></b> ( QDockWidget * <i>dockwidget</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#removeToolBar">removeToolBar</a></b> ( QToolBar * <i>toolbar</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#removeToolBarBreak">removeToolBarBreak</a></b> ( QToolBar * <i>before</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#restoreDockWidget">restoreDockWidget</a></b> ( QDockWidget * <i>dockwidget</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#restoreState">restoreState</a></b> ( const QByteArray &amp; <i>state</i>, int <i>version</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#saveState">saveState</a></b> ( int <i>version</i> = 0 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#setCentralWidget">setCentralWidget</a></b> ( QWidget * <i>widget</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#setCorner">setCorner</a></b> ( Qt::Corner <i>corner</i>, Qt::DockWidgetArea <i>area</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#dockOptions-prop">setDockOptions</a></b> ( DockOptions <i>options</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#documentMode-prop">setDocumentMode</a></b> ( bool <i>enabled</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#iconSize-prop">setIconSize</a></b> ( const QSize &amp; <i>iconSize</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#setMenuBar">setMenuBar</a></b> ( QMenuBar * <i>menuBar</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#setMenuWidget">setMenuWidget</a></b> ( QWidget * <i>menuBar</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#setStatusBar">setStatusBar</a></b> ( QStatusBar * <i>statusbar</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#setTabPosition">setTabPosition</a></b> ( Qt::DockWidgetAreas <i>areas</i>, QTabWidget::TabPosition <i>tabPosition</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#tabShape-prop">setTabShape</a></b> ( QTabWidget::TabShape <i>tabShape</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#toolButtonStyle-prop">setToolButtonStyle</a></b> ( Qt::ToolButtonStyle <i>toolButtonStyle</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#unifiedTitleAndToolBarOnMac-prop">setUnifiedTitleAndToolBarOnMac</a></b> ( bool <i>set</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#splitDockWidget">splitDockWidget</a></b> ( QDockWidget * <i>first</i>, QDockWidget * <i>second</i>, Qt::Orientation <i>orientation</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QStatusBar * </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#statusBar">statusBar</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTabWidget::TabPosition </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#tabPosition">tabPosition</a></b> ( Qt::DockWidgetArea <i>area</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTabWidget::TabShape </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#tabShape-prop">tabShape</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QDockWidget *&gt; </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#tabifiedDockWidgets">tabifiedDockWidgets</a></b> ( QDockWidget * <i>dockwidget</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#tabifyDockWidget">tabifyDockWidget</a></b> ( QDockWidget * <i>first</i>, QDockWidget * <i>second</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::ToolBarArea </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#toolBarArea">toolBarArea</a></b> ( QToolBar * <i>toolbar</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#toolBarBreak">toolBarBreak</a></b> ( QToolBar * <i>toolbar</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::ToolButtonStyle </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#toolButtonStyle-prop">toolButtonStyle</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#unifiedTitleAndToolBarOnMac-prop">unifiedTitleAndToolBarOnMac</a></b> () const</td></tr>
</table>
<ul>
<li class="fn">221 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
<li class="fn">29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
<li class="fn">13 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
</ul>
<a name="public-slots"></a>
<h2>Public Slots</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#animated-prop">setAnimated</a></b> ( bool <i>enabled</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#dockNestingEnabled-prop">setDockNestingEnabled</a></b> ( bool <i>enabled</i> )</td></tr>
</table>
<ul>
<li class="fn">19 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
<li class="fn">1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
</ul>
<a name="signals"></a>
<h2>Signals</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#iconSizeChanged">iconSizeChanged</a></b> ( const QSize &amp; <i>iconSize</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#toolButtonStyleChanged">toolButtonStyleChanged</a></b> ( Qt::ToolButtonStyle <i>toolButtonStyle</i> )</td></tr>
</table>
<ul>
<li class="fn">1 signal inherited from <a href="qwidget.html#signals">QWidget</a></li>
<li class="fn">1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
</ul>
<a name="reimplemented-protected-functions"></a>
<h2>Reimplemented Protected Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#contextMenuEvent">contextMenuEvent</a></b> ( QContextMenuEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qmainwindow.html#event">event</a></b> ( QEvent * <i>event</i> )</td></tr>
</table>
<ul>
<li class="fn">37 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
<li class="fn">1 protected function inherited from <a href="qpaintdevice.html#protected-functions">QPaintDevice</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">4 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
<li class="fn">7 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
<li class="fn">37 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
<li class="fn">1 protected function inherited from <a href="qpaintdevice.html#protected-functions">QPaintDevice</a></li>
<li class="fn">1 protected slot inherited from <a href="qwidget.html#protected-slots">QWidget</a></li>
</ul>
<a name="details"></a>
<!-- $$$QMainWindow-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QMainWindow class provides a main application window.</p>
<a name="qt-main-window-framework"></a>
<h3>Qt Main Window Framework</h3>
<p>A main window provides a framework for building an application's user interface. Qt has QMainWindow and its <a href="mainwindow-classes.html">related classes</a> for main window management. QMainWindow has its own layout to which you can add <a href="qtoolbar.html">QToolBar</a>s, <a href="qdockwidget.html">QDockWidget</a>s, a <a href="qmenubar.html">QMenuBar</a>, and a <a href="qstatusbar.html">QStatusBar</a>. The layout has a center area that can be occupied by any kind of widget. You can see an image of the layout below.</p>
<p class="centerAlign"><img src="images/mainwindowlayout.png" alt="" /></p><p><b>Note:</b> Creating a main window without a central widget is not supported. You must have a central widget even if it is just a placeholder.</p>
<a name="creating-main-window-components"></a>
<h3>Creating Main Window Components</h3>
<p>A central widget will typically be a standard Qt widget such as a <a href="qtextedit.html">QTextEdit</a> or a <a href="qgraphicsview.html">QGraphicsView</a>. Custom widgets can also be used for advanced applications. You set the central widget with <tt>setCentralWidget()</tt>.</p>
<p>Main windows have either a single (SDI) or multiple (MDI) document interface. You create MDI applications in Qt by using a <a href="qmdiarea.html">QMdiArea</a> as the central widget.</p>
<p>We will now examine each of the other widgets that can be added to a main window. We give examples on how to create and add them.</p>
<a name="creating-menus"></a>
<h4>Creating Menus</h4>
<p>Qt implements menus in <a href="qmenu.html">QMenu</a> and QMainWindow keeps them in a <a href="qmenubar.html">QMenuBar</a>. <a href="qaction.html">QAction</a>s are added to the menus, which display them as menu items.</p>
<p>You can add new menus to the main window's menu bar by calling <tt>menuBar()</tt>, which returns the <a href="qmenubar.html">QMenuBar</a> for the window, and then add a menu with <a href="qmenubar.html#addMenu">QMenuBar::addMenu</a>().</p>
<p>QMainWindow comes with a default menu bar, but you can also set one yourself with <tt>setMenuBar()</tt>. If you wish to implement a custom menu bar (i.e&#x2e;, not use the <a href="qmenubar.html">QMenuBar</a> widget), you can set it with <tt>setMenuWidget()</tt>.</p>
<p>An example of how to create menus follows:</p>
<pre class="cpp"> <span class="type">void</span> MainWindow<span class="operator">::</span>createMenus()
 {
     fileMenu <span class="operator">=</span> menuBar()<span class="operator">-</span><span class="operator">&gt;</span>addMenu(tr(<span class="string">&quot;&amp;File&quot;</span>));
     fileMenu<span class="operator">-</span><span class="operator">&gt;</span>addAction(newAct);
     fileMenu<span class="operator">-</span><span class="operator">&gt;</span>addAction(openAct);
     fileMenu<span class="operator">-</span><span class="operator">&gt;</span>addAction(saveAct);</pre>
<p>The <tt>createPopupMenu()</tt> function creates popup menus when the main window receives context menu events. The default implementation generates a menu with the checkable actions from the dock widgets and toolbars. You can reimplement <tt>createPopupMenu()</tt> for a custom menu.</p>
<a name="creating-toolbars"></a>
<h4>Creating Toolbars</h4>
<p>Toolbars are implemented in the <a href="qtoolbar.html">QToolBar</a> class. You add a toolbar to a main window with <tt>addToolBar()</tt>.</p>
<p>You control the initial position of toolbars by assigning them to a specific <a href="qt.html#ToolBarArea-enum">Qt::ToolBarArea</a>. You can split an area by inserting a toolbar break - think of this as a line break in text editing - with <tt>addToolBarBreak()</tt> or <tt>insertToolBarBreak()</tt>. You can also restrict placement by the user with <a href="qtoolbar.html#allowedAreas-prop">QToolBar::setAllowedAreas</a>() and <a href="qtoolbar.html#movable-prop">QToolBar::setMovable</a>().</p>
<p>The size of toolbar icons can be retrieved with <tt>iconSize()</tt>. The sizes are platform dependent; you can set a fixed size with <tt>setIconSize()</tt>. You can alter the appearance of all tool buttons in the toolbars with <tt>setToolButtonStyle()</tt>.</p>
<p>An example of toolbar creation follows:</p>
<pre class="cpp"> <span class="type">void</span> MainWindow<span class="operator">::</span>createToolBars()
 {
     fileToolBar <span class="operator">=</span> addToolBar(tr(<span class="string">&quot;File&quot;</span>));
     fileToolBar<span class="operator">-</span><span class="operator">&gt;</span>addAction(newAct);</pre>
<a name="creating-dock-widgets"></a>
<h4>Creating Dock Widgets</h4>
<p>Dock widgets are implemented in the <a href="qdockwidget.html">QDockWidget</a> class. A dock widget is a window that can be docked into the main window. You add dock widgets to a main window with <tt>addDockWidget()</tt>.</p>
<p>There are four dock widget areas as given by the <a href="qt.html#DockWidgetArea-enum">Qt::DockWidgetArea</a> enum: left, right, top, and bottom. You can specify which dock widget area that should occupy the corners where the areas overlap with <tt>setCorner()</tt>. By default each area can only contain one row (vertical or horizontal) of dock widgets, but if you enable nesting with <tt>setDockNestingEnabled()</tt>, dock widgets can be added in either direction.</p>
<p>Two dock widgets may also be stacked on top of each other. A <a href="qtabbar.html">QTabBar</a> is then used to select which of the widgets that should be displayed.</p>
<p>We give an example of how to create and add dock widgets to a main window:</p>
<pre class="cpp">     <span class="type"><a href="qdockwidget.html">QDockWidget</a></span> <span class="operator">*</span>dockWidget <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qdockwidget.html">QDockWidget</a></span>(tr(<span class="string">&quot;Dock Widget&quot;</span>)<span class="operator">,</span> <span class="keyword">this</span>);
     dockWidget<span class="operator">-</span><span class="operator">&gt;</span>setAllowedAreas(<span class="type"><a href="qt.html">Qt</a></span><span class="operator">::</span>LeftDockWidgetArea <span class="operator">|</span>
                                 <span class="type"><a href="qt.html">Qt</a></span><span class="operator">::</span>RightDockWidgetArea);
     dockWidget<span class="operator">-</span><span class="operator">&gt;</span>setWidget(dockWidgetContents);
     addDockWidget(<span class="type"><a href="qt.html">Qt</a></span><span class="operator">::</span>LeftDockWidgetArea<span class="operator">,</span> dockWidget);</pre>
<a name="the-status-bar"></a>
<h4>The Status Bar</h4>
<p>You can set a status bar with <tt>setStatusBar()</tt>, but one is created the first time <tt>statusBar()</tt> (which returns the main window's status bar) is called. See <a href="qstatusbar.html">QStatusBar</a> for information on how to use it.</p>
<a name="storing-state"></a>
<h3>Storing State</h3>
<p>QMainWindow can store the state of its layout with <tt>saveState()</tt>; it can later be retrieved with <tt>restoreState()</tt>. It is the position and size (relative to the size of the main window) of the toolbars and dock widgets that are stored.</p>
</div>
<p><b>See also </b><a href="qmenubar.html">QMenuBar</a>, <a href="qtoolbar.html">QToolBar</a>, <a href="qstatusbar.html">QStatusBar</a>, <a href="qdockwidget.html">QDockWidget</a>, <a href="mainwindows-application.html">Application Example</a>, <a href="mainwindows-dockwidgets.html">Dock Widgets Example</a>, <a href="mainwindows-mdi.html">MDI Example</a>, <a href="mainwindows-sdi.html">SDI Example</a>, and <a href="mainwindows-menus.html">Menus Example</a>.</p>
<!-- @@@QMainWindow -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$DockOption$$$AnimatedDocks$$$AllowNestedDocks$$$AllowTabbedDocks$$$ForceTabbedDocks$$$VerticalTabs -->
<h3 class="flags"><a name="DockOption-enum"></a>enum QMainWindow::<span class="name">DockOption</span><br/>flags QMainWindow::<span class="name">DockOptions</span></h3>
<p>This enum contains flags that specify the docking behavior of <a href="qmainwindow.html">QMainWindow</a>.</p>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QMainWindow::AnimatedDocks</tt></td><td class="topAlign"><tt>0x01</tt></td><td class="topAlign">Identical to the <a href="qmainwindow.html#animated-prop">animated</a> property.</td></tr>
<tr><td class="topAlign"><tt>QMainWindow::AllowNestedDocks</tt></td><td class="topAlign"><tt>0x02</tt></td><td class="topAlign">Identical to the <a href="qmainwindow.html#dockNestingEnabled-prop">dockNestingEnabled</a> property.</td></tr>
<tr><td class="topAlign"><tt>QMainWindow::AllowTabbedDocks</tt></td><td class="topAlign"><tt>0x04</tt></td><td class="topAlign">The user can drop one dock widget &quot;on top&quot; of another. The two widgets are stacked and a tab bar appears for selecting which one is visible.</td></tr>
<tr><td class="topAlign"><tt>QMainWindow::ForceTabbedDocks</tt></td><td class="topAlign"><tt>0x08</tt></td><td class="topAlign">Each dock area contains a single stack of tabbed dock widgets. In other words, dock widgets cannot be placed next to each other in a dock area. If this option is set, AllowNestedDocks has no effect.</td></tr>
<tr><td class="topAlign"><tt>QMainWindow::VerticalTabs</tt></td><td class="topAlign"><tt>0x10</tt></td><td class="topAlign">The two vertical dock areas on the sides of the main window show their tabs vertically. If this option is not set, all dock areas show their tabs at the bottom. Implies AllowTabbedDocks. See also <a href="qmainwindow.html#setTabPosition">setTabPosition</a>().</td></tr>
</table>
<p>These options only control how dock widgets may be dropped in a <a href="qmainwindow.html">QMainWindow</a>. They do not re-arrange the dock widgets to conform with the specified options. For this reason they should be set before any dock widgets are added to the main window. Exceptions to this are the AnimatedDocks and VerticalTabs options, which may be set at any time.</p>
<p>This enum was introduced or modified in Qt 4.3.</p>
<p>The DockOptions type is a typedef for <a href="qflags.html">QFlags</a>&lt;DockOption&gt;. It stores an OR combination of DockOption values.</p>
<!-- @@@DockOption -->
</div>
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$animated-prop$$$isAnimated$$$setAnimatedbool -->
<h3 class="fn"><a name="animated-prop"></a><span class="name">animated</span> : <span class="type">bool</span></h3>
<p>This property holds whether manipulating dock widgets and tool bars is animated.</p>
<p>When a dock widget or tool bar is dragged over the main window, the main window adjusts its contents to indicate where the dock widget or tool bar will be docked if it is dropped. Setting this property causes <a href="qmainwindow.html">QMainWindow</a> to move its contents in a smooth animation. Clearing this property causes the contents to snap into their new positions.</p>
<p>By default, this property is set. It may be cleared if the main window contains widgets which are slow at resizing or repainting themselves.</p>
<p>Setting this property is identical to setting the <a href="qmainwindow.html#DockOption-enum">AnimatedDocks</a> option using <a href="qmainwindow.html#dockOptions-prop">setDockOptions</a>().</p>
<p>This property was introduced in Qt 4.2.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>isAnimated</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setAnimated</b></span> ( bool <i>enabled</i> )</td></tr>
</table>
<!-- @@@animated -->
<!-- $$$dockNestingEnabled-prop$$$isDockNestingEnabled$$$setDockNestingEnabledbool -->
<h3 class="fn"><a name="dockNestingEnabled-prop"></a><span class="name">dockNestingEnabled</span> : <span class="type">bool</span></h3>
<p>This property holds whether docks can be nested.</p>
<p>If this property is false, dock areas can only contain a single row (horizontal or vertical) of dock widgets. If this property is true, the area occupied by a dock widget can be split in either direction to contain more dock widgets.</p>
<p>Dock nesting is only necessary in applications that contain a lot of dock widgets. It gives the user greater freedom in organizing their main window. However, dock nesting leads to more complex (and less intuitive) behavior when a dock widget is dragged over the main window, since there are more ways in which a dropped dock widget may be placed in the dock area.</p>
<p>Setting this property is identical to setting the <a href="qmainwindow.html#DockOption-enum">AllowNestedDocks</a> option using <a href="qmainwindow.html#dockOptions-prop">setDockOptions</a>().</p>
<p>This property was introduced in Qt 4.2.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>isDockNestingEnabled</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setDockNestingEnabled</b></span> ( bool <i>enabled</i> )</td></tr>
</table>
<!-- @@@dockNestingEnabled -->
<!-- $$$dockOptions-prop$$$dockOptions$$$setDockOptionsDockOptions -->
<h3 class="fn"><a name="dockOptions-prop"></a><span class="name">dockOptions</span> : <span class="type"><a href="qmainwindow.html#DockOption-enum">DockOptions</a></span></h3>
<p>This property holds the docking behavior of QMainWindow.</p>
<p>The default value is <a href="qmainwindow.html#DockOption-enum">AnimatedDocks</a> | <a href="qmainwindow.html#DockOption-enum">AllowTabbedDocks</a>.</p>
<p>This property was introduced in Qt 4.3.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> DockOptions </td><td class="memItemRight bottomAlign"><span class="name"><b>dockOptions</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setDockOptions</b></span> ( DockOptions <i>options</i> )</td></tr>
</table>
<!-- @@@dockOptions -->
<!-- $$$documentMode-prop$$$documentMode$$$setDocumentModebool -->
<h3 class="fn"><a name="documentMode-prop"></a><span class="name">documentMode</span> : <span class="type">bool</span></h3>
<p>This property holds whether the tab bar for tabbed dockwidgets is set to document mode.</p>
<p>The default is false.</p>
<p>This property was introduced in Qt 4.5.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>documentMode</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setDocumentMode</b></span> ( bool <i>enabled</i> )</td></tr>
</table>
<p><b>See also </b><a href="qtabbar.html#documentMode-prop">QTabBar::documentMode</a>.</p>
<!-- @@@documentMode -->
<!-- $$$iconSize-prop$$$iconSize$$$setIconSizeconstQSize& -->
<h3 class="fn"><a name="iconSize-prop"></a><span class="name">iconSize</span> : <span class="type"><a href="qsize.html">QSize</a></span></h3>
<p>This property holds size of toolbar icons in this mainwindow.</p>
<p>The default is the default tool bar icon size of the GUI style. Note that the icons used must be at least of this size as the icons are only scaled down.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QSize </td><td class="memItemRight bottomAlign"><span class="name"><b>iconSize</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setIconSize</b></span> ( const QSize &amp; <i>iconSize</i> )</td></tr>
</table>
<!-- @@@iconSize -->
<!-- $$$tabShape-prop$$$tabShape$$$setTabShapeQTabWidget::TabShape -->
<h3 class="fn"><a name="tabShape-prop"></a><span class="name">tabShape</span> : <span class="type"><a href="qtabwidget.html#TabShape-enum">QTabWidget::TabShape</a></span></h3>
<p>This property holds the tab shape used for tabbed dock widgets.</p>
<p>The default is <a href="qtabwidget.html#TabShape-enum">QTabWidget::Rounded</a>.</p>
<p>This property was introduced in Qt 4.5.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QTabWidget::TabShape </td><td class="memItemRight bottomAlign"><span class="name"><b>tabShape</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setTabShape</b></span> ( QTabWidget::TabShape <i>tabShape</i> )</td></tr>
</table>
<p><b>See also </b><a href="qmainwindow.html#setTabPosition">setTabPosition</a>().</p>
<!-- @@@tabShape -->
<!-- $$$toolButtonStyle-prop$$$toolButtonStyle$$$setToolButtonStyleQt::ToolButtonStyle -->
<h3 class="fn"><a name="toolButtonStyle-prop"></a><span class="name">toolButtonStyle</span> : <span class="type"><a href="qt.html#ToolButtonStyle-enum">Qt::ToolButtonStyle</a></span></h3>
<p>This property holds style of toolbar buttons in this mainwindow.</p>
<p>The default is <a href="qt.html#ToolButtonStyle-enum">Qt::ToolButtonIconOnly</a>.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> Qt::ToolButtonStyle </td><td class="memItemRight bottomAlign"><span class="name"><b>toolButtonStyle</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setToolButtonStyle</b></span> ( Qt::ToolButtonStyle <i>toolButtonStyle</i> )</td></tr>
</table>
<!-- @@@toolButtonStyle -->
<!-- $$$unifiedTitleAndToolBarOnMac-prop$$$unifiedTitleAndToolBarOnMac$$$setUnifiedTitleAndToolBarOnMacbool -->
<h3 class="fn"><a name="unifiedTitleAndToolBarOnMac-prop"></a><span class="name">unifiedTitleAndToolBarOnMac</span> : <span class="type">bool</span></h3>
<p>This property holds whether the window uses the unified title and toolbar look on Mac OS X.</p>
<p>This property is false by default and only has any effect on Mac OS X 10.4 or higher.</p>
<p>If set to true, then the top toolbar area is replaced with a Carbon HIToolbar or a Cocoa NSToolbar (depending on whether Qt was built with Carbon or Cocoa). All toolbars in the top toolbar area and any toolbars added afterwards are moved to that. This means a couple of things.</p>
<ul>
<li>QToolBars in this toolbar area are not movable and you cannot drag other toolbars to it</li>
<li>Toolbar breaks are not respected or preserved</li>
<li>Any custom widgets in the toolbar will not be shown if the toolbar becomes too small (only actions will be shown)</li>
<li>Before Qt 4.5, if you called <a href="qwidget.html#showFullScreen">showFullScreen</a>() on the main window, the <a href="porting4.html#qtoolbar">QToolbar</a> would disappear since it is considered to be part of the title bar. Qt 4.5 and up will now work around this by pulling the toolbars out and back into the regular toolbar and vice versa when you swap out.</li>
</ul>
<p>Setting this back to false will remove these restrictions.</p>
<p>The <a href="qt.html#WidgetAttribute-enum">Qt::WA_MacBrushedMetal</a> attribute takes precedence over this property.</p>
<p>This property was introduced in Qt 4.3.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>unifiedTitleAndToolBarOnMac</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setUnifiedTitleAndToolBarOnMac</b></span> ( bool <i>set</i> )</td></tr>
</table>
<!-- @@@unifiedTitleAndToolBarOnMac -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QMainWindow[overload1]$$$QMainWindowQWidget*Qt::WindowFlags -->
<h3 class="fn"><a name="QMainWindow"></a>QMainWindow::<span class="name">QMainWindow</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>parent</i> = 0, <span class="type"><a href="qt.html#WindowType-enum">Qt::WindowFlags</a></span> <i>flags</i> = 0 )</h3>
<p>Constructs a <a href="qmainwindow.html">QMainWindow</a> with the given <i>parent</i> and the specified widget <i>flags</i>.</p>
<p><a href="qmainwindow.html">QMainWindow</a> sets the <a href="qt.html#WindowType-enum">Qt::Window</a> flag itself, and will hence always be created as a top-level widget.</p>
<!-- @@@QMainWindow -->
<!-- $$$~QMainWindow[overload1]$$$~QMainWindow -->
<h3 class="fn"><a name="dtor.QMainWindow"></a>QMainWindow::<span class="name">~QMainWindow</span> ()</h3>
<p>Destroys the main window.</p>
<!-- @@@~QMainWindow -->
<!-- $$$addDockWidget[overload1]$$$addDockWidgetQt::DockWidgetAreaQDockWidget* -->
<h3 class="fn"><a name="addDockWidget"></a><span class="type">void</span> QMainWindow::<span class="name">addDockWidget</span> ( <span class="type"><a href="qt.html#DockWidgetArea-enum">Qt::DockWidgetArea</a></span> <i>area</i>, <span class="type"><a href="qdockwidget.html">QDockWidget</a></span> * <i>dockwidget</i> )</h3>
<p>Adds the given <i>dockwidget</i> to the specified <i>area</i>.</p>
<!-- @@@addDockWidget -->
<!-- $$$addDockWidget$$$addDockWidgetQt::DockWidgetAreaQDockWidget*Qt::Orientation -->
<h3 class="fn"><a name="addDockWidget-2"></a><span class="type">void</span> QMainWindow::<span class="name">addDockWidget</span> ( <span class="type"><a href="qt.html#DockWidgetArea-enum">Qt::DockWidgetArea</a></span> <i>area</i>, <span class="type"><a href="qdockwidget.html">QDockWidget</a></span> * <i>dockwidget</i>, <span class="type"><a href="qt.html#Orientation-enum">Qt::Orientation</a></span> <i>orientation</i> )</h3>
<p>Adds <i>dockwidget</i> into the given <i>area</i> in the direction specified by the <i>orientation</i>.</p>
<!-- @@@addDockWidget -->
<!-- $$$addToolBar[overload1]$$$addToolBarQt::ToolBarAreaQToolBar* -->
<h3 class="fn"><a name="addToolBar"></a><span class="type">void</span> QMainWindow::<span class="name">addToolBar</span> ( <span class="type"><a href="qt.html#ToolBarArea-enum">Qt::ToolBarArea</a></span> <i>area</i>, <span class="type"><a href="qtoolbar.html">QToolBar</a></span> * <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&#x2e; line). If the main window already manages <i>toolbar</i> then it will only move the toolbar to <i>area</i>.</p>
<p><b>See also </b><a href="qmainwindow.html#insertToolBar">insertToolBar</a>(), <a href="qmainwindow.html#addToolBarBreak">addToolBarBreak</a>(), and <a href="qmainwindow.html#insertToolBarBreak">insertToolBarBreak</a>().</p>
<!-- @@@addToolBar -->
<!-- $$$addToolBar$$$addToolBarQToolBar* -->
<h3 class="fn"><a name="addToolBar-2"></a><span class="type">void</span> QMainWindow::<span class="name">addToolBar</span> ( <span class="type"><a href="qtoolbar.html">QToolBar</a></span> * <i>toolbar</i> )</h3>
<p>This is an overloaded function.</p>
<p>Equivalent of calling addToolBar(<a href="qt.html#ToolBarArea-enum">Qt::TopToolBarArea</a>, <i>toolbar</i>)</p>
<!-- @@@addToolBar -->
<!-- $$$addToolBar$$$addToolBarconstQString& -->
<h3 class="fn"><a name="addToolBar-3"></a><span class="type"><a href="qtoolbar.html">QToolBar</a></span> * QMainWindow::<span class="name">addToolBar</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>title</i> )</h3>
<p>This is an overloaded function.</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><b>See also </b><a href="qwidget.html#windowTitle-prop">setWindowTitle</a>().</p>
<!-- @@@addToolBar -->
<!-- $$$addToolBarBreak[overload1]$$$addToolBarBreakQt::ToolBarArea -->
<h3 class="fn"><a name="addToolBarBreak"></a><span class="type">void</span> QMainWindow::<span class="name">addToolBarBreak</span> ( <span class="type"><a href="qt.html#ToolBarArea-enum">Qt::ToolBarArea</a></span> <i>area</i> = Qt::TopToolBarArea )</h3>
<p>Adds a toolbar break to the given <i>area</i> after all the other objects that are present.</p>
<!-- @@@addToolBarBreak -->
<!-- $$$centralWidget[overload1]$$$centralWidget -->
<h3 class="fn"><a name="centralWidget"></a><span class="type"><a href="qwidget.html">QWidget</a></span> * QMainWindow::<span class="name">centralWidget</span> () const</h3>
<p>Returns the central widget for the main window. This function returns zero if the central widget has not been set.</p>
<p><b>See also </b><a href="qmainwindow.html#setCentralWidget">setCentralWidget</a>().</p>
<!-- @@@centralWidget -->
<!-- $$$contextMenuEvent[overload1]$$$contextMenuEventQContextMenuEvent* -->
<h3 class="fn"><a name="contextMenuEvent"></a><span class="type">void</span> QMainWindow::<span class="name">contextMenuEvent</span> ( <span class="type"><a href="qcontextmenuevent.html">QContextMenuEvent</a></span> * <i>event</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#contextMenuEvent">QWidget::contextMenuEvent</a>().</p>
<!-- @@@contextMenuEvent -->
<!-- $$$corner[overload1]$$$cornerQt::Corner -->
<h3 class="fn"><a name="corner"></a><span class="type"><a href="qt.html#DockWidgetArea-enum">Qt::DockWidgetArea</a></span> QMainWindow::<span class="name">corner</span> ( <span class="type"><a href="qt.html#Corner-enum">Qt::Corner</a></span> <i>corner</i> ) const</h3>
<p>Returns the dock widget area that occupies the specified <i>corner</i>.</p>
<p><b>See also </b><a href="qmainwindow.html#setCorner">setCorner</a>().</p>
<!-- @@@corner -->
<!-- $$$createPopupMenu[overload1]$$$createPopupMenu -->
<h3 class="fn"><a name="createPopupMenu"></a><span class="type"><a href="qmenu.html">QMenu</a></span> * QMainWindow::<span class="name">createPopupMenu</span> ()<tt> [virtual]</tt></h3>
<p>Returns a popup menu containing checkable entries for the toolbars and dock widgets present in the main window. If there are no toolbars and dock widgets present, this function returns a null pointer.</p>
<p>By default, this function is called by the main window when the user activates a context menu, typically by right-clicking on a toolbar or a dock widget.</p>
<p>If you want to create a custom popup menu, reimplement this function and return a newly-created popup menu. Ownership of the popup menu is transferred to the caller.</p>
<p><b>See also </b><a href="qmainwindow.html#addDockWidget">addDockWidget</a>(), <a href="qmainwindow.html#addToolBar">addToolBar</a>(), and <a href="qmainwindow.html#menuBar">menuBar</a>().</p>
<!-- @@@createPopupMenu -->
<!-- $$$dockWidgetArea[overload1]$$$dockWidgetAreaQDockWidget* -->
<h3 class="fn"><a name="dockWidgetArea"></a><span class="type"><a href="qt.html#DockWidgetArea-enum">Qt::DockWidgetArea</a></span> QMainWindow::<span class="name">dockWidgetArea</span> ( <span class="type"><a href="qdockwidget.html">QDockWidget</a></span> * <i>dockwidget</i> ) const</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 <tt>Qt::NoDockWidgetArea</tt>.</p>
<p><b>See also </b><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>
<!-- @@@dockWidgetArea -->
<!-- $$$event[overload1]$$$eventQEvent* -->
<h3 class="fn"><a name="event"></a><span class="type">bool</span> QMainWindow::<span class="name">event</span> ( <span class="type"><a href="qevent.html">QEvent</a></span> * <i>event</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qobject.html#event">QObject::event</a>().</p>
<!-- @@@event -->
<!-- $$$iconSizeChanged[overload1]$$$iconSizeChangedconstQSize& -->
<h3 class="fn"><a name="iconSizeChanged"></a><span class="type">void</span> QMainWindow::<span class="name">iconSizeChanged</span> ( const <span class="type"><a href="qsize.html">QSize</a></span> &amp; <i>iconSize</i> )<tt> [signal]</tt></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><b>See also </b><a href="qmainwindow.html#iconSize-prop">setIconSize</a>().</p>
<!-- @@@iconSizeChanged -->
<!-- $$$insertToolBar[overload1]$$$insertToolBarQToolBar*QToolBar* -->
<h3 class="fn"><a name="insertToolBar"></a><span class="type">void</span> QMainWindow::<span class="name">insertToolBar</span> ( <span class="type"><a href="qtoolbar.html">QToolBar</a></span> * <i>before</i>, <span class="type"><a href="qtoolbar.html">QToolBar</a></span> * <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><b>See also </b><a href="qmainwindow.html#insertToolBarBreak">insertToolBarBreak</a>(), <a href="qmainwindow.html#addToolBar">addToolBar</a>(), and <a href="qmainwindow.html#addToolBarBreak">addToolBarBreak</a>().</p>
<!-- @@@insertToolBar -->
<!-- $$$insertToolBarBreak[overload1]$$$insertToolBarBreakQToolBar* -->
<h3 class="fn"><a name="insertToolBarBreak"></a><span class="type">void</span> QMainWindow::<span class="name">insertToolBarBreak</span> ( <span class="type"><a href="qtoolbar.html">QToolBar</a></span> * <i>before</i> )</h3>
<p>Inserts a toolbar break before the toolbar specified by <i>before</i>.</p>
<!-- @@@insertToolBarBreak -->
<!-- $$$menuBar[overload1]$$$menuBar -->
<h3 class="fn"><a name="menuBar"></a><span class="type"><a href="qmenubar.html">QMenuBar</a></span> * QMainWindow::<span class="name">menuBar</span> () const</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>If you want all windows in a Mac application to share one menu bar, don't use this function to create it, because the menu bar created here will have this <a href="qmainwindow.html">QMainWindow</a> as its parent. Instead, you must create a menu bar that does not have a parent, which you can then share among all the Mac windows. Create a parent-less menu bar this way:</p>
<pre class="cpp"> <span class="type"><a href="qmenubar.html">QMenuBar</a></span> <span class="operator">*</span>menuBar <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qmenubar.html">QMenuBar</a></span>(<span class="number">0</span>);</pre>
<p><b>See also </b><a href="qmainwindow.html#setMenuBar">setMenuBar</a>().</p>
<!-- @@@menuBar -->
<!-- $$$menuWidget[overload1]$$$menuWidget -->
<h3 class="fn"><a name="menuWidget"></a><span class="type"><a href="qwidget.html">QWidget</a></span> * QMainWindow::<span class="name">menuWidget</span> () const</h3>
<p>Returns the menu bar for the main window. This function returns null if a menu bar hasn't been constructed yet.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qmainwindow.html#setMenuWidget">setMenuWidget</a>().</p>
<!-- @@@menuWidget -->
<!-- $$$removeDockWidget[overload1]$$$removeDockWidgetQDockWidget* -->
<h3 class="fn"><a name="removeDockWidget"></a><span class="type">void</span> QMainWindow::<span class="name">removeDockWidget</span> ( <span class="type"><a href="qdockwidget.html">QDockWidget</a></span> * <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>
<!-- @@@removeDockWidget -->
<!-- $$$removeToolBar[overload1]$$$removeToolBarQToolBar* -->
<h3 class="fn"><a name="removeToolBar"></a><span class="type">void</span> QMainWindow::<span class="name">removeToolBar</span> ( <span class="type"><a href="qtoolbar.html">QToolBar</a></span> * <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>
<!-- @@@removeToolBar -->
<!-- $$$removeToolBarBreak[overload1]$$$removeToolBarBreakQToolBar* -->
<h3 class="fn"><a name="removeToolBarBreak"></a><span class="type">void</span> QMainWindow::<span class="name">removeToolBarBreak</span> ( <span class="type"><a href="qtoolbar.html">QToolBar</a></span> * <i>before</i> )</h3>
<p>Removes a toolbar break previously inserted before the toolbar specified by <i>before</i>.</p>
<!-- @@@removeToolBarBreak -->
<!-- $$$restoreDockWidget[overload1]$$$restoreDockWidgetQDockWidget* -->
<h3 class="fn"><a name="restoreDockWidget"></a><span class="type">bool</span> QMainWindow::<span class="name">restoreDockWidget</span> ( <span class="type"><a href="qdockwidget.html">QDockWidget</a></span> * <i>dockwidget</i> )</h3>
<p>Restores the state of <i>dockwidget</i> if it is created after the call to <a href="qmainwindow.html#restoreState">restoreState</a>(). Returns true if the state was restored; otherwise returns false.</p>
<p><b>See also </b><a href="qmainwindow.html#restoreState">restoreState</a>() and <a href="qmainwindow.html#saveState">saveState</a>().</p>
<!-- @@@restoreDockWidget -->
<!-- $$$restoreState[overload1]$$$restoreStateconstQByteArray&int -->
<h3 class="fn"><a name="restoreState"></a><span class="type">bool</span> QMainWindow::<span class="name">restoreState</span> ( const <span class="type"><a href="qbytearray.html">QByteArray</a></span> &amp; <i>state</i>, <span class="type">int</span> <i>version</i> = 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>To restore geometry saved using <a href="qsettings.html">QSettings</a>, you can use code like this:</p>
<pre class="cpp"> <span class="type">void</span> MainWindow<span class="operator">::</span>readSettings()
 {
     <span class="type"><a href="qsettings.html">QSettings</a></span> settings(<span class="string">&quot;MyCompany&quot;</span><span class="operator">,</span> <span class="string">&quot;MyApp&quot;</span>);
     restoreGeometry(settings<span class="operator">.</span>value(<span class="string">&quot;myWidget/geometry&quot;</span>)<span class="operator">.</span>toByteArray());
     restoreState(settings<span class="operator">.</span>value(<span class="string">&quot;myWidget/windowState&quot;</span>)<span class="operator">.</span>toByteArray());
 }</pre>
<p><b>See also </b><a href="qmainwindow.html#saveState">saveState</a>(), <a href="qwidget.html#saveGeometry">QWidget::saveGeometry</a>(), <a href="qwidget.html#restoreGeometry">QWidget::restoreGeometry</a>(), and <a href="qmainwindow.html#restoreDockWidget">restoreDockWidget</a>().</p>
<!-- @@@restoreState -->
<!-- $$$saveState[overload1]$$$saveStateint -->
<h3 class="fn"><a name="saveState"></a><span class="type"><a href="qbytearray.html">QByteArray</a></span> QMainWindow::<span class="name">saveState</span> ( <span class="type">int</span> <i>version</i> = 0 ) const</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>To save the geometry when the window closes, you can implement a close event like this:</p>
<pre class="cpp"> <span class="type">void</span> MyMainWindow<span class="operator">::</span><a href="qwidget.html#closeEvent">closeEvent</a>(<span class="type"><a href="qcloseevent.html">QCloseEvent</a></span> <span class="operator">*</span>event)
 {
     <span class="type"><a href="qsettings.html">QSettings</a></span> settings(<span class="string">&quot;MyCompany&quot;</span><span class="operator">,</span> <span class="string">&quot;MyApp&quot;</span>);
     settings<span class="operator">.</span>setValue(<span class="string">&quot;geometry&quot;</span><span class="operator">,</span> saveGeometry());
     settings<span class="operator">.</span>setValue(<span class="string">&quot;windowState&quot;</span><span class="operator">,</span> saveState());
     <span class="type"><a href="qmainwindow.html">QMainWindow</a></span><span class="operator">::</span>closeEvent(event);
 }</pre>
<p><b>See also </b><a href="qmainwindow.html#restoreState">restoreState</a>(), <a href="qwidget.html#saveGeometry">QWidget::saveGeometry</a>(), and <a href="qwidget.html#restoreGeometry">QWidget::restoreGeometry</a>().</p>
<!-- @@@saveState -->
<!-- $$$setCentralWidget[overload1]$$$setCentralWidgetQWidget* -->
<h3 class="fn"><a name="setCentralWidget"></a><span class="type">void</span> QMainWindow::<span class="name">setCentralWidget</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>widget</i> )</h3>
<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><b>See also </b><a href="qmainwindow.html#centralWidget">centralWidget</a>().</p>
<!-- @@@setCentralWidget -->
<!-- $$$setCorner[overload1]$$$setCornerQt::CornerQt::DockWidgetArea -->
<h3 class="fn"><a name="setCorner"></a><span class="type">void</span> QMainWindow::<span class="name">setCorner</span> ( <span class="type"><a href="qt.html#Corner-enum">Qt::Corner</a></span> <i>corner</i>, <span class="type"><a href="qt.html#DockWidgetArea-enum">Qt::DockWidgetArea</a></span> <i>area</i> )</h3>
<p>Sets the given dock widget <i>area</i> to occupy the specified <i>corner</i>.</p>
<p><b>See also </b><a href="qmainwindow.html#corner">corner</a>().</p>
<!-- @@@setCorner -->
<!-- $$$setMenuBar[overload1]$$$setMenuBarQMenuBar* -->
<h3 class="fn"><a name="setMenuBar"></a><span class="type">void</span> QMainWindow::<span class="name">setMenuBar</span> ( <span class="type"><a href="qmenubar.html">QMenuBar</a></span> * <i>menuBar</i> )</h3>
<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><b>See also </b><a href="qmainwindow.html#menuBar">menuBar</a>().</p>
<!-- @@@setMenuBar -->
<!-- $$$setMenuWidget[overload1]$$$setMenuWidgetQWidget* -->
<h3 class="fn"><a name="setMenuWidget"></a><span class="type">void</span> QMainWindow::<span class="name">setMenuWidget</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>menuBar</i> )</h3>
<p>Sets the menu bar for the main window to <i>menuBar</i>.</p>
<p><a href="qmainwindow.html">QMainWindow</a> takes ownership of the <i>menuBar</i> pointer and deletes it at the appropriate time.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qmainwindow.html#menuWidget">menuWidget</a>().</p>
<!-- @@@setMenuWidget -->
<!-- $$$setStatusBar[overload1]$$$setStatusBarQStatusBar* -->
<h3 class="fn"><a name="setStatusBar"></a><span class="type">void</span> QMainWindow::<span class="name">setStatusBar</span> ( <span class="type"><a href="qstatusbar.html">QStatusBar</a></span> * <i>statusbar</i> )</h3>
<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><b>See also </b><a href="qmainwindow.html#statusBar">statusBar</a>().</p>
<!-- @@@setStatusBar -->
<!-- $$$setTabPosition[overload1]$$$setTabPositionQt::DockWidgetAreasQTabWidget::TabPosition -->
<h3 class="fn"><a name="setTabPosition"></a><span class="type">void</span> QMainWindow::<span class="name">setTabPosition</span> ( <span class="type"><a href="qt.html#DockWidgetArea-enum">Qt::DockWidgetAreas</a></span> <i>areas</i>, <span class="type"><a href="qtabwidget.html#TabPosition-enum">QTabWidget::TabPosition</a></span> <i>tabPosition</i> )</h3>
<p>Sets the tab position for the given dock widget <i>areas</i> to the specified <i>tabPosition</i>. By default, all dock areas show their tabs at the bottom.</p>
<p><b>Note:</b> The <a href="qmainwindow.html#DockOption-enum">VerticalTabs</a> dock option overrides the tab positions set by this method.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qmainwindow.html#tabPosition">tabPosition</a>() and <a href="qmainwindow.html#tabShape-prop">setTabShape</a>().</p>
<!-- @@@setTabPosition -->
<!-- $$$splitDockWidget[overload1]$$$splitDockWidgetQDockWidget*QDockWidget*Qt::Orientation -->
<h3 class="fn"><a name="splitDockWidget"></a><span class="type">void</span> QMainWindow::<span class="name">splitDockWidget</span> ( <span class="type"><a href="qdockwidget.html">QDockWidget</a></span> * <i>first</i>, <span class="type"><a href="qdockwidget.html">QDockWidget</a></span> * <i>second</i>, <span class="type"><a href="qt.html#Orientation-enum">Qt::Orientation</a></span> <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>: if <i>first</i> is currently in a tabbed docked area, <i>second</i> will be added as a new tab, not as a neighbor of <i>first</i>. This is because a single tab can contain only one dock widget.</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>
<p><b>See also </b><a href="qmainwindow.html#tabifyDockWidget">tabifyDockWidget</a>(), <a href="qmainwindow.html#addDockWidget">addDockWidget</a>(), and <a href="qmainwindow.html#removeDockWidget">removeDockWidget</a>().</p>
<!-- @@@splitDockWidget -->
<!-- $$$statusBar[overload1]$$$statusBar -->
<h3 class="fn"><a name="statusBar"></a><span class="type"><a href="qstatusbar.html">QStatusBar</a></span> * QMainWindow::<span class="name">statusBar</span> () const</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><b>See also </b><a href="qmainwindow.html#setStatusBar">setStatusBar</a>().</p>
<!-- @@@statusBar -->
<!-- $$$tabPosition[overload1]$$$tabPositionQt::DockWidgetArea -->
<h3 class="fn"><a name="tabPosition"></a><span class="type"><a href="qtabwidget.html#TabPosition-enum">QTabWidget::TabPosition</a></span> QMainWindow::<span class="name">tabPosition</span> ( <span class="type"><a href="qt.html#DockWidgetArea-enum">Qt::DockWidgetArea</a></span> <i>area</i> ) const</h3>
<p>Returns the tab position for <i>area</i>.</p>
<p><b>Note:</b> The <a href="qmainwindow.html#DockOption-enum">VerticalTabs</a> dock option overrides the tab positions returned by this function.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qmainwindow.html#setTabPosition">setTabPosition</a>() and <a href="qmainwindow.html#tabShape-prop">tabShape</a>().</p>
<!-- @@@tabPosition -->
<!-- $$$tabifiedDockWidgets[overload1]$$$tabifiedDockWidgetsQDockWidget* -->
<h3 class="fn"><a name="tabifiedDockWidgets"></a><span class="type"><a href="qlist.html">QList</a></span>&lt;<span class="type"><a href="qdockwidget.html">QDockWidget</a></span> *&gt; QMainWindow::<span class="name">tabifiedDockWidgets</span> ( <span class="type"><a href="qdockwidget.html">QDockWidget</a></span> * <i>dockwidget</i> ) const</h3>
<p>Returns the dock widgets that are tabified together with <i>dockwidget</i>.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qmainwindow.html#tabifyDockWidget">tabifyDockWidget</a>().</p>
<!-- @@@tabifiedDockWidgets -->
<!-- $$$tabifyDockWidget[overload1]$$$tabifyDockWidgetQDockWidget*QDockWidget* -->
<h3 class="fn"><a name="tabifyDockWidget"></a><span class="type">void</span> QMainWindow::<span class="name">tabifyDockWidget</span> ( <span class="type"><a href="qdockwidget.html">QDockWidget</a></span> * <i>first</i>, <span class="type"><a href="qdockwidget.html">QDockWidget</a></span> * <i>second</i> )</h3>
<p>Moves <i>second</i> dock widget on top of <i>first</i> dock widget, creating a tabbed docked area in the main window.</p>
<p><b>See also </b><a href="qmainwindow.html#tabifiedDockWidgets">tabifiedDockWidgets</a>().</p>
<!-- @@@tabifyDockWidget -->
<!-- $$$toolBarArea[overload1]$$$toolBarAreaQToolBar* -->
<h3 class="fn"><a name="toolBarArea"></a><span class="type"><a href="qt.html#ToolBarArea-enum">Qt::ToolBarArea</a></span> QMainWindow::<span class="name">toolBarArea</span> ( <span class="type"><a href="qtoolbar.html">QToolBar</a></span> * <i>toolbar</i> ) const</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 <tt>Qt::NoToolBarArea</tt>.</p>
<p><b>See also </b><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>
<!-- @@@toolBarArea -->
<!-- $$$toolBarBreak[overload1]$$$toolBarBreakQToolBar* -->
<h3 class="fn"><a name="toolBarBreak"></a><span class="type">bool</span> QMainWindow::<span class="name">toolBarBreak</span> ( <span class="type"><a href="qtoolbar.html">QToolBar</a></span> * <i>toolbar</i> ) const</h3>
<p>Returns whether there is a toolbar break before the <i>toolbar</i>.</p>
<p><b>See also </b><a href="qmainwindow.html#addToolBarBreak">addToolBarBreak</a>() and <a href="qmainwindow.html#insertToolBarBreak">insertToolBarBreak</a>().</p>
<!-- @@@toolBarBreak -->
<!-- $$$toolButtonStyleChanged[overload1]$$$toolButtonStyleChangedQt::ToolButtonStyle -->
<h3 class="fn"><a name="toolButtonStyleChanged"></a><span class="type">void</span> QMainWindow::<span class="name">toolButtonStyleChanged</span> ( <span class="type"><a href="qt.html#ToolButtonStyle-enum">Qt::ToolButtonStyle</a></span> <i>toolButtonStyle</i> )<tt> [signal]</tt></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><b>See also </b><a href="qmainwindow.html#toolButtonStyle-prop">setToolButtonStyle</a>().</p>
<!-- @@@toolButtonStyleChanged -->
</div>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2013 Digia Plc and/or its
      subsidiaries. Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Digia, Qt and their respective logos are trademarks of Digia Plc 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
  </div>

  <script src="scripts/functions.js" type="text/javascript"></script>
</body>
</html>