| 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/include/qmainwindow.h:1 --> | 
|---|
| 3 | <html> | 
|---|
| 4 | <head> | 
|---|
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> | 
|---|
| 6 | <title>qmainwindow.h Include File</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.h</h1> | 
|---|
| 33 |  | 
|---|
| 34 | <p>This is the verbatim text of the qmainwindow.h include file. It is provided only for illustration; the copyright remains with Trolltech. | 
|---|
| 35 | <hr> | 
|---|
| 36 | <pre> | 
|---|
| 37 | /**************************************************************************** | 
|---|
| 38 | ** $Id: qmainwindow-h.html 2051 2007-02-21 10:04:20Z chehrlic $ | 
|---|
| 39 | ** | 
|---|
| 40 | ** Definition of QMainWindow class | 
|---|
| 41 | ** | 
|---|
| 42 | ** Created : 980316 | 
|---|
| 43 | ** | 
|---|
| 44 | ** Copyright (C) 1992-2007 Trolltech ASA.  All rights reserved. | 
|---|
| 45 | ** | 
|---|
| 46 | ** This file is part of the widgets module of the Qt GUI Toolkit. | 
|---|
| 47 | ** | 
|---|
| 48 | ** This file may be distributed under the terms of the Q Public License | 
|---|
| 49 | ** as defined by Trolltech ASA of Norway and appearing in the file | 
|---|
| 50 | ** LICENSE.QPL included in the packaging of this file. | 
|---|
| 51 | ** | 
|---|
| 52 | ** This file may be distributed and/or modified under the terms of the | 
|---|
| 53 | ** GNU General Public License version 2 as published by the Free Software | 
|---|
| 54 | ** Foundation and appearing in the file LICENSE.GPL included in the | 
|---|
| 55 | ** packaging of this file. | 
|---|
| 56 | ** | 
|---|
| 57 | ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition | 
|---|
| 58 | ** licenses may use this file in accordance with the Qt Commercial License | 
|---|
| 59 | ** Agreement provided with the Software. | 
|---|
| 60 | ** | 
|---|
| 61 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 
|---|
| 62 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 
|---|
| 63 | ** | 
|---|
| 64 | ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for | 
|---|
| 65 | **   information about Qt Commercial License Agreements. | 
|---|
| 66 | ** See http://www.trolltech.com/qpl/ for QPL licensing information. | 
|---|
| 67 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 
|---|
| 68 | ** | 
|---|
| 69 | ** Contact info@trolltech.com if any conditions of this licensing are | 
|---|
| 70 | ** not clear to you. | 
|---|
| 71 | ** | 
|---|
| 72 | **********************************************************************/ | 
|---|
| 73 |  | 
|---|
| 74 | #ifndef QMAINWINDOW_H | 
|---|
| 75 | #define QMAINWINDOW_H | 
|---|
| 76 |  | 
|---|
| 77 | #ifndef QT_H | 
|---|
| 78 | #include "qwidget.h" | 
|---|
| 79 | #include "qtoolbar.h" | 
|---|
| 80 | #include "qptrlist.h" | 
|---|
| 81 | #include "qtextstream.h" | 
|---|
| 82 | #endif // QT_H | 
|---|
| 83 |  | 
|---|
| 84 | #ifndef QT_NO_MAINWINDOW | 
|---|
| 85 |  | 
|---|
| 86 | class QMenuBar; | 
|---|
| 87 | class QStatusBar; | 
|---|
| 88 | class QToolTipGroup; | 
|---|
| 89 | class QMainWindowPrivate; | 
|---|
| 90 | class QMainWindowLayout; | 
|---|
| 91 | class QPopupMenu; | 
|---|
| 92 |  | 
|---|
| 93 | class Q_EXPORT QMainWindow: public QWidget | 
|---|
| 94 | { | 
|---|
| 95 | Q_OBJECT | 
|---|
| 96 | Q_PROPERTY( bool rightJustification READ rightJustification WRITE setRightJustification DESIGNABLE false ) | 
|---|
| 97 | Q_PROPERTY( bool usesBigPixmaps READ usesBigPixmaps WRITE setUsesBigPixmaps ) | 
|---|
| 98 | Q_PROPERTY( bool usesTextLabel READ usesTextLabel WRITE setUsesTextLabel ) | 
|---|
| 99 | Q_PROPERTY( bool dockWindowsMovable READ dockWindowsMovable WRITE setDockWindowsMovable ) | 
|---|
| 100 | Q_PROPERTY( bool opaqueMoving READ opaqueMoving WRITE setOpaqueMoving ) | 
|---|
| 101 |  | 
|---|
| 102 | public: | 
|---|
| 103 | QMainWindow( QWidget* parent=0, const char* name=0, WFlags f = WType_TopLevel ); | 
|---|
| 104 | ~QMainWindow(); | 
|---|
| 105 |  | 
|---|
| 106 | #ifndef QT_NO_MENUBAR | 
|---|
| 107 | QMenuBar * menuBar() const; | 
|---|
| 108 | #endif | 
|---|
| 109 | QStatusBar * statusBar() const; | 
|---|
| 110 | #ifndef QT_NO_TOOLTIP | 
|---|
| 111 | QToolTipGroup * toolTipGroup() const; | 
|---|
| 112 | #endif | 
|---|
| 113 |  | 
|---|
| 114 | virtual void setCentralWidget( QWidget * ); | 
|---|
| 115 | QWidget * centralWidget() const; | 
|---|
| 116 |  | 
|---|
| 117 | virtual void setDockEnabled( Dock dock, bool enable ); | 
|---|
| 118 | bool isDockEnabled( Dock dock ) const; | 
|---|
| 119 | bool isDockEnabled( QDockArea *area ) const; | 
|---|
| 120 | virtual void setDockEnabled( QDockWindow *tb, Dock dock, bool enable ); | 
|---|
| 121 | bool isDockEnabled( QDockWindow *tb, Dock dock ) const; | 
|---|
| 122 | bool isDockEnabled( QDockWindow *tb, QDockArea *area ) const; | 
|---|
| 123 |  | 
|---|
| 124 | virtual void addDockWindow( QDockWindow *, Dock = DockTop, bool newLine = FALSE ); | 
|---|
| 125 | virtual void addDockWindow( QDockWindow *, const QString &label, | 
|---|
| 126 | Dock = DockTop, bool newLine = FALSE ); | 
|---|
| 127 | virtual void moveDockWindow( QDockWindow *, Dock = DockTop ); | 
|---|
| 128 | virtual void moveDockWindow( QDockWindow *, Dock, bool nl, int index, int extraOffset = -1 ); | 
|---|
| 129 | virtual void removeDockWindow( QDockWindow * ); | 
|---|
| 130 |  | 
|---|
| 131 | void show(); | 
|---|
| 132 | void hide(); | 
|---|
| 133 | QSize sizeHint() const; | 
|---|
| 134 | QSize minimumSizeHint() const; | 
|---|
| 135 |  | 
|---|
| 136 | bool rightJustification() const; | 
|---|
| 137 | bool usesBigPixmaps() const; | 
|---|
| 138 | bool usesTextLabel() const; | 
|---|
| 139 | bool dockWindowsMovable() const; | 
|---|
| 140 | bool opaqueMoving() const; | 
|---|
| 141 |  | 
|---|
| 142 | bool eventFilter( QObject*, QEvent* ); | 
|---|
| 143 |  | 
|---|
| 144 | bool getLocation( QDockWindow *tb, Dock &dock, int &index, bool &nl, int &extraOffset ) const; | 
|---|
| 145 |  | 
|---|
| 146 | QPtrList<QDockWindow> dockWindows( Dock dock ) const; | 
|---|
| 147 | QPtrList<QDockWindow> dockWindows() const; | 
|---|
| 148 | void lineUpDockWindows( bool keepNewLines = FALSE ); | 
|---|
| 149 |  | 
|---|
| 150 | bool isDockMenuEnabled() const; | 
|---|
| 151 |  | 
|---|
| 152 | // compatibility stuff | 
|---|
| 153 | bool hasDockWindow( QDockWindow *dw ); | 
|---|
| 154 | #ifndef QT_NO_TOOLBAR | 
|---|
| 155 | void addToolBar( QDockWindow *, Dock = DockTop, bool newLine = FALSE ); | 
|---|
| 156 | void addToolBar( QDockWindow *, const QString &label, | 
|---|
| 157 | Dock = DockTop, bool newLine = FALSE ); | 
|---|
| 158 | void moveToolBar( QDockWindow *, Dock = DockTop ); | 
|---|
| 159 | void moveToolBar( QDockWindow *, Dock, bool nl, int index, int extraOffset = -1 ); | 
|---|
| 160 | void removeToolBar( QDockWindow * ); | 
|---|
| 161 |  | 
|---|
| 162 | bool toolBarsMovable() const; | 
|---|
| 163 | QPtrList<QToolBar> toolBars( Dock dock ) const; | 
|---|
| 164 | void lineUpToolBars( bool keepNewLines = FALSE ); | 
|---|
| 165 | #endif | 
|---|
| 166 |  | 
|---|
| 167 | virtual QDockArea *dockingArea( const QPoint &p ); | 
|---|
| 168 | QDockArea *leftDock() const; | 
|---|
| 169 | QDockArea *rightDock() const; | 
|---|
| 170 | QDockArea *topDock() const; | 
|---|
| 171 | QDockArea *bottomDock() const; | 
|---|
| 172 |  | 
|---|
| 173 | virtual bool isCustomizable() const; | 
|---|
| 174 |  | 
|---|
| 175 | bool appropriate( QDockWindow *dw ) const; | 
|---|
| 176 |  | 
|---|
| 177 | enum DockWindows { OnlyToolBars, NoToolBars, AllDockWindows }; | 
|---|
| 178 | QPopupMenu *createDockWindowMenu( DockWindows dockWindows = AllDockWindows ) const; | 
|---|
| 179 |  | 
|---|
| 180 | public slots: | 
|---|
| 181 | virtual void setRightJustification( bool ); | 
|---|
| 182 | virtual void setUsesBigPixmaps( bool ); | 
|---|
| 183 | virtual void setUsesTextLabel( bool ); | 
|---|
| 184 | virtual void setDockWindowsMovable( bool ); | 
|---|
| 185 | virtual void setOpaqueMoving( bool ); | 
|---|
| 186 | virtual void setDockMenuEnabled( bool ); | 
|---|
| 187 | virtual void whatsThis(); | 
|---|
| 188 | virtual void setAppropriate( QDockWindow *dw, bool a ); | 
|---|
| 189 | virtual void customize(); | 
|---|
| 190 |  | 
|---|
| 191 | // compatibility stuff | 
|---|
| 192 | void setToolBarsMovable( bool ); | 
|---|
| 193 |  | 
|---|
| 194 | signals: | 
|---|
| 195 | void pixmapSizeChanged( bool ); | 
|---|
| 196 | void usesTextLabelChanged( bool ); | 
|---|
| 197 | void dockWindowPositionChanged( QDockWindow * ); | 
|---|
| 198 |  | 
|---|
| 199 | #ifndef QT_NO_TOOLBAR | 
|---|
| 200 | // compatibility stuff | 
|---|
| 201 | void toolBarPositionChanged( QToolBar * ); | 
|---|
| 202 | #endif | 
|---|
| 203 |  | 
|---|
| 204 | protected slots: | 
|---|
| 205 | virtual void setUpLayout(); | 
|---|
| 206 | virtual bool showDockMenu( const QPoint &globalPos ); | 
|---|
| 207 | void menuAboutToShow(); | 
|---|
| 208 |  | 
|---|
| 209 | protected: | 
|---|
| 210 | void paintEvent( QPaintEvent * ); | 
|---|
| 211 | void childEvent( QChildEvent * ); | 
|---|
| 212 | bool event( QEvent * ); | 
|---|
| 213 | void styleChange( QStyle& ); | 
|---|
| 214 |  | 
|---|
| 215 | private slots: | 
|---|
| 216 | void slotPlaceChanged(); | 
|---|
| 217 | void doLineUp() { lineUpDockWindows( TRUE ); } | 
|---|
| 218 |  | 
|---|
| 219 | private: | 
|---|
| 220 | QMainWindowPrivate * d; | 
|---|
| 221 | void triggerLayout( bool deleteLayout = TRUE); | 
|---|
| 222 | bool dockMainWindow( QObject *dock ); | 
|---|
| 223 |  | 
|---|
| 224 | #ifndef QT_NO_MENUBAR | 
|---|
| 225 | virtual void setMenuBar( QMenuBar * ); | 
|---|
| 226 | #endif | 
|---|
| 227 | virtual void setStatusBar( QStatusBar * ); | 
|---|
| 228 | #ifndef QT_NO_TOOLTIP | 
|---|
| 229 | virtual void setToolTipGroup( QToolTipGroup * ); | 
|---|
| 230 | #endif | 
|---|
| 231 |  | 
|---|
| 232 | friend class QDockWindow; | 
|---|
| 233 | friend class QMenuBar; | 
|---|
| 234 | friend class QHideDock; | 
|---|
| 235 | friend class QToolBar; | 
|---|
| 236 | friend class QMainWindowLayout; | 
|---|
| 237 | private:        // Disabled copy constructor and operator= | 
|---|
| 238 | #if defined(Q_DISABLE_COPY) | 
|---|
| 239 | QMainWindow( const QMainWindow & ); | 
|---|
| 240 | QMainWindow& operator=( const QMainWindow & ); | 
|---|
| 241 | #endif | 
|---|
| 242 | }; | 
|---|
| 243 |  | 
|---|
| 244 | #ifndef QT_NO_TOOLBAR | 
|---|
| 245 | inline void QMainWindow::addToolBar( QDockWindow *w, ToolBarDock dock, bool newLine ) | 
|---|
| 246 | { | 
|---|
| 247 | addDockWindow( w, dock, newLine ); | 
|---|
| 248 | } | 
|---|
| 249 |  | 
|---|
| 250 | inline void QMainWindow::addToolBar( QDockWindow *w, const QString &label, | 
|---|
| 251 | ToolBarDock dock, bool newLine ) | 
|---|
| 252 | { | 
|---|
| 253 | addDockWindow( w, label, dock, newLine ); | 
|---|
| 254 | } | 
|---|
| 255 |  | 
|---|
| 256 | inline void QMainWindow::moveToolBar( QDockWindow *w, ToolBarDock dock ) | 
|---|
| 257 | { | 
|---|
| 258 | moveDockWindow( w, dock ); | 
|---|
| 259 | } | 
|---|
| 260 |  | 
|---|
| 261 | inline void QMainWindow::moveToolBar( QDockWindow *w, ToolBarDock dock, bool nl, int index, int extraOffset ) | 
|---|
| 262 | { | 
|---|
| 263 | moveDockWindow( w, dock, nl, index, extraOffset ); | 
|---|
| 264 | } | 
|---|
| 265 |  | 
|---|
| 266 | inline void QMainWindow::removeToolBar( QDockWindow *w ) | 
|---|
| 267 | { | 
|---|
| 268 | removeDockWindow( w ); | 
|---|
| 269 | } | 
|---|
| 270 |  | 
|---|
| 271 | inline bool QMainWindow::toolBarsMovable() const | 
|---|
| 272 | { | 
|---|
| 273 | return dockWindowsMovable(); | 
|---|
| 274 | } | 
|---|
| 275 |  | 
|---|
| 276 | inline void QMainWindow::lineUpToolBars( bool keepNewLines ) | 
|---|
| 277 | { | 
|---|
| 278 | lineUpDockWindows( keepNewLines ); | 
|---|
| 279 | } | 
|---|
| 280 |  | 
|---|
| 281 | inline void QMainWindow::setToolBarsMovable( bool b ) | 
|---|
| 282 | { | 
|---|
| 283 | setDockWindowsMovable( b ); | 
|---|
| 284 | } | 
|---|
| 285 | #endif | 
|---|
| 286 |  | 
|---|
| 287 | #ifndef QT_NO_TEXTSTREAM | 
|---|
| 288 | Q_EXPORT QTextStream &operator<<( QTextStream &, const QMainWindow & ); | 
|---|
| 289 | Q_EXPORT QTextStream &operator>>( QTextStream &, QMainWindow & ); | 
|---|
| 290 | #endif | 
|---|
| 291 |  | 
|---|
| 292 | #endif // QT_NO_MAINWINDOW | 
|---|
| 293 |  | 
|---|
| 294 | #endif // QMAINWINDOW_H | 
|---|
| 295 | </pre> | 
|---|
| 296 | <!-- eof --> | 
|---|
| 297 | <p><address><hr><div align=center> | 
|---|
| 298 | <table width=100% cellspacing=0 border=0><tr> | 
|---|
| 299 | <td>Copyright © 2007 | 
|---|
| 300 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a> | 
|---|
| 301 | <td align=right><div align=right>Qt 3.3.8</div> | 
|---|
| 302 | </table></div></address></body> | 
|---|
| 303 | </html> | 
|---|