1 | /**************************************************************************** |
2 | ** |
3 | ** Copyright (C) 2016 The Qt Company Ltd. |
4 | ** Contact: https://www.qt.io/licensing/ |
5 | ** |
6 | ** This file is part of the Qt Designer of the Qt Toolkit. |
7 | ** |
8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ |
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 The Qt Company. For licensing terms |
14 | ** and conditions see https://www.qt.io/terms-conditions. For further |
15 | ** information use the contact form at https://www.qt.io/contact-us. |
16 | ** |
17 | ** GNU General Public License Usage |
18 | ** Alternatively, this file may be used under the terms of the GNU |
19 | ** General Public License version 3 as published by the Free Software |
20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT |
21 | ** included in the packaging of this file. Please review the following |
22 | ** information to ensure the GNU General Public License requirements will |
23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. |
24 | ** |
25 | ** $QT_END_LICENSE$ |
26 | ** |
27 | ****************************************************************************/ |
28 | |
29 | // |
30 | // W A R N I N G |
31 | // ------------- |
32 | // |
33 | // This file is not part of the Qt API. It exists for the convenience |
34 | // of Qt Designer. This header |
35 | // file may change from version to version without notice, or even be removed. |
36 | // |
37 | // We mean it. |
38 | // |
39 | |
40 | #ifndef QDESIGNER_MENU_H |
41 | #define |
42 | |
43 | #include "shared_global_p.h" |
44 | |
45 | #include <QtWidgets/qaction.h> |
46 | #include <QtWidgets/qmenu.h> |
47 | #include <QtGui/qpixmap.h> |
48 | #include <QtCore/qhash.h> |
49 | |
50 | QT_BEGIN_NAMESPACE |
51 | |
52 | class QTimer; |
53 | class QLineEdit; |
54 | |
55 | class QDesignerFormWindowInterface; |
56 | class QDesignerActionProviderExtension; |
57 | class QDesignerMenu; |
58 | class ; |
59 | class QPainter; |
60 | class QMimeData; |
61 | |
62 | namespace qdesigner_internal { |
63 | class CreateSubmenuCommand; |
64 | class ActionInsertionCommand; |
65 | } |
66 | |
67 | class QDESIGNER_SHARED_EXPORT : public QMenu |
68 | { |
69 | Q_OBJECT |
70 | public: |
71 | (QWidget *parent = nullptr); |
72 | () override; |
73 | |
74 | bool (QObject *object, QEvent *event) override; |
75 | |
76 | QDesignerFormWindowInterface *() const; |
77 | QDesignerActionProviderExtension *(); |
78 | |
79 | QDesignerMenu *() const; |
80 | QDesignerMenuBar *() const; |
81 | |
82 | void (bool visible) override; |
83 | |
84 | void (); |
85 | |
86 | void (QAction *action); |
87 | void (QAction *action); |
88 | |
89 | static void (QPainter *p, const QRect &r); |
90 | |
91 | bool () const; |
92 | |
93 | void (); |
94 | |
95 | void (); |
96 | void (); |
97 | void (bool ctrl); |
98 | void (bool ctrl); |
99 | |
100 | // Helper for MenuTaskMenu extension |
101 | void (QAction *a); |
102 | |
103 | private slots: |
104 | void (); |
105 | void (); |
106 | void (); |
107 | void (); |
108 | void (); |
109 | |
110 | protected: |
111 | void (QActionEvent *event) override; |
112 | void (QDragEnterEvent *event) override; |
113 | void (QDragMoveEvent *event) override; |
114 | void (QDragLeaveEvent *event) override; |
115 | void (QDropEvent *event) override; |
116 | void (QPaintEvent *event) override; |
117 | void (QKeyEvent *event) override; |
118 | void (QKeyEvent *event) override; |
119 | void (QShowEvent *event) override; |
120 | |
121 | bool handleEvent(QWidget *widget, QEvent *event); |
122 | bool handleMouseDoubleClickEvent(QWidget *widget, QMouseEvent *event); |
123 | bool handleMousePressEvent(QWidget *widget, QMouseEvent *event); |
124 | bool handleMouseReleaseEvent(QWidget *widget, QMouseEvent *event); |
125 | bool handleMouseMoveEvent(QWidget *widget, QMouseEvent *event); |
126 | bool handleContextMenuEvent(QWidget *widget, QContextMenuEvent *event); |
127 | bool handleKeyPressEvent(QWidget *widget, QKeyEvent *event); |
128 | |
129 | void (const QPoint &pos, Qt::KeyboardModifiers modifiers); |
130 | |
131 | void (const QPoint &pos); |
132 | int (const QPoint &pos) const; |
133 | |
134 | QAction *() const; |
135 | int () const; |
136 | enum { , , }; |
137 | ActionDragCheck (QAction *action) const; |
138 | |
139 | void (QAction *action); |
140 | |
141 | enum { |
142 | = 0, |
143 | |
144 | }; |
145 | |
146 | void (); |
147 | void (LeaveEditMode mode); |
148 | void (); |
149 | |
150 | QAction *(const QString &text, bool separator = false); |
151 | QDesignerMenu *(QAction *action); |
152 | |
153 | QAction *(int index) const; |
154 | QAction *(QDesignerMenu *) const; |
155 | bool (int a, int b); |
156 | |
157 | void (); |
158 | void (); |
159 | void (); |
160 | |
161 | bool (QAction *action) const; |
162 | QDesignerMenu *() const; |
163 | QDesignerMenu *() const; |
164 | |
165 | QRect (QAction *action) const; |
166 | bool (QAction *action) const; |
167 | |
168 | void (); |
169 | |
170 | private: |
171 | bool (); |
172 | bool (); |
173 | const QPixmap ; |
174 | |
175 | QPoint ; |
176 | int = 0; |
177 | QAction *; |
178 | QAction *; |
179 | QHash<QAction*, QDesignerMenu*> ; |
180 | QTimer *; |
181 | QTimer *; |
182 | QTimer *; |
183 | QLineEdit *; |
184 | bool = false; |
185 | int = -1; |
186 | |
187 | friend class qdesigner_internal::CreateSubmenuCommand; |
188 | friend class qdesigner_internal::ActionInsertionCommand; |
189 | }; |
190 | |
191 | QT_END_NAMESPACE |
192 | |
193 | #endif // QDESIGNER_MENU_H |
194 | |