Qt 4.8
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 
68 {
69 public:
72 
73  QWidget *widget() const;
74  void setWidget(QWidget *widget);
75 
76 protected:
80 private:
82 };
83 
86 {
87 public:
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:
130 };
131 
134 {
135 public:
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:
163 };
164 
167 {
168 public:
169  enum Reason { Mouse, Keyboard, Other };
170 
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:
192 };
193 
196 {
197 public:
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:
225 };
226 
229 {
230 public:
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:
243 };
244 
247 {
248 public:
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:
286 };
287 
290 {
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 
306 {
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
int type
Definition: qmetatype.cpp:239
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
QScopedPointer< QGraphicsSceneEventPrivate > d_ptr
QPointer< QWidget > widget
#define QT_MODULE(x)
Definition: qglobal.h:2783
#define QT_BEGIN_HEADER
Definition: qglobal.h:136
#define Q_GUI_EXPORT
Definition: qglobal.h:1450
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
The QGraphicsSceneMouseEvent class provides mouse events in the graphics view framework.
static Qt::MouseButtons buttons
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
Definition: qglobal.h:2523
The QGraphicsSceneResizeEvent class provides events for widget resizing in the graphics view framewor...
The QGraphicsSceneMoveEvent class provides events for widget moving in the graphics view framework...
The QSizeF class defines the size of a two-dimensional object using floating point precision...
Definition: qsize.h:202
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
static const char * data(const QByteArray &arr)
DropAction
Definition: qnamespace.h:1597
The QGraphicsSceneEvent class provides a base class for all graphics view related events...
The QMimeData class provides a container for data that records information about its MIME type...
Definition: qmimedata.h:57
#define None
The QGraphicsSceneHelpEvent class provides events when a tooltip is requested.
The QGraphicsSceneDragDropEvent class provides events for drag and drop in the graphics view framewor...
Type
This enum type defines the valid event types in Qt.
Definition: qcoreevent.h:62
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
#define Q_DECLARE_PRIVATE(Class)
Definition: qglobal.h:2467
The QGraphicsSceneWheelEvent class provides wheel events in the graphics view framework.
Orientation
Definition: qnamespace.h:174
Reason
This enum describes the reason why the context event was sent.
The QEvent class is the base class of all event classes.
Definition: qcoreevent.h:56
#define QT_END_HEADER
Definition: qglobal.h:137
The QGraphicsSceneHoverEvent class provides hover events in the graphics view framework.
MouseButton
Definition: qnamespace.h:150
The QGraphicsSceneContextMenuEvent class provides context menu events in the graphics view framework...