demos/mainwindow/toolbar.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 **
00003 ** Copyright (C) 2004-2006 Trolltech ASA. All rights reserved.
00004 **
00005 ** This file is part of the demonstration applications 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 TOOLBAR_H
00025 #define TOOLBAR_H
00026 
00027 #include <QToolBar>
00028 
00029 class QAction;
00030 class QActionGroup;
00031 class QMenu;
00032 class QSpinBox;
00033 
00034 class ToolBar : public QToolBar
00035 {
00036     Q_OBJECT
00037 
00038     QSpinBox *spinbox;
00039     QAction *spinboxAction;
00040 
00041     QAction *orderAction;
00042     QAction *randomizeAction;
00043     QAction *addSpinBoxAction;
00044     QAction *removeSpinBoxAction;
00045 
00046     QAction *movableAction;
00047 
00048     QActionGroup *allowedAreasActions;
00049     QAction *allowLeftAction;
00050     QAction *allowRightAction;
00051     QAction *allowTopAction;
00052     QAction *allowBottomAction;
00053 
00054     QActionGroup *areaActions;
00055     QAction *leftAction;
00056     QAction *rightAction;
00057     QAction *topAction;
00058     QAction *bottomAction;
00059 
00060 public:
00061     ToolBar(QWidget *parent);
00062 
00063     QMenu *menu;
00064 
00065 private:
00066     void allow(Qt::ToolBarArea area, bool allow);
00067     void place(Qt::ToolBarArea area, bool place);
00068 
00069 private slots:
00070     void order();
00071     void randomize();
00072     void addSpinBox();
00073     void removeSpinBox();
00074 
00075     void changeMovable(bool movable);
00076 
00077     void allowLeft(bool a);
00078     void allowRight(bool a);
00079     void allowTop(bool a);
00080     void allowBottom(bool a);
00081 
00082     void placeLeft(bool p);
00083     void placeRight(bool p);
00084     void placeTop(bool p);
00085     void placeBottom(bool p);
00086 
00087     void updateMenu();
00088 
00089 };
00090 
00091 #endif

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