src/gui/widgets/qmainwindow.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 **
00003 ** Copyright (C) 1992-2006 Trolltech ASA. All rights reserved.
00004 **
00005 ** This file is part of the QtGui module of the Qt Toolkit.
00006 **
00007 ** This file may be used under the terms of the GNU General Public
00008 ** License version 2.0 as published by the Free Software Foundation
00009 ** and appearing in the file LICENSE.GPL included in the packaging of
00010 ** this file.  Please review the following information to ensure GNU
00011 ** General Public Licensing requirements will be met:
00012 ** http://www.trolltech.com/products/qt/opensource.html
00013 **
00014 ** If you are unsure which license is appropriate for your use, please
00015 ** review the following information:
00016 ** http://www.trolltech.com/products/qt/licensing.html or contact the
00017 ** sales department at sales@trolltech.com.
00018 **
00019 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00020 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00021 **
00022 ****************************************************************************/
00023 
00024 #ifndef QDYNAMICMAINWINDOW_H
00025 #define QDYNAMICMAINWINDOW_H
00026 
00027 #include <QtGui/qwidget.h>
00028 
00029 QT_BEGIN_HEADER
00030 
00031 QT_MODULE(Gui)
00032 
00033 #ifndef QT_NO_MAINWINDOW
00034 
00035 class QDockWidget;
00036 class QMainWindowPrivate;
00037 class QMenuBar;
00038 class QStatusBar;
00039 class QToolBar;
00040 class QMenu;
00041 
00042 class Q_GUI_EXPORT QMainWindow : public QWidget
00043 {
00044     Q_OBJECT
00045 
00046     Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize)
00047     Q_PROPERTY(Qt::ToolButtonStyle toolButtonStyle READ toolButtonStyle WRITE setToolButtonStyle)
00048 #ifndef QT_NO_DOCKWIDGET
00049     Q_PROPERTY(bool animated READ isAnimated WRITE setAnimated)
00050     Q_PROPERTY(bool dockNestingEnabled READ isDockNestingEnabled WRITE setDockNestingEnabled)
00051 #endif
00052 
00053 public:
00054     explicit QMainWindow(QWidget *parent = 0, Qt::WindowFlags flags = 0);
00055     ~QMainWindow();
00056 
00057     QSize iconSize() const;
00058     void setIconSize(const QSize &iconSize);
00059 
00060     Qt::ToolButtonStyle toolButtonStyle() const;
00061     void setToolButtonStyle(Qt::ToolButtonStyle toolButtonStyle);
00062 
00063     bool isAnimated() const;
00064     bool isDockNestingEnabled() const;
00065 
00066     bool isSeparator(const QPoint &pos) const;
00067 
00068 #ifndef QT_NO_MENUBAR
00069     QMenuBar *menuBar() const;
00070     void setMenuBar(QMenuBar *menubar);
00071 
00072     QWidget  *menuWidget() const;
00073     void setMenuWidget(QWidget *menubar);
00074 #endif
00075 
00076 #ifndef QT_NO_STATUSBAR
00077     QStatusBar *statusBar() const;
00078     void setStatusBar(QStatusBar *statusbar);
00079 #endif
00080 
00081     QWidget *centralWidget() const;
00082     void setCentralWidget(QWidget *widget);
00083 
00084 #ifndef QT_NO_DOCKWIDGET
00085     void setCorner(Qt::Corner corner, Qt::DockWidgetArea area);
00086     Qt::DockWidgetArea corner(Qt::Corner corner) const;
00087 #endif
00088 
00089 #ifndef QT_NO_TOOLBAR
00090     void addToolBarBreak(Qt::ToolBarArea area = Qt::TopToolBarArea);
00091     void insertToolBarBreak(QToolBar *before);
00092 
00093     void addToolBar(Qt::ToolBarArea area, QToolBar *toolbar);
00094     void addToolBar(QToolBar *toolbar);
00095     QToolBar *addToolBar(const QString &title);
00096     void insertToolBar(QToolBar *before, QToolBar *toolbar);
00097     void removeToolBar(QToolBar *toolbar);
00098 
00099     Qt::ToolBarArea toolBarArea(QToolBar *toolbar) const;
00100 #endif
00101 #ifndef QT_NO_DOCKWIDGET
00102     void addDockWidget(Qt::DockWidgetArea area, QDockWidget *dockwidget);
00103     void addDockWidget(Qt::DockWidgetArea area, QDockWidget *dockwidget,
00104                        Qt::Orientation orientation);
00105     void splitDockWidget(QDockWidget *after, QDockWidget *dockwidget,
00106                          Qt::Orientation orientation);
00107     void tabifyDockWidget(QDockWidget *first, QDockWidget *second);
00108     void removeDockWidget(QDockWidget *dockwidget);
00109 
00110     Qt::DockWidgetArea dockWidgetArea(QDockWidget *dockwidget) const;
00111 #endif // QT_NO_DOCKWIDGET
00112 
00113     QByteArray saveState(int version = 0) const;
00114     bool restoreState(const QByteArray &state, int version = 0);
00115 
00116 #ifndef QT_NO_MENU
00117     virtual QMenu *createPopupMenu();
00118 #endif
00119 
00120 #ifdef QT3_SUPPORT
00121     QT3_SUPPORT_CONSTRUCTOR QMainWindow(QWidget *parent, const char *name, Qt::WindowFlags flags = 0);
00122 #endif
00123 
00124 #ifndef QT_NO_DOCKWIDGET
00125 public Q_SLOTS:
00126     void setAnimated(bool enabled);
00127     void setDockNestingEnabled(bool enabled);
00128 #endif
00129 
00130 Q_SIGNALS:
00131     void iconSizeChanged(const QSize &iconSize);
00132     void toolButtonStyleChanged(Qt::ToolButtonStyle toolButtonStyle);
00133 
00134 protected:
00135     void contextMenuEvent(QContextMenuEvent *event);
00136     bool event(QEvent *event);
00137 
00138 private:
00139     Q_DECLARE_PRIVATE(QMainWindow)
00140     Q_DISABLE_COPY(QMainWindow)
00141 };
00142 
00143 #endif // QT_NO_MAINWINDOW
00144 
00145 QT_END_HEADER
00146 
00147 #endif // QDYNAMICMAINWINDOW_H

Generated on Thu Mar 15 11:57:01 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1