QtGui/qgraphicssceneevent.h Source File

qgraphicssceneevent.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 QGRAPHICSSCENEEVENT_H
43 #define QGRAPHICSSCENEEVENT_H
44 
45 #include <QtCore/qcoreevent.h>
46 #include <QtCore/qpoint.h>
47 #include <QtCore/qscopedpointer.h>
48 #include <QtCore/qrect.h>
49 #include <QtGui/qpolygon.h>
50 #include <QtCore/qset.h>
51 #include <QtCore/qhash.h>
52 
54 
56 
57 QT_MODULE(Gui)
58 
59 #if !defined(QT_NO_GRAPHICSVIEW) || (QT_EDITION & QT_MODULE_GRAPHICSVIEW) != QT_MODULE_GRAPHICSVIEW
60 
61 class QMimeData;
62 class QPointF;
63 class QSizeF;
64 class QWidget;
65 
66 class QGraphicsSceneEventPrivate;
67 class Q_GUI_EXPORT QGraphicsSceneEvent : public QEvent
68 {
69 public:
72 
73  QWidget *widget() const;
74  void setWidget(QWidget *widget);
75 
76 protected:
77  QGraphicsSceneEvent(QGraphicsSceneEventPrivate &dd, Type type = None);
79  Q_DECLARE_PRIVATE(QGraphicsSceneEvent)
80 private:
81  Q_DISABLE_COPY(QGraphicsSceneEvent)
82 };
83 
84 class QGraphicsSceneMouseEventPrivate;
85 class Q_GUI_EXPORT QGraphicsSceneMouseEvent : public QGraphicsSceneEvent
86 {
87 public:
88  QGraphicsSceneMouseEvent(Type type = None);
90 
91  QPointF pos() const;
92  void setPos(const QPointF &pos);
93 
94  QPointF scenePos() const;
95  void setScenePos(const QPointF &pos);
96 
97  QPoint screenPos() const;
98  void setScreenPos(const QPoint &pos);
99 
100  QPointF buttonDownPos(Qt::MouseButton button) const;
101  void setButtonDownPos(Qt::MouseButton button, const QPointF &pos);
102 
103  QPointF buttonDownScenePos(Qt::MouseButton button) const;
104  void setButtonDownScenePos(Qt::MouseButton button, const QPointF &pos);
105 
106  QPoint buttonDownScreenPos(Qt::MouseButton button) const;
107  void setButtonDownScreenPos(Qt::MouseButton button, const QPoint &pos);
108 
109  QPointF lastPos() const;
110  void setLastPos(const QPointF &pos);
111 
112  QPointF lastScenePos() const;
113  void setLastScenePos(const QPointF &pos);
114 
115  QPoint lastScreenPos() const;
116  void setLastScreenPos(const QPoint &pos);
117 
118  Qt::MouseButtons buttons() const;
119  void setButtons(Qt::MouseButtons buttons);
120 
121  Qt::MouseButton button() const;
122  void setButton(Qt::MouseButton button);
123 
124  Qt::KeyboardModifiers modifiers() const;
125  void setModifiers(Qt::KeyboardModifiers modifiers);
126 
127 private:
128  Q_DECLARE_PRIVATE(QGraphicsSceneMouseEvent)
129  Q_DISABLE_COPY(QGraphicsSceneMouseEvent)
130 };
131 
132 class QGraphicsSceneWheelEventPrivate;
134 {
135 public:
136  QGraphicsSceneWheelEvent(Type type = None);
138 
139  QPointF pos() const;
140  void setPos(const QPointF &pos);
141 
142  QPointF scenePos() const;
143  void setScenePos(const QPointF &pos);
144 
145  QPoint screenPos() const;
146  void setScreenPos(const QPoint &pos);
147 
148  Qt::MouseButtons buttons() const;
149  void setButtons(Qt::MouseButtons buttons);
150 
151  Qt::KeyboardModifiers modifiers() const;
152  void setModifiers(Qt::KeyboardModifiers modifiers);
153 
154  int delta() const;
155  void setDelta(int delta);
156 
157  Qt::Orientation orientation() const;
158  void setOrientation(Qt::Orientation orientation);
159 
160 private:
161  Q_DECLARE_PRIVATE(QGraphicsSceneWheelEvent)
162  Q_DISABLE_COPY(QGraphicsSceneWheelEvent)
163 };
164 
165 class QGraphicsSceneContextMenuEventPrivate;
167 {
168 public:
169  enum Reason { Mouse, Keyboard, Other };
170 
171  QGraphicsSceneContextMenuEvent(Type type = None);
173 
174  QPointF pos() const;
175  void setPos(const QPointF &pos);
176 
177  QPointF scenePos() const;
178  void setScenePos(const QPointF &pos);
179 
180  QPoint screenPos() const;
181  void setScreenPos(const QPoint &pos);
182 
183  Qt::KeyboardModifiers modifiers() const;
184  void setModifiers(Qt::KeyboardModifiers modifiers);
185 
186  Reason reason() const;
187  void setReason(Reason reason);
188 
189 private:
190  Q_DECLARE_PRIVATE(QGraphicsSceneContextMenuEvent)
191  Q_DISABLE_COPY(QGraphicsSceneContextMenuEvent)
192 };
193 
194 class QGraphicsSceneHoverEventPrivate;
196 {
197 public:
198  QGraphicsSceneHoverEvent(Type type = None);
200 
201  QPointF pos() const;
202  void setPos(const QPointF &pos);
203 
204  QPointF scenePos() const;
205  void setScenePos(const QPointF &pos);
206 
207  QPoint screenPos() const;
208  void setScreenPos(const QPoint &pos);
209 
210  QPointF lastPos() const;
211  void setLastPos(const QPointF &pos);
212 
213  QPointF lastScenePos() const;
214  void setLastScenePos(const QPointF &pos);
215 
216  QPoint lastScreenPos() const;
217  void setLastScreenPos(const QPoint &pos);
218 
219  Qt::KeyboardModifiers modifiers() const;
220  void setModifiers(Qt::KeyboardModifiers modifiers);
221 
222 private:
223  Q_DECLARE_PRIVATE(QGraphicsSceneHoverEvent)
224  Q_DISABLE_COPY(QGraphicsSceneHoverEvent)
225 };
226 
227 class QGraphicsSceneHelpEventPrivate;
228 class Q_GUI_EXPORT QGraphicsSceneHelpEvent : public QGraphicsSceneEvent
229 {
230 public:
231  QGraphicsSceneHelpEvent(Type type = None);
233 
234  QPointF scenePos() const;
235  void setScenePos(const QPointF &pos);
236 
237  QPoint screenPos() const;
238  void setScreenPos(const QPoint &pos);
239 
240 private:
241  Q_DECLARE_PRIVATE(QGraphicsSceneHelpEvent)
242  Q_DISABLE_COPY(QGraphicsSceneHelpEvent)
243 };
244 
245 class QGraphicsSceneDragDropEventPrivate;
247 {
248 public:
249  QGraphicsSceneDragDropEvent(Type type = None);
251 
252  QPointF pos() const;
253  void setPos(const QPointF &pos);
254 
255  QPointF scenePos() const;
256  void setScenePos(const QPointF &pos);
257 
258  QPoint screenPos() const;
259  void setScreenPos(const QPoint &pos);
260 
261  Qt::MouseButtons buttons() const;
262  void setButtons(Qt::MouseButtons buttons);
263 
264  Qt::KeyboardModifiers modifiers() const;
265  void setModifiers(Qt::KeyboardModifiers modifiers);
266 
267  Qt::DropActions possibleActions() const;
268  void setPossibleActions(Qt::DropActions actions);
269 
270  Qt::DropAction proposedAction() const;
271  void setProposedAction(Qt::DropAction action);
272  void acceptProposedAction();
273 
274  Qt::DropAction dropAction() const;
275  void setDropAction(Qt::DropAction action);
276 
277  QWidget *source() const;
278  void setSource(QWidget *source);
279 
280  const QMimeData *mimeData() const;
281  void setMimeData(const QMimeData *data);
282 
283 private:
284  Q_DECLARE_PRIVATE(QGraphicsSceneDragDropEvent)
285  Q_DISABLE_COPY(QGraphicsSceneDragDropEvent)
286 };
287 
288 class QGraphicsSceneResizeEventPrivate;
290 {
291  Q_DECLARE_PRIVATE(QGraphicsSceneResizeEvent)
292  Q_DISABLE_COPY(QGraphicsSceneResizeEvent)
293 public:
296 
297  QSizeF oldSize() const;
298  void setOldSize(const QSizeF &size);
299 
300  QSizeF newSize() const;
301  void setNewSize(const QSizeF &size);
302 };
303 
304 class QGraphicsSceneMoveEventPrivate;
305 class Q_GUI_EXPORT QGraphicsSceneMoveEvent : public QGraphicsSceneEvent
306 {
307  Q_DECLARE_PRIVATE(QGraphicsSceneMoveEvent)
308  Q_DISABLE_COPY(QGraphicsSceneMoveEvent)
309 public:
312 
313  QPointF oldPos() const;
314  void setOldPos(const QPointF &pos);
315 
316  QPointF newPos() const;
317  void setNewPos(const QPointF &pos);
318 };
319 
320 #endif // QT_NO_GRAPHICSVIEW
321 
323 
325 
326 #endif
GLuint GLuint GLsizei GLenum type
Definition: GLee.h:872
GLsizei GLsizei GLchar * source
Definition: GLee.h:1721
#define QT_END_NAMESPACE
Definition: qglobal.h:128
#define QT_BEGIN_HEADER
Definition: qglobal.h:141
MouseButton
Definition: qnamespace.h:150
Definition: qpoint.h:53
#define QT_BEGIN_NAMESPACE
Definition: qglobal.h:127
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: GLee.h:880
Definition: qsize.h:202
QScopedPointer< QGraphicsSceneEventPrivate > d_ptr
Orientation
Definition: qnamespace.h:174
DropAction
Definition: qnamespace.h:1597
#define QT_END_HEADER
Definition: qglobal.h:142
GLsizeiptr size
Definition: GLee.h:1561