[190] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
---|
| 2 | <!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/widgets/qmainwindow.cpp:506 -->
|
---|
| 3 | <html>
|
---|
| 4 | <head>
|
---|
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
| 6 | <title>QMainWindow Class</title>
|
---|
| 7 | <style type="text/css"><!--
|
---|
| 8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
| 9 | a:link { color: #004faf; text-decoration: none }
|
---|
| 10 | a:visited { color: #672967; text-decoration: none }
|
---|
| 11 | body { background: #ffffff; color: black; }
|
---|
| 12 | --></style>
|
---|
| 13 | </head>
|
---|
| 14 | <body>
|
---|
| 15 |
|
---|
| 16 | <table border="0" cellpadding="0" cellspacing="0" width="100%">
|
---|
| 17 | <tr bgcolor="#E5E5E5">
|
---|
| 18 | <td valign=center>
|
---|
| 19 | <a href="index.html">
|
---|
| 20 | <font color="#004faf">Home</font></a>
|
---|
| 21 | | <a href="classes.html">
|
---|
| 22 | <font color="#004faf">All Classes</font></a>
|
---|
| 23 | | <a href="mainclasses.html">
|
---|
| 24 | <font color="#004faf">Main Classes</font></a>
|
---|
| 25 | | <a href="annotated.html">
|
---|
| 26 | <font color="#004faf">Annotated</font></a>
|
---|
| 27 | | <a href="groups.html">
|
---|
| 28 | <font color="#004faf">Grouped Classes</font></a>
|
---|
| 29 | | <a href="functions.html">
|
---|
| 30 | <font color="#004faf">Functions</font></a>
|
---|
| 31 | </td>
|
---|
| 32 | <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QMainWindow Class Reference</h1>
|
---|
| 33 |
|
---|
| 34 | <p>The QMainWindow class provides a main application window,
|
---|
| 35 | with a menu bar, dock windows (e.g. for toolbars), and a status
|
---|
| 36 | bar.
|
---|
| 37 | <a href="#details">More...</a>
|
---|
| 38 | <p><tt>#include <<a href="qmainwindow-h.html">qmainwindow.h</a>></tt>
|
---|
| 39 | <p>Inherits <a href="qwidget.html">QWidget</a>.
|
---|
| 40 | <p><a href="qmainwindow-members.html">List of all member functions.</a>
|
---|
| 41 | <h2>Public Members</h2>
|
---|
| 42 | <ul>
|
---|
| 43 | <li class=fn><a href="#QMainWindow"><b>QMainWindow</b></a> ( QWidget * parent = 0, const char * name = 0, WFlags f = WType_TopLevel )</li>
|
---|
| 44 | <li class=fn><a href="#~QMainWindow"><b>~QMainWindow</b></a> ()</li>
|
---|
| 45 | <li class=fn>QMenuBar * <a href="#menuBar"><b>menuBar</b></a> () const</li>
|
---|
| 46 | <li class=fn>QStatusBar * <a href="#statusBar"><b>statusBar</b></a> () const</li>
|
---|
| 47 | <li class=fn>QToolTipGroup * <a href="#toolTipGroup"><b>toolTipGroup</b></a> () const</li>
|
---|
| 48 | <li class=fn>virtual void <a href="#setCentralWidget"><b>setCentralWidget</b></a> ( QWidget * w )</li>
|
---|
| 49 | <li class=fn>QWidget * <a href="#centralWidget"><b>centralWidget</b></a> () const</li>
|
---|
| 50 | <li class=fn>virtual void <a href="#setDockEnabled"><b>setDockEnabled</b></a> ( Dock dock, bool enable )</li>
|
---|
| 51 | <li class=fn>bool <a href="#isDockEnabled"><b>isDockEnabled</b></a> ( Dock dock ) const</li>
|
---|
| 52 | <li class=fn>bool <a href="#isDockEnabled-2"><b>isDockEnabled</b></a> ( QDockArea * area ) const</li>
|
---|
| 53 | <li class=fn>virtual void <a href="#setDockEnabled-2"><b>setDockEnabled</b></a> ( QDockWindow * dw, Dock dock, bool enable )</li>
|
---|
| 54 | <li class=fn>bool <a href="#isDockEnabled-3"><b>isDockEnabled</b></a> ( QDockWindow * tb, Dock dock ) const</li>
|
---|
| 55 | <li class=fn>bool <a href="#isDockEnabled-4"><b>isDockEnabled</b></a> ( QDockWindow * dw, QDockArea * area ) const</li>
|
---|
| 56 | <li class=fn>virtual void <a href="#addDockWindow"><b>addDockWindow</b></a> ( QDockWindow * dockWindow, Dock edge = DockTop, bool newLine = FALSE )</li>
|
---|
| 57 | <li class=fn>virtual void <a href="#addDockWindow-2"><b>addDockWindow</b></a> ( QDockWindow * dockWindow, const QString & label, Dock edge = DockTop, bool newLine = FALSE )</li>
|
---|
| 58 | <li class=fn>virtual void <a href="#moveDockWindow"><b>moveDockWindow</b></a> ( QDockWindow * dockWindow, Dock edge = DockTop )</li>
|
---|
| 59 | <li class=fn>virtual void <a href="#moveDockWindow-2"><b>moveDockWindow</b></a> ( QDockWindow * dockWindow, Dock edge, bool nl, int index, int extraOffset = -1 )</li>
|
---|
| 60 | <li class=fn>virtual void <a href="#removeDockWindow"><b>removeDockWindow</b></a> ( QDockWindow * dockWindow )</li>
|
---|
| 61 | <li class=fn>bool rightJustification () const <em>(obsolete)</em></li>
|
---|
| 62 | <li class=fn>bool <a href="#usesBigPixmaps"><b>usesBigPixmaps</b></a> () const</li>
|
---|
| 63 | <li class=fn>bool <a href="#usesTextLabel"><b>usesTextLabel</b></a> () const</li>
|
---|
| 64 | <li class=fn>bool <a href="#dockWindowsMovable"><b>dockWindowsMovable</b></a> () const</li>
|
---|
| 65 | <li class=fn>bool <a href="#opaqueMoving"><b>opaqueMoving</b></a> () const</li>
|
---|
| 66 | <li class=fn>bool <a href="#getLocation"><b>getLocation</b></a> ( QDockWindow * dw, Dock & dock, int & index, bool & nl, int & extraOffset ) const</li>
|
---|
| 67 | <li class=fn>QPtrList<QDockWindow> <a href="#dockWindows"><b>dockWindows</b></a> ( Dock dock ) const</li>
|
---|
| 68 | <li class=fn>QPtrList<QDockWindow> <a href="#dockWindows-2"><b>dockWindows</b></a> () const</li>
|
---|
| 69 | <li class=fn>void <a href="#lineUpDockWindows"><b>lineUpDockWindows</b></a> ( bool keepNewLines = FALSE )</li>
|
---|
| 70 | <li class=fn>bool <a href="#isDockMenuEnabled"><b>isDockMenuEnabled</b></a> () const</li>
|
---|
| 71 | <li class=fn>bool <a href="#hasDockWindow"><b>hasDockWindow</b></a> ( QDockWindow * dw )</li>
|
---|
| 72 | <li class=fn>void addToolBar ( QDockWindow *, Dock = DockTop, bool newLine = FALSE ) <em>(obsolete)</em></li>
|
---|
| 73 | <li class=fn>void addToolBar ( QDockWindow *, const QString & label, Dock = DockTop, bool newLine = FALSE ) <em>(obsolete)</em></li>
|
---|
| 74 | <li class=fn>void moveToolBar ( QDockWindow *, Dock = DockTop ) <em>(obsolete)</em></li>
|
---|
| 75 | <li class=fn>void moveToolBar ( QDockWindow *, Dock, bool nl, int index, int extraOffset = -1 ) <em>(obsolete)</em></li>
|
---|
| 76 | <li class=fn>void removeToolBar ( QDockWindow * ) <em>(obsolete)</em></li>
|
---|
| 77 | <li class=fn>bool toolBarsMovable () const <em>(obsolete)</em></li>
|
---|
| 78 | <li class=fn>QPtrList<QToolBar> <a href="#toolBars"><b>toolBars</b></a> ( Dock dock ) const</li>
|
---|
| 79 | <li class=fn>void lineUpToolBars ( bool keepNewLines = FALSE ) <em>(obsolete)</em></li>
|
---|
| 80 | <li class=fn>QDockArea * <a href="#leftDock"><b>leftDock</b></a> () const</li>
|
---|
| 81 | <li class=fn>QDockArea * <a href="#rightDock"><b>rightDock</b></a> () const</li>
|
---|
| 82 | <li class=fn>QDockArea * <a href="#topDock"><b>topDock</b></a> () const</li>
|
---|
| 83 | <li class=fn>QDockArea * <a href="#bottomDock"><b>bottomDock</b></a> () const</li>
|
---|
| 84 | <li class=fn>virtual bool <a href="#isCustomizable"><b>isCustomizable</b></a> () const</li>
|
---|
| 85 | <li class=fn>bool <a href="#appropriate"><b>appropriate</b></a> ( QDockWindow * dw ) const</li>
|
---|
| 86 | <li class=fn>enum <a href="#DockWindows-enum"><b>DockWindows</b></a> { OnlyToolBars, NoToolBars, AllDockWindows }</li>
|
---|
| 87 | <li class=fn>QPopupMenu * <a href="#createDockWindowMenu"><b>createDockWindowMenu</b></a> ( DockWindows dockWindows = AllDockWindows ) const</li>
|
---|
| 88 | </ul>
|
---|
| 89 | <h2>Public Slots</h2>
|
---|
| 90 | <ul>
|
---|
| 91 | <li class=fn>virtual void setRightJustification ( bool ) <em>(obsolete)</em></li>
|
---|
| 92 | <li class=fn>virtual void <a href="#setUsesBigPixmaps"><b>setUsesBigPixmaps</b></a> ( bool )</li>
|
---|
| 93 | <li class=fn>virtual void <a href="#setUsesTextLabel"><b>setUsesTextLabel</b></a> ( bool )</li>
|
---|
| 94 | <li class=fn>virtual void <a href="#setDockWindowsMovable"><b>setDockWindowsMovable</b></a> ( bool )</li>
|
---|
| 95 | <li class=fn>virtual void <a href="#setOpaqueMoving"><b>setOpaqueMoving</b></a> ( bool )</li>
|
---|
| 96 | <li class=fn>virtual void <a href="#setDockMenuEnabled"><b>setDockMenuEnabled</b></a> ( bool b )</li>
|
---|
| 97 | <li class=fn>virtual void <a href="#whatsThis"><b>whatsThis</b></a> ()</li>
|
---|
| 98 | <li class=fn>virtual void <a href="#setAppropriate"><b>setAppropriate</b></a> ( QDockWindow * dw, bool a )</li>
|
---|
| 99 | <li class=fn>virtual void <a href="#customize"><b>customize</b></a> ()</li>
|
---|
| 100 | <li class=fn>void setToolBarsMovable ( bool ) <em>(obsolete)</em></li>
|
---|
| 101 | </ul>
|
---|
| 102 | <h2>Signals</h2>
|
---|
| 103 | <ul>
|
---|
| 104 | <li class=fn>void <a href="#pixmapSizeChanged"><b>pixmapSizeChanged</b></a> ( bool )</li>
|
---|
| 105 | <li class=fn>void <a href="#usesTextLabelChanged"><b>usesTextLabelChanged</b></a> ( bool )</li>
|
---|
| 106 | <li class=fn>void <a href="#dockWindowPositionChanged"><b>dockWindowPositionChanged</b></a> ( QDockWindow * dockWindow )</li>
|
---|
| 107 | <li class=fn>void toolBarPositionChanged ( QToolBar * ) <em>(obsolete)</em></li>
|
---|
| 108 | </ul>
|
---|
| 109 | <h2>Properties</h2>
|
---|
| 110 | <ul>
|
---|
| 111 | <li class=fn>bool <a href="#dockWindowsMovable-prop"><b>dockWindowsMovable</b></a> - whether the dock windows are movable</li>
|
---|
| 112 | <li class=fn>bool <a href="#opaqueMoving-prop"><b>opaqueMoving</b></a> - whether dock windows are moved opaquely</li>
|
---|
| 113 | <li class=fn>bool rightJustification - whether the main window right-justifies its dock windows <em>(obsolete)</em></li>
|
---|
| 114 | <li class=fn>bool <a href="#usesBigPixmaps-prop"><b>usesBigPixmaps</b></a> - whether big pixmaps are enabled</li>
|
---|
| 115 | <li class=fn>bool <a href="#usesTextLabel-prop"><b>usesTextLabel</b></a> - whether text labels for toolbar buttons are enabled</li>
|
---|
| 116 | </ul>
|
---|
| 117 | <h2>Protected Members</h2>
|
---|
| 118 | <ul>
|
---|
| 119 | <li class=fn>virtual void <a href="#childEvent"><b>childEvent</b></a> ( QChildEvent * e )</li>
|
---|
| 120 | </ul>
|
---|
| 121 | <h2>Protected Slots</h2>
|
---|
| 122 | <ul>
|
---|
| 123 | <li class=fn>virtual void <a href="#setUpLayout"><b>setUpLayout</b></a> ()</li>
|
---|
| 124 | <li class=fn>virtual bool <a href="#showDockMenu"><b>showDockMenu</b></a> ( const QPoint & globalPos )</li>
|
---|
| 125 | <li class=fn>void <a href="#menuAboutToShow"><b>menuAboutToShow</b></a> ()</li>
|
---|
| 126 | </ul>
|
---|
| 127 | <h2>Related Functions</h2>
|
---|
| 128 | <ul>
|
---|
| 129 | <li class=fn>QTextStream & <a href="#operator-lt-lt"><b>operator<<</b></a> ( QTextStream & ts, const QMainWindow & mainWindow )</li>
|
---|
| 130 | <li class=fn>QTextStream & <a href="#operator-gt-gt"><b>operator>></b></a> ( QTextStream & ts, QMainWindow & mainWindow )</li>
|
---|
| 131 | </ul>
|
---|
| 132 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
| 133 |
|
---|
| 134 |
|
---|
| 135 | The QMainWindow class provides a main application window,
|
---|
| 136 | with a menu bar, dock windows (e.g. for toolbars), and a status
|
---|
| 137 | bar.
|
---|
| 138 | <p>
|
---|
| 139 |
|
---|
| 140 | <p> Main windows are most often used to provide menus, toolbars and a
|
---|
| 141 | status bar around a large central widget, such as a text edit,
|
---|
| 142 | drawing canvas or <a href="qworkspace.html">QWorkspace</a> (for MDI applications). QMainWindow
|
---|
| 143 | is usually subclassed since this makes it easier to encapsulate
|
---|
| 144 | the central widget, menus and toolbars as well as the window's
|
---|
| 145 | state. Subclassing makes it possible to create the slots that are
|
---|
| 146 | called when the user clicks menu items or toolbar buttons. You can
|
---|
| 147 | also create main windows using <a href="designer-manual.html">Qt
|
---|
| 148 | Designer</a>. We'll briefly review adding menu items and
|
---|
| 149 | toolbar buttons then describe the facilities of QMainWindow
|
---|
| 150 | itself.
|
---|
| 151 | <p> <pre>
|
---|
| 152 | QMainWindow *mw = new QMainWindow;
|
---|
| 153 | <a href="qtextedit.html">QTextEdit</a> *edit = new <a href="qtextedit.html">QTextEdit</a>( mw, "editor" );
|
---|
| 154 | edit-><a href="qwidget.html#setFocus">setFocus</a>();
|
---|
| 155 | mw-><a href="qwidget.html#setCaption">setCaption</a>( "Main Window" );
|
---|
| 156 | mw-><a href="#setCentralWidget">setCentralWidget</a>( edit );
|
---|
| 157 | mw-><a href="qwidget.html#show">show</a>();
|
---|
| 158 | </pre>
|
---|
| 159 |
|
---|
| 160 | <p> QMainWindows may be created in their own right as shown above.
|
---|
| 161 | The central widget is set with <a href="#setCentralWidget">setCentralWidget</a>(). Popup menus can
|
---|
| 162 | be added to the default menu bar, widgets can be added to the
|
---|
| 163 | status bar, toolbars and dock windows can be added to any of the
|
---|
| 164 | dock areas.
|
---|
| 165 | <p>
|
---|
| 166 |
|
---|
| 167 | <pre> ApplicationWindow *mw = new ApplicationWindow();
|
---|
| 168 | mw-><a href="qwidget.html#setCaption">setCaption</a>( "Qt Example - Application" );
|
---|
| 169 | <a name="x2115"></a> mw-><a href="qwidget.html#show">show</a>();
|
---|
| 170 | </pre>
|
---|
| 171 | <p> In the extract above ApplicationWindow is a subclass of
|
---|
| 172 | QMainWindow that we must write for ourselves; this is the usual
|
---|
| 173 | approach to using QMainWindow. (The source for the extracts in
|
---|
| 174 | this description are taken from <a href="simple-application-example.html">application/main.cpp</a>, <a href="simple-application-example.html">application/application.cpp</a>, <a href="qaction-application-example.html">action/main.cpp</a>, and <a href="qaction-application-example.html">action/application.cpp</a> )
|
---|
| 175 | <p> When subclassing we add the menu items and toolbars in the
|
---|
| 176 | subclass's constructor. If we've created a QMainWindow instance
|
---|
| 177 | directly we can add menu items and toolbars just as easily by
|
---|
| 178 | passing the QMainWindow instance as the parent instead of the <em>this</em> pointer.
|
---|
| 179 | <p>
|
---|
| 180 |
|
---|
| 181 | <pre> <a href="qpopupmenu.html">QPopupMenu</a> * help = new <a href="qpopupmenu.html">QPopupMenu</a>( this );
|
---|
| 182 | <a href="#menuBar">menuBar</a>()->insertItem( "&Help", help );
|
---|
| 183 |
|
---|
| 184 | help-><a href="qmenudata.html#insertItem">insertItem</a>( "&About", this, SLOT(about()), Key_F1 );
|
---|
| 185 | </pre>
|
---|
| 186 | <p> Here we've added a new menu with one menu item. The menu has been
|
---|
| 187 | inserted into the menu bar that QMainWindow provides by default
|
---|
| 188 | and which is accessible through the <a href="#menuBar">menuBar</a>() function. The slot
|
---|
| 189 | will be called when the menu item is clicked.
|
---|
| 190 | <p>
|
---|
| 191 |
|
---|
| 192 | <pre> <a href="qtoolbar.html">QToolBar</a> * fileTools = new <a href="qtoolbar.html">QToolBar</a>( this, "file operations" );
|
---|
| 193 | fileTools-><a href="qtoolbar.html#setLabel">setLabel</a>( "File Operations" );
|
---|
| 194 | </pre><pre> QToolButton * fileOpen
|
---|
| 195 | = new <a href="qtoolbutton.html">QToolButton</a>( openIcon, "Open File", <a href="qstring.html#QString-null">QString::null</a>,
|
---|
| 196 | this, SLOT(choose()), fileTools, "open file" );
|
---|
| 197 | </pre>
|
---|
| 198 | <p> This extract shows the creation of a toolbar with one toolbar
|
---|
| 199 | button. QMainWindow supplies four dock areas for toolbars. When a
|
---|
| 200 | toolbar is created as a child of a QMainWindow (or derived class)
|
---|
| 201 | instance it will be placed in a dock area (the <a href="qt.html#Dock-enum">Top</a> dock area by
|
---|
| 202 | default). The slot will be called when the toolbar button is
|
---|
| 203 | clicked. Any dock window can be added to a dock area either using
|
---|
| 204 | <a href="#addDockWindow">addDockWindow</a>(), or by creating a dock window with the QMainWindow
|
---|
| 205 | as the parent.
|
---|
| 206 | <p>
|
---|
| 207 |
|
---|
| 208 | <pre> e = new <a href="qtextedit.html">QTextEdit</a>( this, "editor" );
|
---|
| 209 | e-><a href="qwidget.html#setFocus">setFocus</a>();
|
---|
| 210 | <a href="#setCentralWidget">setCentralWidget</a>( e );
|
---|
| 211 | <a href="#statusBar">statusBar</a>()->message( "Ready", 2000 );
|
---|
| 212 | </pre>
|
---|
| 213 | <p> Having created the menus and toolbar we create an instance of the
|
---|
| 214 | large central widget, give it the focus and set it as the main
|
---|
| 215 | window's central widget. In the example we've also set the status
|
---|
| 216 | bar, accessed via the <a href="#statusBar">statusBar</a>() function, to an initial message
|
---|
| 217 | which will be displayed for two seconds. Note that you can add
|
---|
| 218 | additional widgets to the status bar, for example labels, to show
|
---|
| 219 | further status information. See the <a href="qstatusbar.html">QStatusBar</a> documentation for
|
---|
| 220 | details, particularly the addWidget() function.
|
---|
| 221 | <p> Often we want to synchronize a toolbar button with a menu item.
|
---|
| 222 | For example, if the user clicks a 'bold' toolbar button we want
|
---|
| 223 | the 'bold' menu item to be checked. This synchronization can be
|
---|
| 224 | achieved automatically by creating actions and adding the actions
|
---|
| 225 | to the toolbar and menu.
|
---|
| 226 | <p>
|
---|
| 227 |
|
---|
| 228 | <pre> <a href="qaction.html">QAction</a> * fileOpenAction;
|
---|
| 229 | </pre><pre> fileOpenAction = new <a href="qaction.html">QAction</a>( QPixmap( fileopen ), "&Open...",
|
---|
| 230 | CTRL+Key_O, this, "open" );
|
---|
| 231 | <a href="qobject.html#connect">connect</a>( fileOpenAction, SIGNAL( <a href="qaction.html#activated">activated</a>() ) , this, SLOT( choose() ) );
|
---|
| 232 | </pre>
|
---|
| 233 | <p> Here we create an action with an icon which will be used in any
|
---|
| 234 | menu and toolbar that the action is added to. We've also given the
|
---|
| 235 | action a menu name, '&Open', and a keyboard shortcut. The
|
---|
| 236 | connection that we have made will be used when the user clicks
|
---|
| 237 | either the menu item <em>or</em> the toolbar button.
|
---|
| 238 | <p>
|
---|
| 239 |
|
---|
| 240 | <pre> <a href="qpopupmenu.html">QPopupMenu</a> * file = new <a href="qpopupmenu.html">QPopupMenu</a>( this );
|
---|
| 241 | <a href="#menuBar">menuBar</a>()->insertItem( "&File", file );
|
---|
| 242 | </pre><pre> fileOpenAction-><a href="qaction.html#addTo">addTo</a>( file );
|
---|
| 243 | </pre>
|
---|
| 244 | <p> The extract above shows the creation of a popup menu. We add the
|
---|
| 245 | menu to the QMainWindow's menu bar and add our action.
|
---|
| 246 | <p>
|
---|
| 247 |
|
---|
| 248 | <pre> <a href="qtoolbar.html">QToolBar</a> * fileTools = new <a href="qtoolbar.html">QToolBar</a>( this, "file operations" );
|
---|
| 249 | fileTools-><a href="qtoolbar.html#setLabel">setLabel</a>( "File Operations" );
|
---|
| 250 | fileOpenAction-><a href="qaction.html#addTo">addTo</a>( fileTools );
|
---|
| 251 | </pre>
|
---|
| 252 | <p> Here we create a new toolbar as a child of the QMainWindow and add
|
---|
| 253 | our action to the toolbar.
|
---|
| 254 | <p> We'll now explore the functionality offered by QMainWindow.
|
---|
| 255 | <p> The main window will take care of the dock areas, and the geometry
|
---|
| 256 | of the central widget, but all other aspects of the central widget
|
---|
| 257 | are left to you. QMainWindow automatically detects the creation of
|
---|
| 258 | a menu bar or status bar if you specify the QMainWindow as parent,
|
---|
| 259 | or you can use the provided <a href="#menuBar">menuBar</a>() and <a href="#statusBar">statusBar</a>() functions.
|
---|
| 260 | The functions menuBar() and statusBar() create a suitable widget
|
---|
| 261 | if one doesn't exist, and update the window's layout to make
|
---|
| 262 | space.
|
---|
| 263 | <p> QMainWindow provides a <a href="qtooltipgroup.html">QToolTipGroup</a> connected to the status bar.
|
---|
| 264 | The function <a href="#toolTipGroup">toolTipGroup</a>() provides access to the default
|
---|
| 265 | QToolTipGroup. It isn't possible to set a different tool tip
|
---|
| 266 | group.
|
---|
| 267 | <p> New dock windows and toolbars can be added to a QMainWindow using
|
---|
| 268 | <a href="#addDockWindow">addDockWindow</a>(). Dock windows can be moved using <a href="#moveDockWindow">moveDockWindow</a>()
|
---|
| 269 | and removed with <a href="#removeDockWindow">removeDockWindow</a>(). QMainWindow allows default
|
---|
| 270 | dock window (toolbar) docking in all its dock areas (<a href="qt.html#Dock-enum">Top</a>, <a href="qt.html#Dock-enum">Left</a>, <a href="qt.html#Dock-enum">Right</a>, <a href="qt.html#Dock-enum">Bottom</a>). You can use <a href="#setDockEnabled">setDockEnabled</a>() to
|
---|
| 271 | enable and disable docking areas for dock windows. When adding or
|
---|
| 272 | moving dock windows you can specify their 'edge' (dock area). The
|
---|
| 273 | currently available edges are: <a href="qt.html#Dock-enum">Top</a>, <a href="qt.html#Dock-enum">Left</a>, <a href="qt.html#Dock-enum">Right</a>, <a href="qt.html#Dock-enum">Bottom</a>, <a href="qt.html#Dock-enum">Minimized</a> (effectively a 'hidden' dock area) and <a href="qt.html#Dock-enum">TornOff</a> (floating). See <a href="qt.html#Dock-enum">Qt::Dock</a> for an explanation of these
|
---|
| 274 | areas. Note that the *ToolBar functions are included for backward
|
---|
| 275 | compatibility; all new code should use the *DockWindow functions.
|
---|
| 276 | QToolbar is a subclass of <a href="qdockwindow.html">QDockWindow</a> so all functions that work
|
---|
| 277 | with dock windows work on toolbars in the same way.
|
---|
| 278 | <p> <a name="dwm"></a>
|
---|
| 279 | If the user clicks the close button, then the dock window is
|
---|
| 280 | hidden. A dock window can be hidden or unhidden by the user by
|
---|
| 281 | right clicking a dock area and clicking the name of the relevant
|
---|
| 282 | dock window on the pop up dock window menu. This menu lists the
|
---|
| 283 | names of every dock window; visible dock windows have a tick
|
---|
| 284 | beside their names. The dock window menu is created automatically
|
---|
| 285 | as required by <a href="#createDockWindowMenu">createDockWindowMenu</a>(). Since it may not always be
|
---|
| 286 | appropriate for a dock window to appear on this menu the
|
---|
| 287 | <a href="#setAppropriate">setAppropriate</a>() function is used to inform the main window
|
---|
| 288 | whether or not the dock window menu should include a particular
|
---|
| 289 | dock window. Double clicking a dock window handle (usually on the
|
---|
| 290 | left-hand side of the dock window) undocks (floats) the dock
|
---|
| 291 | window. Double clicking a floating dock window's titlebar will
|
---|
| 292 | dock the floating dock window. (See also
|
---|
| 293 | <a href="#DockWindows-enum">QMainWindow::DockWindows</a>.)
|
---|
| 294 | <p> Some functions change the appearance of a QMainWindow globally:
|
---|
| 295 | <ul>
|
---|
| 296 | <li> <a href="qdockwindow.html#setHorizontalStretchable">QDockWindow::setHorizontalStretchable</a>() and
|
---|
| 297 | <a href="qdockwindow.html#setVerticalStretchable">QDockWindow::setVerticalStretchable</a>() are used to make specific dock
|
---|
| 298 | windows or toolbars stretchable.
|
---|
| 299 | <li> <a href="#setUsesBigPixmaps">setUsesBigPixmaps</a>() is used to set whether tool buttons should
|
---|
| 300 | draw small or large pixmaps (see <a href="qiconset.html">QIconSet</a> for more information).
|
---|
| 301 | <li> <a href="#setUsesTextLabel">setUsesTextLabel</a>() is used to set whether tool buttons
|
---|
| 302 | should display a textual label in addition to pixmaps
|
---|
| 303 | (see <a href="qtoolbutton.html">QToolButton</a> for more information).
|
---|
| 304 | </ul>
|
---|
| 305 | <p> The user can drag dock windows into any enabled docking area. Dock
|
---|
| 306 | windows can also be dragged <em>within</em> a docking area, for example
|
---|
| 307 | to rearrange the order of some toolbars. Dock windows can also be
|
---|
| 308 | dragged outside any docking area (undocked or 'floated'). Being
|
---|
| 309 | able to drag dock windows can be enabled (the default) and
|
---|
| 310 | disabled using <a href="#setDockWindowsMovable">setDockWindowsMovable</a>().
|
---|
| 311 | <p> The <a href="qt.html#Dock-enum">Minimized</a> edge is a hidden dock area. If this dock area is
|
---|
| 312 | enabled the user can hide (minimize) a dock window or show (restore)
|
---|
| 313 | a minimized dock window by clicking the dock window handle. If the
|
---|
| 314 | user hovers the mouse cursor over one of the handles, the caption of
|
---|
| 315 | the dock window is displayed in a tool tip (see
|
---|
| 316 | <a href="qwidget.html#caption">QDockWindow::caption</a>() or <a href="qtoolbar.html#label">QToolBar::label</a>()), so if you enable the
|
---|
| 317 | <a href="qt.html#Dock-enum">Minimized</a> dock area, it is best to specify a meaningful caption
|
---|
| 318 | or label for each dock window. To minimize a dock window
|
---|
| 319 | programmatically use <a href="#moveDockWindow">moveDockWindow</a>() with an edge of <a href="qt.html#Dock-enum">Minimized</a>.
|
---|
| 320 | <p> Dock windows are moved transparently by default, i.e. during the
|
---|
| 321 | drag an outline rectangle is drawn on the screen representing the
|
---|
| 322 | position of the dock window as it moves. If you want the dock
|
---|
| 323 | window to be shown normally whilst it is moved use
|
---|
| 324 | <a href="#setOpaqueMoving">setOpaqueMoving</a>().
|
---|
| 325 | <p> The location of a dock window, i.e. its dock area and position
|
---|
| 326 | within the dock area, can be determined by calling <a href="#getLocation">getLocation</a>().
|
---|
| 327 | Movable dock windows can be lined up to minimize wasted space with
|
---|
| 328 | <a href="#lineUpDockWindows">lineUpDockWindows</a>(). Pointers to the dock areas are available from
|
---|
| 329 | <a href="#topDock">topDock</a>(), <a href="#leftDock">leftDock</a>(), <a href="#rightDock">rightDock</a>() and <a href="#bottomDock">bottomDock</a>(). A customize
|
---|
| 330 | menu item is added to the pop up dock window menu if
|
---|
| 331 | <a href="#isCustomizable">isCustomizable</a>() returns TRUE; it returns FALSE by default.
|
---|
| 332 | Reimplement isCustomizable() and <a href="#customize">customize</a>() if you want to offer
|
---|
| 333 | this extra menu item, for example, to allow the user to change
|
---|
| 334 | settings relating to the main window and its toolbars and dock
|
---|
| 335 | windows.
|
---|
| 336 | <p> The main window's menu bar is fixed (at the top) by default. If
|
---|
| 337 | you want a movable menu bar, create a <a href="qmenubar.html">QMenuBar</a> as a stretchable
|
---|
| 338 | widget inside its own movable dock window and restrict this dock
|
---|
| 339 | window to only live within the <a href="qt.html#Dock-enum">Top</a> or <a href="qt.html#Dock-enum">Bottom</a> dock:
|
---|
| 340 | <p> <pre>
|
---|
| 341 | <a href="qtoolbar.html">QToolBar</a> *tb = new <a href="qtoolbar.html">QToolBar</a>( this );
|
---|
| 342 | <a href="#addDockWindow">addDockWindow</a>( tb, tr( "Menubar" ), Top, FALSE );
|
---|
| 343 | <a href="qmenubar.html">QMenuBar</a> *mb = new <a href="qmenubar.html">QMenuBar</a>( tb );
|
---|
| 344 | mb-><a href="qframe.html#setFrameStyle">setFrameStyle</a>( QFrame::NoFrame );
|
---|
| 345 | tb-><a href="qtoolbar.html#setStretchableWidget">setStretchableWidget</a>( mb );
|
---|
| 346 | <a href="#setDockEnabled">setDockEnabled</a>( tb, Left, FALSE );
|
---|
| 347 | <a href="#setDockEnabled">setDockEnabled</a>( tb, Right, FALSE );
|
---|
| 348 | </pre>
|
---|
| 349 |
|
---|
| 350 | <p> An application with multiple dock windows can choose to save the
|
---|
| 351 | current dock window layout in order to restore it later, e.g. in
|
---|
| 352 | the next session. You can do this by using the streaming operators
|
---|
| 353 | for QMainWindow.
|
---|
| 354 | <p> To save the layout and positions of all the dock windows do this:
|
---|
| 355 | <p> <pre>
|
---|
| 356 | <a href="qfile.html">QFile</a> file( filename );
|
---|
| 357 | if ( file.<a href="qfile.html#open">open</a>( <a href="qfile.html#open">IO_WriteOnly</a> ) ) {
|
---|
| 358 | <a href="qtextstream.html">QTextStream</a> stream( &file );
|
---|
| 359 | stream << *mainWindow;
|
---|
| 360 | file.<a href="qfile.html#close">close</a>();
|
---|
| 361 | }
|
---|
| 362 | </pre>
|
---|
| 363 |
|
---|
| 364 | <p> To restore the dock window positions and sizes (normally when the
|
---|
| 365 | application is next started), do following:
|
---|
| 366 | <p> <pre>
|
---|
| 367 | <a href="qfile.html">QFile</a> file( filename );
|
---|
| 368 | if ( file.<a href="qfile.html#open">open</a>( <a href="qfile.html#open">IO_ReadOnly</a> ) ) {
|
---|
| 369 | <a href="qtextstream.html">QTextStream</a> stream( &file );
|
---|
| 370 | stream >> *mainWindow;
|
---|
| 371 | file.<a href="qfile.html#close">close</a>();
|
---|
| 372 | }
|
---|
| 373 | </pre>
|
---|
| 374 |
|
---|
| 375 | <p> The <a href="qsettings.html">QSettings</a> class can be used in conjunction with the streaming
|
---|
| 376 | operators to store the application's settings.
|
---|
| 377 | <p> QMainWindow's management of dock windows and toolbars is done
|
---|
| 378 | transparently behind-the-scenes by <a href="qdockarea.html">QDockArea</a>.
|
---|
| 379 | <p> For multi-document interfaces (MDI), use a <a href="qworkspace.html">QWorkspace</a> as the
|
---|
| 380 | central widget.
|
---|
| 381 | <p> Adding dock windows, e.g. toolbars, to QMainWindow's dock areas is
|
---|
| 382 | straightforward. If the supplied dock areas are not sufficient for
|
---|
| 383 | your application we suggest that you create a <a href="qwidget.html">QWidget</a> subclass and
|
---|
| 384 | add your own dock areas (see <a href="qdockarea.html">QDockArea</a>) to the subclass since
|
---|
| 385 | QMainWindow provides functionality specific to the standard dock
|
---|
| 386 | areas it provides.
|
---|
| 387 | <p> <img src=qmainwindow-m.png> <img src=qmainwindow-w.png>
|
---|
| 388 | <p> <p>See also <a href="qtoolbar.html">QToolBar</a>, <a href="qdockwindow.html">QDockWindow</a>, <a href="qstatusbar.html">QStatusBar</a>, <a href="qaction.html">QAction</a>, <a href="qmenubar.html">QMenuBar</a>, <a href="qpopupmenu.html">QPopupMenu</a>, <a href="qtooltipgroup.html">QToolTipGroup</a>, <a href="qdialog.html">QDialog</a>, and <a href="application.html">Main Window and Related Classes</a>.
|
---|
| 389 |
|
---|
| 390 | <hr><h2>Member Type Documentation</h2>
|
---|
| 391 | <h3 class=fn><a name="DockWindows-enum"></a>QMainWindow::DockWindows</h3>
|
---|
| 392 |
|
---|
| 393 | <p> Right-clicking a dock area will pop-up the dock window menu
|
---|
| 394 | (<a href="#createDockWindowMenu">createDockWindowMenu</a>() is called automatically). When called in
|
---|
| 395 | code you can specify what items should appear on the menu with
|
---|
| 396 | this enum.
|
---|
| 397 | <ul>
|
---|
| 398 | <li><tt>QMainWindow::OnlyToolBars</tt> - The menu will list all the toolbars, but not
|
---|
| 399 | any other dock windows.
|
---|
| 400 | <li><tt>QMainWindow::NoToolBars</tt> - The menu will list dock windows but not
|
---|
| 401 | toolbars.
|
---|
| 402 | <li><tt>QMainWindow::AllDockWindows</tt> - The menu will list all toolbars and other
|
---|
| 403 | dock windows. (This is the default.)
|
---|
| 404 | </ul>
|
---|
| 405 | <hr><h2>Member Function Documentation</h2>
|
---|
| 406 | <h3 class=fn><a name="QMainWindow"></a>QMainWindow::QMainWindow ( <a href="qwidget.html">QWidget</a> * parent = 0, const char * name = 0, WFlags f = WType_TopLevel )
|
---|
| 407 | </h3>
|
---|
| 408 | Constructs an empty main window. The <em>parent</em>, <em>name</em> and widget
|
---|
| 409 | flags <em>f</em>, are passed on to the <a href="qwidget.html">QWidget</a> constructor.
|
---|
| 410 | <p> By default, the widget flags are set to <a href="qt.html#WidgetFlags-enum">WType_TopLevel</a> rather
|
---|
| 411 | than 0 as they are with QWidget. If you don't want your
|
---|
| 412 | QMainWindow to be a top level widget then you will need to set <em>f</em> to 0.
|
---|
| 413 |
|
---|
| 414 | <h3 class=fn><a name="~QMainWindow"></a>QMainWindow::~QMainWindow ()
|
---|
| 415 | </h3>
|
---|
| 416 | Destroys the object and frees any allocated resources.
|
---|
| 417 |
|
---|
| 418 | <h3 class=fn>void <a name="addDockWindow"></a>QMainWindow::addDockWindow ( <a href="qdockwindow.html">QDockWindow</a> * dockWindow, <a href="qt.html#Dock-enum">Dock</a> edge = DockTop, bool newLine = FALSE )<tt> [virtual]</tt>
|
---|
| 419 | </h3>
|
---|
| 420 | Adds <em>dockWindow</em> to the <em>edge</em> dock area.
|
---|
| 421 | <p> If <em>newLine</em> is FALSE (the default) then the <em>dockWindow</em> is
|
---|
| 422 | added at the end of the <em>edge</em>. For vertical edges the end is at
|
---|
| 423 | the bottom, for horizontal edges (including <a href="qt.html#Dock-enum">Minimized</a>) the end
|
---|
| 424 | is at the right. If <em>newLine</em> is TRUE a new line of dock windows
|
---|
| 425 | is started with <em>dockWindow</em> as the first (left-most and
|
---|
| 426 | top-most) dock window.
|
---|
| 427 | <p> If <em>dockWindow</em> is managed by another main window, it is first
|
---|
| 428 | removed from that window.
|
---|
| 429 |
|
---|
| 430 | <h3 class=fn>void <a name="addDockWindow-2"></a>QMainWindow::addDockWindow ( <a href="qdockwindow.html">QDockWindow</a> * dockWindow, const <a href="qstring.html">QString</a> & label, <a href="qt.html#Dock-enum">Dock</a> edge = DockTop, bool newLine = FALSE )<tt> [virtual]</tt>
|
---|
| 431 | </h3>
|
---|
| 432 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 433 | <p> Adds <em>dockWindow</em> to the dock area with label <em>label</em>.
|
---|
| 434 | <p> If <em>newLine</em> is FALSE (the default) the <em>dockWindow</em> is added at
|
---|
| 435 | the end of the <em>edge</em>. For vertical edges the end is at the
|
---|
| 436 | bottom, for horizontal edges (including <a href="qt.html#Dock-enum">Minimized</a>) the end is
|
---|
| 437 | at the right. If <em>newLine</em> is TRUE a new line of dock windows is
|
---|
| 438 | started with <em>dockWindow</em> as the first (left-most and top-most)
|
---|
| 439 | dock window.
|
---|
| 440 | <p> If <em>dockWindow</em> is managed by another main window, it is first
|
---|
| 441 | removed from that window.
|
---|
| 442 |
|
---|
| 443 | <h3 class=fn>void <a name="addToolBar"></a>QMainWindow::addToolBar ( <a href="qdockwindow.html">QDockWindow</a> *, <a href="qt.html#Dock-enum">Dock</a> = DockTop, bool newLine = FALSE )
|
---|
| 444 | </h3>
|
---|
| 445 | <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
|
---|
| 446 | <p>
|
---|
| 447 |
|
---|
| 448 | <h3 class=fn>void <a name="addToolBar-2"></a>QMainWindow::addToolBar ( <a href="qdockwindow.html">QDockWindow</a> *, const <a href="qstring.html">QString</a> & label, <a href="qt.html#Dock-enum">Dock</a> = DockTop, bool newLine = FALSE )
|
---|
| 449 | </h3>
|
---|
| 450 | <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
|
---|
| 451 | <p> This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 452 | <p>
|
---|
| 453 | <h3 class=fn>bool <a name="appropriate"></a>QMainWindow::appropriate ( <a href="qdockwindow.html">QDockWindow</a> * dw ) const
|
---|
| 454 | </h3>
|
---|
| 455 | Returns TRUE if it is appropriate to include a menu item for the
|
---|
| 456 | <em>dw</em> dock window in the dock window menu; otherwise returns
|
---|
| 457 | FALSE.
|
---|
| 458 | <p> The user is able to change the state (show or hide) a dock window
|
---|
| 459 | that has a menu item by clicking the item.
|
---|
| 460 | <p> Call <a href="#setAppropriate">setAppropriate</a>() to indicate whether or not a particular dock
|
---|
| 461 | window should appear on the popup menu.
|
---|
| 462 | <p> <p>See also <a href="#setAppropriate">setAppropriate</a>().
|
---|
| 463 |
|
---|
| 464 | <h3 class=fn><a href="qdockarea.html">QDockArea</a> * <a name="bottomDock"></a>QMainWindow::bottomDock () const
|
---|
| 465 | </h3>
|
---|
| 466 | Returns a pointer the <a href="qt.html#Dock-enum">Bottom</a> dock area
|
---|
| 467 | <p> <p>See also <a href="#topDock">topDock</a>(), <a href="#leftDock">leftDock</a>(), and <a href="#rightDock">rightDock</a>().
|
---|
| 468 |
|
---|
| 469 | <h3 class=fn><a href="qwidget.html">QWidget</a> * <a name="centralWidget"></a>QMainWindow::centralWidget () const
|
---|
| 470 | </h3>
|
---|
| 471 | Returns a pointer to the main window's central widget.
|
---|
| 472 | <p> The central widget is surrounded by the left, top, right and
|
---|
| 473 | bottom dock areas. The menu bar is above the top dock area.
|
---|
| 474 | <p> <p>See also <a href="#setCentralWidget">setCentralWidget</a>().
|
---|
| 475 |
|
---|
| 476 | <p>Example: <a href="qfd-example.html#x2013">qfd/qfd.cpp</a>.
|
---|
| 477 | <h3 class=fn>void <a name="childEvent"></a>QMainWindow::childEvent ( <a href="qchildevent.html">QChildEvent</a> * e )<tt> [virtual protected]</tt>
|
---|
| 478 | </h3>
|
---|
| 479 | Monitors events, recieved in <em>e</em>, to ensure the layout is updated.
|
---|
| 480 |
|
---|
| 481 | <p>Reimplemented from <a href="qobject.html#childEvent">QObject</a>.
|
---|
| 482 | <h3 class=fn><a href="qpopupmenu.html">QPopupMenu</a> * <a name="createDockWindowMenu"></a>QMainWindow::createDockWindowMenu ( <a href="qmainwindow.html#DockWindows-enum">DockWindows</a> dockWindows = AllDockWindows ) const
|
---|
| 483 | </h3>
|
---|
| 484 | Creates the dock window menu which contains all toolbars (if <em>dockWindows</em> is <a href="#DockWindows-enum">OnlyToolBars</a> ), all dock windows (if <em>dockWindows</em> is <a href="#DockWindows-enum">NoToolBars</a>) or all toolbars and dock windows (if
|
---|
| 485 | <em>dockWindows</em> is <a href="#DockWindows-enum">AllDockWindows</a> - the default).
|
---|
| 486 | <p> This function is called internally when necessary, e.g. when the
|
---|
| 487 | user right clicks a dock area (providing <a href="#isDockMenuEnabled">isDockMenuEnabled</a>()
|
---|
| 488 | returns TRUE).
|
---|
| 489 |
|
---|
| 490 | <p> The menu items representing the toolbars and dock windows are
|
---|
| 491 | checkable. The visible dock windows are checked and the hidden
|
---|
| 492 | dock windows are unchecked. The user can click a menu item to
|
---|
| 493 | change its state (show or hide the dock window).
|
---|
| 494 | <p> The list and the state are always kept up-to-date.
|
---|
| 495 | <p> Toolbars and dock windows which are not appropriate in the current
|
---|
| 496 | context (see <a href="#setAppropriate">setAppropriate</a>()) are not listed in the menu.
|
---|
| 497 | <p> The menu also has a menu item for lining up the dock windows.
|
---|
| 498 | <p> If <a href="#isCustomizable">isCustomizable</a>() returns TRUE, a Customize menu item is added
|
---|
| 499 | to the menu, which if clicked will call <a href="#customize">customize</a>(). The
|
---|
| 500 | isCustomizable() function we provide returns FALSE and customize()
|
---|
| 501 | does nothing, so they must be reimplemented in a subclass to be
|
---|
| 502 | useful.
|
---|
| 503 |
|
---|
| 504 | <h3 class=fn>void <a name="customize"></a>QMainWindow::customize ()<tt> [virtual slot]</tt>
|
---|
| 505 | </h3>
|
---|
| 506 | This function is called when the user clicks the Customize menu
|
---|
| 507 | item on the dock window menu.
|
---|
| 508 | <p> The customize menu item will only appear if <a href="#isCustomizable">isCustomizable</a>()
|
---|
| 509 | returns TRUE (it returns FALSE by default).
|
---|
| 510 | <p> The function is intended, for example, to provide the user with a
|
---|
| 511 | means of telling the application that they wish to customize the
|
---|
| 512 | main window, dock windows or dock areas.
|
---|
| 513 | <p> The default implementation does nothing and the Customize menu
|
---|
| 514 | item is not shown on the right-click menu by default. If you want
|
---|
| 515 | the item to appear then reimplement isCustomizable() to return
|
---|
| 516 | TRUE, and reimplement this function to do whatever you want.
|
---|
| 517 | <p> <p>See also <a href="#isCustomizable">isCustomizable</a>().
|
---|
| 518 |
|
---|
| 519 | <h3 class=fn>void <a name="dockWindowPositionChanged"></a>QMainWindow::dockWindowPositionChanged ( <a href="qdockwindow.html">QDockWindow</a> * dockWindow )<tt> [signal]</tt>
|
---|
| 520 | </h3>
|
---|
| 521 |
|
---|
| 522 | <p> This signal is emitted when the <em>dockWindow</em> has changed its
|
---|
| 523 | position. A change in position occurs when a dock window is moved
|
---|
| 524 | within its dock area or moved to another dock area (including the
|
---|
| 525 | <a href="qt.html#Dock-enum">Minimized</a> and <tt>TearOff</tt> dock areas).
|
---|
| 526 | <p> <p>See also <a href="#getLocation">getLocation</a>().
|
---|
| 527 |
|
---|
| 528 | <h3 class=fn><a href="qptrlist.html">QPtrList</a><QDockWindow> <a name="dockWindows"></a>QMainWindow::dockWindows ( <a href="qt.html#Dock-enum">Dock</a> dock ) const
|
---|
| 529 | </h3>
|
---|
| 530 | Returns a list of all the dock windows which are in the <em>dock</em>
|
---|
| 531 | dock area, regardless of their state.
|
---|
| 532 | <p> For example, the <a href="qt.html#Dock-enum">DockTornOff</a> dock area may contain closed dock
|
---|
| 533 | windows but these are returned along with the visible dock
|
---|
| 534 | windows.
|
---|
| 535 |
|
---|
| 536 | <h3 class=fn><a href="qptrlist.html">QPtrList</a><QDockWindow> <a name="dockWindows-2"></a>QMainWindow::dockWindows () const
|
---|
| 537 | </h3>
|
---|
| 538 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 539 | <p> Returns the list of dock windows which belong to this main window,
|
---|
| 540 | regardless of which dock area they are in or what their state is,
|
---|
| 541 | (e.g. irrespective of whether they are visible or not).
|
---|
| 542 |
|
---|
| 543 | <h3 class=fn>bool <a name="dockWindowsMovable"></a>QMainWindow::dockWindowsMovable () const
|
---|
| 544 | </h3><p>Returns TRUE if the dock windows are movable; otherwise returns FALSE.
|
---|
| 545 | See the <a href="qmainwindow.html#dockWindowsMovable-prop">"dockWindowsMovable"</a> property for details.
|
---|
| 546 | <h3 class=fn>bool <a name="getLocation"></a>QMainWindow::getLocation ( <a href="qdockwindow.html">QDockWindow</a> * dw, <a href="qt.html#Dock-enum">Dock</a> & dock, int & index, bool & nl, int & extraOffset ) const
|
---|
| 547 | </h3>
|
---|
| 548 | Finds the location of the dock window <em>dw</em>.
|
---|
| 549 | <p> If the <em>dw</em> dock window is found in the main window the function
|
---|
| 550 | returns TRUE and populates the <em>dock</em> variable with the dw's dock
|
---|
| 551 | area and the <em>index</em> with the dw's position within the dock area.
|
---|
| 552 | It also sets <em>nl</em> to TRUE if the <em>dw</em> begins a new line
|
---|
| 553 | (otherwise FALSE), and <em>extraOffset</em> with the dock window's offset.
|
---|
| 554 | <p> If the <em>dw</em> dock window is not found then the function returns
|
---|
| 555 | FALSE and the state of <em>dock</em>, <em>index</em>, <em>nl</em> and <em>extraOffset</em>
|
---|
| 556 | is undefined.
|
---|
| 557 | <p> If you want to save and restore dock window positions then use
|
---|
| 558 | <a href="#operator-gt-gt">operator>></a>() and <a href="#operator-lt-lt">operator<<</a>().
|
---|
| 559 | <p> <p>See also <a href="#operator-gt-gt">operator>></a>() and <a href="#operator-lt-lt">operator<<</a>().
|
---|
| 560 |
|
---|
| 561 | <h3 class=fn>bool <a name="hasDockWindow"></a>QMainWindow::hasDockWindow ( <a href="qdockwindow.html">QDockWindow</a> * dw )
|
---|
| 562 | </h3>
|
---|
| 563 | Returns TRUE if <em>dw</em> is a dock window known to the main window;
|
---|
| 564 | otherwise returns FALSE.
|
---|
| 565 |
|
---|
| 566 | <h3 class=fn>bool <a name="isCustomizable"></a>QMainWindow::isCustomizable () const<tt> [virtual]</tt>
|
---|
| 567 | </h3>
|
---|
| 568 | Returns TRUE if the dock area dock window menu includes the
|
---|
| 569 | Customize menu item (which calls <a href="#customize">customize</a>() when clicked).
|
---|
| 570 | Returns FALSE by default, i.e. the popup menu will not contain a
|
---|
| 571 | Customize menu item. You will need to reimplement this function
|
---|
| 572 | and set it to return TRUE if you wish the user to be able to see
|
---|
| 573 | the dock window menu.
|
---|
| 574 | <p> <p>See also <a href="#customize">customize</a>().
|
---|
| 575 |
|
---|
| 576 | <h3 class=fn>bool <a name="isDockEnabled"></a>QMainWindow::isDockEnabled ( <a href="qt.html#Dock-enum">Dock</a> dock ) const
|
---|
| 577 | </h3>
|
---|
| 578 | Returns TRUE if the <em>dock</em> dock area is enabled, i.e. it can
|
---|
| 579 | accept user dragged dock windows; otherwise returns FALSE.
|
---|
| 580 | <p> <p>See also <a href="#setDockEnabled">setDockEnabled</a>().
|
---|
| 581 |
|
---|
| 582 | <h3 class=fn>bool <a name="isDockEnabled-2"></a>QMainWindow::isDockEnabled ( <a href="qdockarea.html">QDockArea</a> * area ) const
|
---|
| 583 | </h3>
|
---|
| 584 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 585 | <p> Returns TRUE if dock area <em>area</em> is enabled, i.e. it can accept
|
---|
| 586 | user dragged dock windows; otherwise returns FALSE.
|
---|
| 587 | <p> <p>See also <a href="#setDockEnabled">setDockEnabled</a>().
|
---|
| 588 |
|
---|
| 589 | <h3 class=fn>bool <a name="isDockEnabled-3"></a>QMainWindow::isDockEnabled ( <a href="qdockwindow.html">QDockWindow</a> * tb, <a href="qt.html#Dock-enum">Dock</a> dock ) const
|
---|
| 590 | </h3>
|
---|
| 591 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 592 | <p> Returns TRUE if dock area <em>dock</em> is enabled for the dock window
|
---|
| 593 | <em>tb</em>; otherwise returns FALSE.
|
---|
| 594 | <p> <p>See also <a href="#setDockEnabled">setDockEnabled</a>().
|
---|
| 595 |
|
---|
| 596 | <h3 class=fn>bool <a name="isDockEnabled-4"></a>QMainWindow::isDockEnabled ( <a href="qdockwindow.html">QDockWindow</a> * dw, <a href="qdockarea.html">QDockArea</a> * area ) const
|
---|
| 597 | </h3>
|
---|
| 598 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 599 | <p> Returns TRUE if dock area <em>area</em> is enabled for the dock window
|
---|
| 600 | <em>dw</em>; otherwise returns FALSE.
|
---|
| 601 | <p> <p>See also <a href="#setDockEnabled">setDockEnabled</a>().
|
---|
| 602 |
|
---|
| 603 | <h3 class=fn>bool <a name="isDockMenuEnabled"></a>QMainWindow::isDockMenuEnabled () const
|
---|
| 604 | </h3>
|
---|
| 605 | Returns TRUE, if the dock window menu is enabled; otherwise
|
---|
| 606 | returns FALSE.
|
---|
| 607 | <p> The menu lists the (<a href="#appropriate">appropriate</a>()) dock windows (which may be
|
---|
| 608 | shown or hidden), and has a "Line Up Dock Windows" menu item. It
|
---|
| 609 | will also have a "Customize" menu item if <a href="#isCustomizable">isCustomizable</a>() returns
|
---|
| 610 | TRUE.
|
---|
| 611 | <p> <p>See also <a href="#setDockEnabled">setDockEnabled</a>(), <a href="#lineUpDockWindows">lineUpDockWindows</a>(), <a href="#appropriate">appropriate</a>(), and <a href="#setAppropriate">setAppropriate</a>().
|
---|
| 612 |
|
---|
| 613 | <h3 class=fn><a href="qdockarea.html">QDockArea</a> * <a name="leftDock"></a>QMainWindow::leftDock () const
|
---|
| 614 | </h3>
|
---|
| 615 | Returns the <a href="qt.html#Dock-enum">Left</a> dock area
|
---|
| 616 | <p> <p>See also <a href="#rightDock">rightDock</a>(), <a href="#topDock">topDock</a>(), and <a href="#bottomDock">bottomDock</a>().
|
---|
| 617 |
|
---|
| 618 | <h3 class=fn>void <a name="lineUpDockWindows"></a>QMainWindow::lineUpDockWindows ( bool keepNewLines = FALSE )
|
---|
| 619 | </h3>
|
---|
| 620 | This function will line up dock windows within the visible dock
|
---|
| 621 | areas (<a href="qt.html#Dock-enum">Top</a>, <a href="qt.html#Dock-enum">Left</a>, <a href="qt.html#Dock-enum">Right</a> and <a href="qt.html#Dock-enum">Bottom</a>) as compactly as
|
---|
| 622 | possible.
|
---|
| 623 | <p> If <em>keepNewLines</em> is TRUE, all dock windows stay on their
|
---|
| 624 | original lines. If <em>keepNewLines</em> is FALSE then newlines may be
|
---|
| 625 | removed to achieve the most compact layout possible.
|
---|
| 626 | <p> The method only works if <a href="#dockWindowsMovable">dockWindowsMovable</a>() returns TRUE.
|
---|
| 627 |
|
---|
| 628 | <h3 class=fn>void <a name="lineUpToolBars"></a>QMainWindow::lineUpToolBars ( bool keepNewLines = FALSE )
|
---|
| 629 | </h3>
|
---|
| 630 | <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
|
---|
| 631 | <p>
|
---|
| 632 |
|
---|
| 633 | <h3 class=fn>void <a name="menuAboutToShow"></a>QMainWindow::menuAboutToShow ()<tt> [protected slot]</tt>
|
---|
| 634 | </h3>
|
---|
| 635 | This slot is called from the aboutToShow() signal of the default
|
---|
| 636 | dock menu of the mainwindow. The default implementation
|
---|
| 637 | initializes the menu with all dock windows and toolbars in this
|
---|
| 638 | slot.
|
---|
| 639 |
|
---|
| 640 |
|
---|
| 641 | <h3 class=fn><a href="qmenubar.html">QMenuBar</a> * <a name="menuBar"></a>QMainWindow::menuBar () const
|
---|
| 642 | </h3>
|
---|
| 643 | Returns the menu bar for this window.
|
---|
| 644 | <p> If there isn't one, then <a href="#menuBar">menuBar</a>() creates an empty menu bar.
|
---|
| 645 | <p> <p>See also <a href="#statusBar">statusBar</a>().
|
---|
| 646 |
|
---|
| 647 | <h3 class=fn>void <a name="moveDockWindow"></a>QMainWindow::moveDockWindow ( <a href="qdockwindow.html">QDockWindow</a> * dockWindow, <a href="qt.html#Dock-enum">Dock</a> edge = DockTop )<tt> [virtual]</tt>
|
---|
| 648 | </h3>
|
---|
| 649 | Moves <em>dockWindow</em> to the end of the <em>edge</em>.
|
---|
| 650 | <p> For vertical edges the end is at the bottom, for horizontal edges
|
---|
| 651 | (including <a href="qt.html#Dock-enum">Minimized</a>) the end is at the right.
|
---|
| 652 | <p> If <em>dockWindow</em> is managed by another main window, it is first
|
---|
| 653 | removed from that window.
|
---|
| 654 |
|
---|
| 655 | <h3 class=fn>void <a name="moveDockWindow-2"></a>QMainWindow::moveDockWindow ( <a href="qdockwindow.html">QDockWindow</a> * dockWindow, <a href="qt.html#Dock-enum">Dock</a> edge, bool nl, int index, int extraOffset = -1 )<tt> [virtual]</tt>
|
---|
| 656 | </h3>
|
---|
| 657 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 658 | <p> Moves <em>dockWindow</em> to position <em>index</em> within the <em>edge</em> dock
|
---|
| 659 | area.
|
---|
| 660 | <p> Any dock windows with positions <em>index</em> or higher have their
|
---|
| 661 | position number incremented and any of these on the same line are
|
---|
| 662 | moved right (down for vertical dock areas) to make room.
|
---|
| 663 | <p> If <em>nl</em> is TRUE, a new dock window line is created below the line
|
---|
| 664 | in which the moved dock window appears and the moved dock window,
|
---|
| 665 | with any others with higher positions on the same line, is moved
|
---|
| 666 | to this new line.
|
---|
| 667 | <p> The <em>extraOffset</em> is the space to put between the left side of
|
---|
| 668 | the dock area (top side for vertical dock areas) and the dock
|
---|
| 669 | window. (This is mostly used for restoring dock windows to the
|
---|
| 670 | positions the user has dragged them to.)
|
---|
| 671 | <p> If <em>dockWindow</em> is managed by another main window, it is first
|
---|
| 672 | removed from that window.
|
---|
| 673 |
|
---|
| 674 | <h3 class=fn>void <a name="moveToolBar"></a>QMainWindow::moveToolBar ( <a href="qdockwindow.html">QDockWindow</a> *, <a href="qt.html#Dock-enum">Dock</a> = DockTop )
|
---|
| 675 | </h3>
|
---|
| 676 | <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
|
---|
| 677 | <p>
|
---|
| 678 |
|
---|
| 679 | <h3 class=fn>void <a name="moveToolBar-2"></a>QMainWindow::moveToolBar ( <a href="qdockwindow.html">QDockWindow</a> *, <a href="qt.html#Dock-enum">Dock</a>, bool nl, int index, int extraOffset = -1 )
|
---|
| 680 | </h3>
|
---|
| 681 | <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
|
---|
| 682 | <p> This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 683 | <p>
|
---|
| 684 | <h3 class=fn>bool <a name="opaqueMoving"></a>QMainWindow::opaqueMoving () const
|
---|
| 685 | </h3><p>Returns TRUE if dock windows are moved opaquely; otherwise returns FALSE.
|
---|
| 686 | See the <a href="qmainwindow.html#opaqueMoving-prop">"opaqueMoving"</a> property for details.
|
---|
| 687 | <h3 class=fn>void <a name="pixmapSizeChanged"></a>QMainWindow::pixmapSizeChanged ( bool )<tt> [signal]</tt>
|
---|
| 688 | </h3>
|
---|
| 689 |
|
---|
| 690 | <p> This signal is emitted whenever the <a href="#setUsesBigPixmaps">setUsesBigPixmaps</a>() is called
|
---|
| 691 | with a value different to the current setting. All widgets that
|
---|
| 692 | should respond to such changes, e.g. toolbar buttons, must connect
|
---|
| 693 | to this signal.
|
---|
| 694 |
|
---|
| 695 | <h3 class=fn>void <a name="removeDockWindow"></a>QMainWindow::removeDockWindow ( <a href="qdockwindow.html">QDockWindow</a> * dockWindow )<tt> [virtual]</tt>
|
---|
| 696 | </h3>
|
---|
| 697 | Removes <em>dockWindow</em> from the main window's docking area,
|
---|
| 698 | provided <em>dockWindow</em> is non-null and managed by this main
|
---|
| 699 | window.
|
---|
| 700 |
|
---|
| 701 | <h3 class=fn>void <a name="removeToolBar"></a>QMainWindow::removeToolBar ( <a href="qdockwindow.html">QDockWindow</a> * )
|
---|
| 702 | </h3>
|
---|
| 703 | <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
|
---|
| 704 | <p>
|
---|
| 705 |
|
---|
| 706 | <h3 class=fn><a href="qdockarea.html">QDockArea</a> * <a name="rightDock"></a>QMainWindow::rightDock () const
|
---|
| 707 | </h3>
|
---|
| 708 | Returns the <a href="qt.html#Dock-enum">Right</a> dock area
|
---|
| 709 | <p> <p>See also <a href="#leftDock">leftDock</a>(), <a href="#topDock">topDock</a>(), and <a href="#bottomDock">bottomDock</a>().
|
---|
| 710 |
|
---|
| 711 | <h3 class=fn>bool <a name="rightJustification"></a>QMainWindow::rightJustification () const
|
---|
| 712 | </h3><p>Returns TRUE if the main window right-justifies its dock windows; otherwise returns FALSE.
|
---|
| 713 | See the <a href="qmainwindow.html#rightJustification-prop">"rightJustification"</a> property for details.
|
---|
| 714 | <h3 class=fn>void <a name="setAppropriate"></a>QMainWindow::setAppropriate ( <a href="qdockwindow.html">QDockWindow</a> * dw, bool a )<tt> [virtual slot]</tt>
|
---|
| 715 | </h3>
|
---|
| 716 | Use this function to control whether or not the <em>dw</em> dock
|
---|
| 717 | window's caption should appear as a menu item on the dock window
|
---|
| 718 | menu that lists the dock windows.
|
---|
| 719 | <p> If <em>a</em> is TRUE then the <em>dw</em> will appear as a menu item on the
|
---|
| 720 | dock window menu. The user is able to change the state (show or
|
---|
| 721 | hide) a dock window that has a menu item by clicking the item;
|
---|
| 722 | depending on the state of your application, this may or may not be
|
---|
| 723 | appropriate. If <em>a</em> is FALSE the <em>dw</em> will not appear on the
|
---|
| 724 | popup menu.
|
---|
| 725 | <p> <p>See also <a href="#showDockMenu">showDockMenu</a>(), <a href="#isCustomizable">isCustomizable</a>(), and <a href="#customize">customize</a>().
|
---|
| 726 |
|
---|
| 727 | <h3 class=fn>void <a name="setCentralWidget"></a>QMainWindow::setCentralWidget ( <a href="qwidget.html">QWidget</a> * w )<tt> [virtual]</tt>
|
---|
| 728 | </h3>
|
---|
| 729 | Sets the central widget for this main window to <em>w</em>.
|
---|
| 730 | <p> The central widget is surrounded by the left, top, right and
|
---|
| 731 | bottom dock areas. The menu bar is above the top dock area.
|
---|
| 732 | <p> <p>See also <a href="#centralWidget">centralWidget</a>().
|
---|
| 733 |
|
---|
| 734 | <h3 class=fn>void <a name="setDockEnabled"></a>QMainWindow::setDockEnabled ( <a href="qt.html#Dock-enum">Dock</a> dock, bool enable )<tt> [virtual]</tt>
|
---|
| 735 | </h3>
|
---|
| 736 | If <em>enable</em> is TRUE then users can dock windows in the <em>dock</em>
|
---|
| 737 | area. If <em>enable</em> is FALSE users cannot dock windows in the <em>dock</em> dock area.
|
---|
| 738 | <p> Users can dock (drag) dock windows into any enabled dock area.
|
---|
| 739 |
|
---|
| 740 | <h3 class=fn>void <a name="setDockEnabled-2"></a>QMainWindow::setDockEnabled ( <a href="qdockwindow.html">QDockWindow</a> * dw, <a href="qt.html#Dock-enum">Dock</a> dock, bool enable )<tt> [virtual]</tt>
|
---|
| 741 | </h3>
|
---|
| 742 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 743 | <p> If <em>enable</em> is TRUE then users can dock the <em>dw</em> dock window in
|
---|
| 744 | the <em>dock</em> area. If <em>enable</em> is FALSE users cannot dock the <em>dw</em> dock window in the <em>dock</em> area.
|
---|
| 745 | <p> In general users can dock (drag) dock windows into any enabled
|
---|
| 746 | dock area. Using this function particular dock areas can be
|
---|
| 747 | enabled (or disabled) as docking points for particular dock
|
---|
| 748 | windows.
|
---|
| 749 |
|
---|
| 750 | <h3 class=fn>void <a name="setDockMenuEnabled"></a>QMainWindow::setDockMenuEnabled ( bool b )<tt> [virtual slot]</tt>
|
---|
| 751 | </h3>
|
---|
| 752 | If <em>b</em> is TRUE, then right clicking on a dock window or dock area
|
---|
| 753 | will pop up the dock window menu. If <em>b</em> is FALSE, right clicking
|
---|
| 754 | a dock window or dock area will not pop up the menu.
|
---|
| 755 | <p> The menu lists the (<a href="#appropriate">appropriate</a>()) dock windows (which may be
|
---|
| 756 | shown or hidden), and has a "Line Up Dock Windows" item. It will
|
---|
| 757 | also have a "Customize" menu item if <a href="#isCustomizable">isCustomizable</a>() returns
|
---|
| 758 | TRUE.
|
---|
| 759 | <p> <p>See also <a href="#lineUpDockWindows">lineUpDockWindows</a>() and <a href="#isDockMenuEnabled">isDockMenuEnabled</a>().
|
---|
| 760 |
|
---|
| 761 | <h3 class=fn>void <a name="setDockWindowsMovable"></a>QMainWindow::setDockWindowsMovable ( bool )<tt> [virtual slot]</tt>
|
---|
| 762 | </h3><p>Sets whether the dock windows are movable.
|
---|
| 763 | See the <a href="qmainwindow.html#dockWindowsMovable-prop">"dockWindowsMovable"</a> property for details.
|
---|
| 764 | <h3 class=fn>void <a name="setOpaqueMoving"></a>QMainWindow::setOpaqueMoving ( bool )<tt> [virtual slot]</tt>
|
---|
| 765 | </h3><p>Sets whether dock windows are moved opaquely.
|
---|
| 766 | See the <a href="qmainwindow.html#opaqueMoving-prop">"opaqueMoving"</a> property for details.
|
---|
| 767 | <h3 class=fn>void <a name="setRightJustification"></a>QMainWindow::setRightJustification ( bool )<tt> [virtual slot]</tt>
|
---|
| 768 | </h3><p>Sets whether the main window right-justifies its dock windows.
|
---|
| 769 | See the <a href="qmainwindow.html#rightJustification-prop">"rightJustification"</a> property for details.
|
---|
| 770 | <h3 class=fn>void <a name="setToolBarsMovable"></a>QMainWindow::setToolBarsMovable ( bool )<tt> [slot]</tt>
|
---|
| 771 | </h3>
|
---|
| 772 | <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
|
---|
| 773 | <p>
|
---|
| 774 |
|
---|
| 775 | <h3 class=fn>void <a name="setUpLayout"></a>QMainWindow::setUpLayout ()<tt> [virtual protected slot]</tt>
|
---|
| 776 | </h3>
|
---|
| 777 | Sets up the geometry management of the window. It is called
|
---|
| 778 | automatically when needed, so you shouldn't need to call it.
|
---|
| 779 |
|
---|
| 780 | <h3 class=fn>void <a name="setUsesBigPixmaps"></a>QMainWindow::setUsesBigPixmaps ( bool )<tt> [virtual slot]</tt>
|
---|
| 781 | </h3><p>Sets whether big pixmaps are enabled.
|
---|
| 782 | See the <a href="qmainwindow.html#usesBigPixmaps-prop">"usesBigPixmaps"</a> property for details.
|
---|
| 783 | <h3 class=fn>void <a name="setUsesTextLabel"></a>QMainWindow::setUsesTextLabel ( bool )<tt> [virtual slot]</tt>
|
---|
| 784 | </h3><p>Sets whether text labels for toolbar buttons are enabled.
|
---|
| 785 | See the <a href="qmainwindow.html#usesTextLabel-prop">"usesTextLabel"</a> property for details.
|
---|
| 786 | <h3 class=fn>bool <a name="showDockMenu"></a>QMainWindow::showDockMenu ( const <a href="qpoint.html">QPoint</a> & globalPos )<tt> [virtual protected slot]</tt>
|
---|
| 787 | </h3>
|
---|
| 788 | Shows the dock menu at the position <em>globalPos</em>. The menu lists
|
---|
| 789 | the dock windows so that they can be shown (or hidden), lined up,
|
---|
| 790 | and possibly customized. Returns TRUE if the menu is shown;
|
---|
| 791 | otherwise returns FALSE.
|
---|
| 792 | <p> If you want a custom menu, reimplement this function. You can
|
---|
| 793 | create the menu from scratch or call <a href="#createDockWindowMenu">createDockWindowMenu</a>() and
|
---|
| 794 | modify the result.
|
---|
| 795 |
|
---|
| 796 |
|
---|
| 797 | <h3 class=fn><a href="qstatusbar.html">QStatusBar</a> * <a name="statusBar"></a>QMainWindow::statusBar () const
|
---|
| 798 | </h3>
|
---|
| 799 | Returns this main window's status bar. If there isn't one,
|
---|
| 800 | <a href="#statusBar">statusBar</a>() creates an empty status bar, and if necessary a tool
|
---|
| 801 | tip group too.
|
---|
| 802 | <p> <p>See also <a href="#menuBar">menuBar</a>() and <a href="#toolTipGroup">toolTipGroup</a>().
|
---|
| 803 |
|
---|
| 804 | <p>Example: <a href="qfd-example.html#x2015">qfd/qfd.cpp</a>.
|
---|
| 805 | <h3 class=fn>void <a name="toolBarPositionChanged"></a>QMainWindow::toolBarPositionChanged ( <a href="qtoolbar.html">QToolBar</a> * )<tt> [signal]</tt>
|
---|
| 806 | </h3>
|
---|
| 807 | <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
|
---|
| 808 | <p>
|
---|
| 809 |
|
---|
| 810 | <h3 class=fn><a href="qptrlist.html">QPtrList</a><QToolBar> <a name="toolBars"></a>QMainWindow::toolBars ( <a href="qt.html#Dock-enum">Dock</a> dock ) const
|
---|
| 811 | </h3>
|
---|
| 812 | Returns a list of all the toolbars which are in the <em>dock</em> dock
|
---|
| 813 | area, regardless of their state.
|
---|
| 814 | <p> For example, the <a href="qt.html#Dock-enum">TornOff</a> dock area may contain closed toolbars
|
---|
| 815 | but these are returned along with the visible toolbars.
|
---|
| 816 | <p> <p>See also <a href="#dockWindows">dockWindows</a>().
|
---|
| 817 |
|
---|
| 818 | <h3 class=fn>bool <a name="toolBarsMovable"></a>QMainWindow::toolBarsMovable () const
|
---|
| 819 | </h3>
|
---|
| 820 | <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
|
---|
| 821 | <p>
|
---|
| 822 |
|
---|
| 823 | <h3 class=fn><a href="qtooltipgroup.html">QToolTipGroup</a> * <a name="toolTipGroup"></a>QMainWindow::toolTipGroup () const
|
---|
| 824 | </h3>
|
---|
| 825 | Returns this main window's tool tip group. If there isn't one,
|
---|
| 826 | <a href="#toolTipGroup">toolTipGroup</a>() creates an empty tool tip group.
|
---|
| 827 | <p> <p>See also <a href="#menuBar">menuBar</a>() and <a href="#statusBar">statusBar</a>().
|
---|
| 828 |
|
---|
| 829 | <h3 class=fn><a href="qdockarea.html">QDockArea</a> * <a name="topDock"></a>QMainWindow::topDock () const
|
---|
| 830 | </h3>
|
---|
| 831 | Returns the <a href="qt.html#Dock-enum">Top</a> dock area
|
---|
| 832 | <p> <p>See also <a href="#bottomDock">bottomDock</a>(), <a href="#leftDock">leftDock</a>(), and <a href="#rightDock">rightDock</a>().
|
---|
| 833 |
|
---|
| 834 | <h3 class=fn>bool <a name="usesBigPixmaps"></a>QMainWindow::usesBigPixmaps () const
|
---|
| 835 | </h3><p>Returns TRUE if big pixmaps are enabled; otherwise returns FALSE.
|
---|
| 836 | See the <a href="qmainwindow.html#usesBigPixmaps-prop">"usesBigPixmaps"</a> property for details.
|
---|
| 837 | <h3 class=fn>bool <a name="usesTextLabel"></a>QMainWindow::usesTextLabel () const
|
---|
| 838 | </h3><p>Returns TRUE if text labels for toolbar buttons are enabled; otherwise returns FALSE.
|
---|
| 839 | See the <a href="qmainwindow.html#usesTextLabel-prop">"usesTextLabel"</a> property for details.
|
---|
| 840 | <h3 class=fn>void <a name="usesTextLabelChanged"></a>QMainWindow::usesTextLabelChanged ( bool )<tt> [signal]</tt>
|
---|
| 841 | </h3>
|
---|
| 842 |
|
---|
| 843 | <p> This signal is emitted whenever the <a href="#setUsesTextLabel">setUsesTextLabel</a>() is called
|
---|
| 844 | with a value different to the current setting. All widgets that
|
---|
| 845 | should respond to such changes, e.g. toolbar buttons, must connect
|
---|
| 846 | to this signal.
|
---|
| 847 |
|
---|
| 848 | <h3 class=fn>void <a name="whatsThis"></a>QMainWindow::whatsThis ()<tt> [virtual slot]</tt>
|
---|
| 849 | </h3>
|
---|
| 850 | Enters 'What's This?' mode and returns immediately.
|
---|
| 851 | <p> This is the same as <a href="qwhatsthis.html#enterWhatsThisMode">QWhatsThis::enterWhatsThisMode</a>(), but
|
---|
| 852 | implemented as a main window object's slot. This way it can easily
|
---|
| 853 | be used for popup menus, for example:
|
---|
| 854 | <p> <pre>
|
---|
| 855 | <a href="qpopupmenu.html">QPopupMenu</a> * help = new <a href="qpopupmenu.html">QPopupMenu</a>( this );
|
---|
| 856 | help-><a href="qmenudata.html#insertItem">insertItem</a>( "What's &This", this , SLOT(<a href="#whatsThis">whatsThis</a>()), SHIFT+Key_F1);
|
---|
| 857 | </pre>
|
---|
| 858 |
|
---|
| 859 | <p> <p>See also <a href="qwhatsthis.html#enterWhatsThisMode">QWhatsThis::enterWhatsThisMode</a>().
|
---|
| 860 |
|
---|
| 861 | <hr><h2>Property Documentation</h2>
|
---|
| 862 | <h3 class=fn>bool <a name="dockWindowsMovable-prop"></a>dockWindowsMovable</h3>
|
---|
| 863 | <p>This property holds whether the dock windows are movable.
|
---|
| 864 | <p>If TRUE (the default), the user will be able to move movable dock
|
---|
| 865 | windows from one QMainWindow dock area to another, including the
|
---|
| 866 | <tt>TearOff</tt> area (i.e. where the dock window floats freely as a
|
---|
| 867 | window in its own right), and the <a href="qt.html#Dock-enum">Minimized</a> area (where only
|
---|
| 868 | the dock window's handle is shown below the menu bar). Moveable
|
---|
| 869 | dock windows can also be moved within QMainWindow dock areas, i.e.
|
---|
| 870 | to rearrange them within a dock area.
|
---|
| 871 | <p> If FALSE the user will not be able to move any dock windows.
|
---|
| 872 | <p> By default dock windows are moved transparently (i.e. only an
|
---|
| 873 | outline rectangle is shown during the drag), but this setting can
|
---|
| 874 | be changed with <a href="#setOpaqueMoving">setOpaqueMoving</a>().
|
---|
| 875 | <p> <p>See also <a href="#setDockEnabled">setDockEnabled</a>() and <a href="#opaqueMoving-prop">opaqueMoving</a>.
|
---|
| 876 |
|
---|
| 877 | <p>Set this property's value with <a href="#setDockWindowsMovable">setDockWindowsMovable</a>() and get this property's value with <a href="#dockWindowsMovable">dockWindowsMovable</a>().
|
---|
| 878 | <h3 class=fn>bool <a name="opaqueMoving-prop"></a>opaqueMoving</h3>
|
---|
| 879 | <p>This property holds whether dock windows are moved opaquely.
|
---|
| 880 | <p>If TRUE the dock windows of the main window are shown opaquely
|
---|
| 881 | (i.e. it shows the toolbar as it looks when docked) whilst it is
|
---|
| 882 | being moved. If FALSE (the default) they are shown transparently,
|
---|
| 883 | (i.e. as an outline rectangle).
|
---|
| 884 | <p> <b>Warning:</b> Opaque moving of toolbars and dockwindows is known to
|
---|
| 885 | have several problems. We recommend avoiding the use of this
|
---|
| 886 | feature for the time being. We intend fixing the problems in a
|
---|
| 887 | future release.
|
---|
| 888 |
|
---|
| 889 | <p>Set this property's value with <a href="#setOpaqueMoving">setOpaqueMoving</a>() and get this property's value with <a href="#opaqueMoving">opaqueMoving</a>().
|
---|
| 890 | <h3 class=fn>bool <a name="rightJustification-prop"></a>rightJustification</h3>
|
---|
| 891 | <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
|
---|
| 892 | <p> <p>This property holds whether the main window right-justifies its dock windows.
|
---|
| 893 | <p>If disabled (the default), stretchable dock windows are expanded,
|
---|
| 894 | and non-stretchable dock windows are given the minimum space they
|
---|
| 895 | need. Since most dock windows are not stretchable, this usually
|
---|
| 896 | results in an unjustified right edge (or unjustified bottom edge
|
---|
| 897 | for a vertical dock area). If enabled, the main window will
|
---|
| 898 | right-justify its dock windows.
|
---|
| 899 | <p> <p>See also <a href="qdockwindow.html#setVerticalStretchable">QDockWindow::setVerticalStretchable</a>() and <a href="qdockwindow.html#setHorizontalStretchable">QDockWindow::setHorizontalStretchable</a>().
|
---|
| 900 |
|
---|
| 901 | <p>Set this property's value with <a href="#setRightJustification">setRightJustification</a>() and get this property's value with <a href="#rightJustification">rightJustification</a>().
|
---|
| 902 | <h3 class=fn>bool <a name="usesBigPixmaps-prop"></a>usesBigPixmaps</h3>
|
---|
| 903 | <p>This property holds whether big pixmaps are enabled.
|
---|
| 904 | <p>If FALSE (the default), the tool buttons will use small pixmaps;
|
---|
| 905 | otherwise big pixmaps will be used.
|
---|
| 906 | <p> Tool buttons and other widgets that wish to respond to this
|
---|
| 907 | setting are responsible for reading the correct state on startup,
|
---|
| 908 | and for connecting to the main window's widget's
|
---|
| 909 | <a href="#pixmapSizeChanged">pixmapSizeChanged</a>() signal.
|
---|
| 910 |
|
---|
| 911 | <p>Set this property's value with <a href="#setUsesBigPixmaps">setUsesBigPixmaps</a>() and get this property's value with <a href="#usesBigPixmaps">usesBigPixmaps</a>().
|
---|
| 912 | <h3 class=fn>bool <a name="usesTextLabel-prop"></a>usesTextLabel</h3>
|
---|
| 913 | <p>This property holds whether text labels for toolbar buttons are enabled.
|
---|
| 914 | <p>If disabled (the default), the tool buttons will not use text
|
---|
| 915 | labels. If enabled, text labels will be used.
|
---|
| 916 | <p> Tool buttons and other widgets that wish to respond to this
|
---|
| 917 | setting are responsible for reading the correct state on startup,
|
---|
| 918 | and for connecting to the main window's widget's
|
---|
| 919 | <a href="#usesTextLabelChanged">usesTextLabelChanged</a>() signal.
|
---|
| 920 | <p> <p>See also <a href="qtoolbutton.html#usesTextLabel-prop">QToolButton::usesTextLabel</a>.
|
---|
| 921 |
|
---|
| 922 | <p>Set this property's value with <a href="#setUsesTextLabel">setUsesTextLabel</a>() and get this property's value with <a href="#usesTextLabel">usesTextLabel</a>().
|
---|
| 923 | <hr><h2>Related Functions</h2>
|
---|
| 924 | <h3 class=fn><a href="qtextstream.html">QTextStream</a> & <a name="operator-lt-lt"></a>operator<< ( <a href="qtextstream.html">QTextStream</a> & ts, const <a href="qmainwindow.html">QMainWindow</a> & mainWindow )
|
---|
| 925 | </h3>
|
---|
| 926 |
|
---|
| 927 | <p> Writes the layout (sizes and positions) of the dock windows in the
|
---|
| 928 | dock areas of the QMainWindow <em>mainWindow</em>, including <a href="qt.html#Dock-enum">Minimized</a> and <a href="qt.html#Dock-enum">TornOff</a> dock windows, to the text stream <em>ts</em>.
|
---|
| 929 | <p> This can be used, for example, in conjunction with <a href="qsettings.html">QSettings</a> to
|
---|
| 930 | save the user's layout when the \mainWindow receives a closeEvent.
|
---|
| 931 | <p> <p>See also <a href="#operator-gt-gt">operator>></a>() and <a href="qwidget.html#closeEvent">closeEvent</a>().
|
---|
| 932 |
|
---|
| 933 | <h3 class=fn><a href="qtextstream.html">QTextStream</a> & <a name="operator-gt-gt"></a>operator>> ( <a href="qtextstream.html">QTextStream</a> & ts, <a href="qmainwindow.html">QMainWindow</a> & mainWindow )
|
---|
| 934 | </h3>
|
---|
| 935 |
|
---|
| 936 | <p> Reads the layout (sizes and positions) of the dock windows in the
|
---|
| 937 | dock areas of the QMainWindow <em>mainWindow</em> from the text stream,
|
---|
| 938 | <em>ts</em>, including <a href="qt.html#Dock-enum">Minimized</a> and <a href="qt.html#Dock-enum">TornOff</a> dock windows.
|
---|
| 939 | Restores the dock windows and dock areas to these sizes and
|
---|
| 940 | positions. The layout information must be in the format produced
|
---|
| 941 | by <a href="#operator-lt-lt">operator<<</a>().
|
---|
| 942 | <p> This can be used, for example, in conjunction with <a href="qsettings.html">QSettings</a> to
|
---|
| 943 | restore the user's layout.
|
---|
| 944 | <p> <p>See also <a href="#operator-lt-lt">operator<<</a>().
|
---|
| 945 |
|
---|
| 946 | <!-- eof -->
|
---|
| 947 | <hr><p>
|
---|
| 948 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
| 949 | Copyright © 1995-2007
|
---|
| 950 | <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
---|
| 951 | <table width=100% cellspacing=0 border=0><tr>
|
---|
| 952 | <td>Copyright © 2007
|
---|
| 953 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
| 954 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
| 955 | </table></div></address></body>
|
---|
| 956 | </html>
|
---|