summaryrefslogtreecommitdiffstats
path: root/examples/widgets/mainwindows/mainwindow/toolbar.h
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets/mainwindows/mainwindow/toolbar.h')
-rw-r--r--examples/widgets/mainwindows/mainwindow/toolbar.h66
1 files changed, 29 insertions, 37 deletions
diff --git a/examples/widgets/mainwindows/mainwindow/toolbar.h b/examples/widgets/mainwindows/mainwindow/toolbar.h
index b1674a2034..2629d9d7a7 100644
--- a/examples/widgets/mainwindows/mainwindow/toolbar.h
+++ b/examples/widgets/mainwindows/mainwindow/toolbar.h
@@ -40,49 +40,15 @@ QT_FORWARD_DECLARE_CLASS(QAction)
QT_FORWARD_DECLARE_CLASS(QActionGroup)
QT_FORWARD_DECLARE_CLASS(QMenu)
QT_FORWARD_DECLARE_CLASS(QSpinBox)
-QT_FORWARD_DECLARE_CLASS(QLabel)
class ToolBar : public QToolBar
{
Q_OBJECT
- QSpinBox *spinbox;
- QAction *spinboxAction;
-
- QAction *orderAction;
- QAction *randomizeAction;
- QAction *addSpinBoxAction;
- QAction *removeSpinBoxAction;
-
- QAction *movableAction;
-
- QActionGroup *allowedAreasActions;
- QAction *allowLeftAction;
- QAction *allowRightAction;
- QAction *allowTopAction;
- QAction *allowBottomAction;
-
- QActionGroup *areaActions;
- QAction *leftAction;
- QAction *rightAction;
- QAction *topAction;
- QAction *bottomAction;
-
- QAction *toolBarBreakAction;
-
public:
- ToolBar(const QString &title, QWidget *parent);
-
- QMenu *menu;
+ explicit ToolBar(const QString &title, QWidget *parent);
-protected:
- void enterEvent(QEvent*) Q_DECL_OVERRIDE;
- void leaveEvent(QEvent*) Q_DECL_OVERRIDE;
-
-private:
- void allow(Qt::ToolBarArea area, bool allow);
- void place(Qt::ToolBarArea area, bool place);
- QLabel *tip;
+ QMenu *toolbarMenu() const { return menu; }
private slots:
void order();
@@ -105,6 +71,32 @@ private slots:
void updateMenu();
void insertToolBarBreak();
+private:
+ void allow(Qt::ToolBarArea area, bool allow);
+ void place(Qt::ToolBarArea area, bool place);
+
+ QSpinBox *spinbox;
+ QAction *spinboxAction;
+
+ QMenu *menu;
+ QAction *orderAction;
+ QAction *randomizeAction;
+ QAction *addSpinBoxAction;
+ QAction *removeSpinBoxAction;
+
+ QAction *movableAction;
+
+ QActionGroup *allowedAreasActions;
+ QAction *allowLeftAction;
+ QAction *allowRightAction;
+ QAction *allowTopAction;
+ QAction *allowBottomAction;
+
+ QActionGroup *areaActions;
+ QAction *leftAction;
+ QAction *rightAction;
+ QAction *topAction;
+ QAction *bottomAction;
};
-#endif
+#endif // TOOLBAR_H