Qt 4.8
qtoolbar_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtGui module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #ifndef QDYNAMICTOOLBAR_P_H
43 #define QDYNAMICTOOLBAR_P_H
44 
45 //
46 // W A R N I N G
47 // -------------
48 //
49 // This file is not part of the Qt API. It exists purely as an
50 // implementation detail. This header file may change from version to
51 // version without notice, or even be removed.
52 //
53 // We mean it.
54 //
55 
56 #include "qtoolbar.h"
57 #include "QtGui/qaction.h"
58 #include "private/qwidget_p.h"
59 #include <QtCore/qbasictimer.h>
60 
62 
63 #ifndef QT_NO_TOOLBAR
64 
65 class QToolBarLayout;
66 class QTimer;
67 
69 {
71 
72 public:
73  inline QToolBarPrivate()
74  : explicitIconSize(false), explicitToolButtonStyle(false), movable(true), floatable(true),
77  layout(0), state(0)
78 #ifdef Q_WS_MAC
79  , macWindowDragging(false)
80 #endif
81  { }
82 
83  void init();
84  void actionTriggered();
85  void _q_toggleView(bool b);
86  void _q_updateIconSize(const QSize &sz);
88 
91  bool movable;
92  bool floatable;
93  Qt::ToolBarAreas allowedAreas;
97 
99 
101 
102  struct DragState {
104  bool dragging;
105  bool moving;
107  };
109 
110 #ifdef Q_WS_MAC
113 #endif
114 
115  bool mousePressEvent(QMouseEvent *e);
117  bool mouseMoveEvent(QMouseEvent *e);
118 
119  void updateWindowFlags(bool floating, bool unplug = false);
120  void setWindowState(bool floating, bool unplug = false, const QRect &rect = QRect());
121  void initDrag(const QPoint &pos);
122  void startDrag(bool moving = false);
123  void endDrag();
124 
125  void unplug(const QRect &r);
126  void plug(const QRect &r);
127 
129 };
130 
131 #endif // QT_NO_TOOLBAR
132 
134 
135 #endif // QDYNAMICTOOLBAR_P_H
bool macWindowDragging
Definition: qtoolbar_p.h:111
QLayoutItem * widgetItem
Definition: qtoolbar_p.h:106
bool explicitToolButtonStyle
Definition: qtoolbar_p.h:90
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
QBasicTimer waitForPopupTimer
Definition: qtoolbar_p.h:128
void updateWindowFlags(bool floating, bool unplug=false)
Definition: qtoolbar.cpp:154
void actionTriggered()
void _q_updateIconSize(const QSize &sz)
Definition: qtoolbar.cpp:135
void _q_toggleView(bool b)
Definition: qtoolbar.cpp:124
QToolBarLayout * layout
Definition: qtoolbar_p.h:100
Qt::ToolButtonStyle toolButtonStyle
Definition: qtoolbar_p.h:95
void initDrag(const QPoint &pos)
Definition: qtoolbar.cpp:194
void plug(const QRect &r)
Definition: qtoolbar.cpp:407
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
The QLayoutItem class provides an abstract item that a QLayout manipulates.
Definition: qlayoutitem.h:64
QPoint macWindowDragPressPosition
Definition: qtoolbar_p.h:112
bool mouseReleaseEvent(QMouseEvent *e)
Definition: qtoolbar.cpp:308
The QToolBar class provides a movable panel that contains a set of controls.
Definition: qtoolbar.h:62
Qt::ToolBarAreas allowedAreas
Definition: qtoolbar_p.h:93
The QMouseEvent class contains parameters that describe a mouse event.
Definition: qevent.h:85
void unplug(const QRect &r)
Definition: qtoolbar.cpp:398
Qt::Orientation orientation
Definition: qtoolbar_p.h:94
bool mouseMoveEvent(QMouseEvent *e)
Definition: qtoolbar.cpp:325
void setWindowState(bool floating, bool unplug=false, const QRect &rect=QRect())
Definition: qtoolbar.cpp:171
DragState * state
Definition: qtoolbar_p.h:108
#define Q_DECLARE_PUBLIC(Class)
Definition: qglobal.h:2477
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
void startDrag(bool moving=false)
Definition: qtoolbar.cpp:218
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
Definition: qnamespace.h:54
QAction * toggleViewAction
Definition: qtoolbar_p.h:98
bool mousePressEvent(QMouseEvent *e)
Definition: qtoolbar.cpp:274
The QBasicTimer class provides timer events for objects.
Definition: qbasictimer.h:55
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
ToolButtonStyle
Definition: qnamespace.h:1572
The QTimer class provides repetitive and single-shot timers.
Definition: qtimer.h:56
bool explicitIconSize
Definition: qtoolbar_p.h:89
Orientation
Definition: qnamespace.h:174
void _q_updateToolButtonStyle(Qt::ToolButtonStyle style)
Definition: qtoolbar.cpp:145
The QAction class provides an abstract user interface action that can be inserted into widgets...
Definition: qaction.h:64