Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qgraphicssceneevent.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QGRAPHICSSCENEEVENT_H
5#define QGRAPHICSSCENEEVENT_H
6
7#include <QtWidgets/qtwidgetsglobal.h>
8#include <QtCore/qcoreevent.h>
9#include <QtCore/qpoint.h>
10#include <QtCore/qscopedpointer.h>
11#include <QtCore/qrect.h>
12#include <QtGui/qpolygon.h>
13#include <QtCore/qset.h>
14
15QT_REQUIRE_CONFIG(graphicsview);
16
18
19class QMimeData;
20class QPointF;
21class QSizeF;
22class QWidget;
23
25class Q_WIDGETS_EXPORT QGraphicsSceneEvent : public QEvent
26{
27public:
30
31 QWidget *widget() const;
33
34 quint64 timestamp() const;
35 void setTimestamp(quint64 ts);
36
37protected:
39 QScopedPointer<QGraphicsSceneEventPrivate> d_ptr;
40 Q_DECLARE_PRIVATE(QGraphicsSceneEvent)
41private:
42 Q_DISABLE_COPY(QGraphicsSceneEvent)
43};
44
46class Q_WIDGETS_EXPORT QGraphicsSceneMouseEvent : public QGraphicsSceneEvent
47{
48public:
51
52 QPointF pos() const;
53 void setPos(const QPointF &pos);
54
55 QPointF scenePos() const;
56 void setScenePos(const QPointF &pos);
57
58 QPoint screenPos() const;
59 void setScreenPos(const QPoint &pos);
60
61 QPointF buttonDownPos(Qt::MouseButton button) const;
62 void setButtonDownPos(Qt::MouseButton button, const QPointF &pos);
63
64 QPointF buttonDownScenePos(Qt::MouseButton button) const;
65 void setButtonDownScenePos(Qt::MouseButton button, const QPointF &pos);
66
67 QPoint buttonDownScreenPos(Qt::MouseButton button) const;
68 void setButtonDownScreenPos(Qt::MouseButton button, const QPoint &pos);
69
70 QPointF lastPos() const;
71 void setLastPos(const QPointF &pos);
72
73 QPointF lastScenePos() const;
74 void setLastScenePos(const QPointF &pos);
75
76 QPoint lastScreenPos() const;
77 void setLastScreenPos(const QPoint &pos);
78
79 Qt::MouseButtons buttons() const;
80 void setButtons(Qt::MouseButtons buttons);
81
82 Qt::MouseButton button() const;
83 void setButton(Qt::MouseButton button);
84
85 Qt::KeyboardModifiers modifiers() const;
86 void setModifiers(Qt::KeyboardModifiers modifiers);
87
89 void setSource(Qt::MouseEventSource source);
90
91 Qt::MouseEventFlags flags() const;
92 void setFlags(Qt::MouseEventFlags);
93
94private:
95 Q_DECLARE_PRIVATE(QGraphicsSceneMouseEvent)
96 Q_DISABLE_COPY(QGraphicsSceneMouseEvent)
97};
98
100class Q_WIDGETS_EXPORT QGraphicsSceneWheelEvent : public QGraphicsSceneEvent
101{
102public:
105
106 QPointF pos() const;
107 void setPos(const QPointF &pos);
108
109 QPointF scenePos() const;
110 void setScenePos(const QPointF &pos);
111
112 QPoint screenPos() const;
113 void setScreenPos(const QPoint &pos);
114
115 Qt::MouseButtons buttons() const;
116 void setButtons(Qt::MouseButtons buttons);
117
118 Qt::KeyboardModifiers modifiers() const;
119 void setModifiers(Qt::KeyboardModifiers modifiers);
120
121 int delta() const;
122 void setDelta(int delta);
123
124 Qt::Orientation orientation() const;
125 void setOrientation(Qt::Orientation orientation);
126
127 Qt::ScrollPhase phase() const;
128 void setPhase(Qt::ScrollPhase scrollPhase);
129
130 QPoint pixelDelta() const;
131 void setPixelDelta(QPoint delta);
132
133 bool isInverted() const;
134 void setInverted(bool inverted);
135
136private:
137 Q_DECLARE_PRIVATE(QGraphicsSceneWheelEvent)
138 Q_DISABLE_COPY(QGraphicsSceneWheelEvent)
139};
140
143{
144public:
146
149
150 QPointF pos() const;
151 void setPos(const QPointF &pos);
152
153 QPointF scenePos() const;
154 void setScenePos(const QPointF &pos);
155
156 QPoint screenPos() const;
157 void setScreenPos(const QPoint &pos);
158
159 Qt::KeyboardModifiers modifiers() const;
160 void setModifiers(Qt::KeyboardModifiers modifiers);
161
162 Reason reason() const;
163 void setReason(Reason reason);
164
165private:
166 Q_DECLARE_PRIVATE(QGraphicsSceneContextMenuEvent)
167 Q_DISABLE_COPY(QGraphicsSceneContextMenuEvent)
168};
169
171class Q_WIDGETS_EXPORT QGraphicsSceneHoverEvent : public QGraphicsSceneEvent
172{
173public:
176
177 QPointF pos() const;
178 void setPos(const QPointF &pos);
179
180 QPointF scenePos() const;
181 void setScenePos(const QPointF &pos);
182
183 QPoint screenPos() const;
184 void setScreenPos(const QPoint &pos);
185
186 QPointF lastPos() const;
187 void setLastPos(const QPointF &pos);
188
189 QPointF lastScenePos() const;
190 void setLastScenePos(const QPointF &pos);
191
192 QPoint lastScreenPos() const;
193 void setLastScreenPos(const QPoint &pos);
194
195 Qt::KeyboardModifiers modifiers() const;
196 void setModifiers(Qt::KeyboardModifiers modifiers);
197
198private:
199 Q_DECLARE_PRIVATE(QGraphicsSceneHoverEvent)
200 Q_DISABLE_COPY(QGraphicsSceneHoverEvent)
201};
202
204class Q_WIDGETS_EXPORT QGraphicsSceneHelpEvent : public QGraphicsSceneEvent
205{
206public:
209
210 QPointF scenePos() const;
211 void setScenePos(const QPointF &pos);
212
213 QPoint screenPos() const;
214 void setScreenPos(const QPoint &pos);
215
216private:
217 Q_DECLARE_PRIVATE(QGraphicsSceneHelpEvent)
218 Q_DISABLE_COPY(QGraphicsSceneHelpEvent)
219};
220
223{
224public:
227
228 QPointF pos() const;
229 void setPos(const QPointF &pos);
230
231 QPointF scenePos() const;
232 void setScenePos(const QPointF &pos);
233
234 QPoint screenPos() const;
235 void setScreenPos(const QPoint &pos);
236
237 Qt::MouseButtons buttons() const;
238 void setButtons(Qt::MouseButtons buttons);
239
240 Qt::KeyboardModifiers modifiers() const;
241 void setModifiers(Qt::KeyboardModifiers modifiers);
242
243 Qt::DropActions possibleActions() const;
244 void setPossibleActions(Qt::DropActions actions);
245
246 Qt::DropAction proposedAction() const;
247 void setProposedAction(Qt::DropAction action);
248 void acceptProposedAction();
249
250 Qt::DropAction dropAction() const;
251 void setDropAction(Qt::DropAction action);
252
253 QWidget *source() const;
254 void setSource(QWidget *source);
255
256 const QMimeData *mimeData() const;
257 void setMimeData(const QMimeData *data);
258
259private:
260 Q_DECLARE_PRIVATE(QGraphicsSceneDragDropEvent)
261 Q_DISABLE_COPY(QGraphicsSceneDragDropEvent)
262};
263
265class Q_WIDGETS_EXPORT QGraphicsSceneResizeEvent : public QGraphicsSceneEvent
266{
267 Q_DECLARE_PRIVATE(QGraphicsSceneResizeEvent)
268 Q_DISABLE_COPY(QGraphicsSceneResizeEvent)
269public:
272
273 QSizeF oldSize() const;
274 void setOldSize(const QSizeF &size);
275
276 QSizeF newSize() const;
277 void setNewSize(const QSizeF &size);
278};
279
281class Q_WIDGETS_EXPORT QGraphicsSceneMoveEvent : public QGraphicsSceneEvent
282{
283 Q_DECLARE_PRIVATE(QGraphicsSceneMoveEvent)
284 Q_DISABLE_COPY(QGraphicsSceneMoveEvent)
285public:
288
289 QPointF oldPos() const;
290 void setOldPos(const QPointF &pos);
291
292 QPointF newPos() const;
293 void setNewPos(const QPointF &pos);
294};
295
296#ifndef QT_NO_DEBUG_STREAM
297Q_WIDGETS_EXPORT QDebug operator<<(QDebug, const QGraphicsSceneEvent *);
298#endif
299
301
302#endif
\inmodule QtCore
\inmodule QtCore
Definition qcoreevent.h:45
The QGraphicsSceneContextMenuEvent class provides context menu events in the graphics view framework.
Reason
This enum describes the reason why the context event was sent.
The QGraphicsSceneDragDropEvent class provides events for drag and drop in the graphics view framewor...
The QGraphicsSceneEvent class provides a base class for all graphics view related events.
QScopedPointer< QGraphicsSceneEventPrivate > d_ptr
The QGraphicsSceneHelpEvent class provides events when a tooltip is requested.
The QGraphicsSceneHoverEvent class provides hover events in the graphics view framework.
The QGraphicsSceneMouseEvent class provides mouse events in the graphics view framework.
The QGraphicsSceneMoveEvent class provides events for widget moving in the graphics view framework.
The QGraphicsSceneResizeEvent class provides events for widget resizing in the graphics view framewor...
The QGraphicsSceneWheelEvent class provides wheel events in the graphics view framework.
\inmodule QtCore
Definition qmimedata.h:16
\inmodule QtCore\reentrant
Definition qpoint.h:217
\inmodule QtCore\reentrant
Definition qpoint.h:25
\inmodule QtCore
Definition qsize.h:208
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
EGLImageKHR int int EGLuint64KHR * modifiers
QOpenGLWidget * widget
[1]
QPushButton * button
[2]
Combined button and popup list for selecting options.
MouseButton
Definition qnamespace.h:56
Orientation
Definition qnamespace.h:98
MouseEventSource
DropAction
ScrollPhase
Q_WIDGETS_EXPORT QDebug operator<<(QDebug, const QGraphicsSceneEvent *)
@ None
Definition qhash.cpp:531
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum type
GLbitfield flags
GLsizei GLsizei GLchar * source
#define QT_REQUIRE_CONFIG(feature)
unsigned long long quint64
Definition qtypes.h:61
QMimeData * mimeData
rect setPos(100, 100)
setDropAction(proposedAction())
[0]
scrollArea setWidget(imageLabel)
Definition moc.h:23