5#ifndef QGRAPHICSSCENEEVENT_H
6#define QGRAPHICSSCENEEVENT_H
8#include <QtWidgets/qtwidgetsglobal.h>
9#include <QtCore/qcoreevent.h>
10#include <QtCore/qpoint.h>
11#include <QtCore/qscopedpointer.h>
12#include <QtCore/qrect.h>
13#include <QtGui/qpolygon.h>
14#include <QtCore/qset.h>
16QT_REQUIRE_CONFIG(graphicsview);
25class QGraphicsSceneEventPrivate;
29 explicit QGraphicsSceneEvent(Type type);
30 ~QGraphicsSceneEvent();
32 QWidget *widget()
const;
33 void setWidget(QWidget *widget);
35 quint64 timestamp()
const;
36 void setTimestamp(quint64 ts);
39 QGraphicsSceneEvent(QGraphicsSceneEventPrivate &dd, Type type = None);
40 QScopedPointer<QGraphicsSceneEventPrivate> d_ptr;
41 Q_DECLARE_PRIVATE(QGraphicsSceneEvent)
43 Q_DISABLE_COPY(QGraphicsSceneEvent)
50 explicit QGraphicsSceneMouseEvent(Type type = None);
51 ~QGraphicsSceneMouseEvent();
54 void setPos(
const QPointF &pos);
56 QPointF scenePos()
const;
57 void setScenePos(
const QPointF &pos);
59 QPoint screenPos()
const;
60 void setScreenPos(
const QPoint &pos);
62 QPointF buttonDownPos(Qt::MouseButton button)
const;
63 void setButtonDownPos(Qt::MouseButton button,
const QPointF &pos);
65 QPointF buttonDownScenePos(Qt::MouseButton button)
const;
66 void setButtonDownScenePos(Qt::MouseButton button,
const QPointF &pos);
68 QPoint buttonDownScreenPos(Qt::MouseButton button)
const;
69 void setButtonDownScreenPos(Qt::MouseButton button,
const QPoint &pos);
71 QPointF lastPos()
const;
72 void setLastPos(
const QPointF &pos);
74 QPointF lastScenePos()
const;
75 void setLastScenePos(
const QPointF &pos);
77 QPoint lastScreenPos()
const;
78 void setLastScreenPos(
const QPoint &pos);
80 Qt::MouseButtons buttons()
const;
81 void setButtons(Qt::MouseButtons buttons);
83 Qt::MouseButton button()
const;
84 void setButton(Qt::MouseButton button);
86 Qt::KeyboardModifiers modifiers()
const;
87 void setModifiers(Qt::KeyboardModifiers modifiers);
89 Qt::MouseEventSource source()
const;
90 void setSource(Qt::MouseEventSource source);
92 Qt::MouseEventFlags flags()
const;
93 void setFlags(Qt::MouseEventFlags);
96 Q_DECLARE_PRIVATE(QGraphicsSceneMouseEvent)
97 Q_DISABLE_COPY(QGraphicsSceneMouseEvent)
104 explicit QGraphicsSceneWheelEvent(Type type = None);
105 ~QGraphicsSceneWheelEvent();
108 void setPos(
const QPointF &pos);
110 QPointF scenePos()
const;
111 void setScenePos(
const QPointF &pos);
113 QPoint screenPos()
const;
114 void setScreenPos(
const QPoint &pos);
116 Qt::MouseButtons buttons()
const;
117 void setButtons(Qt::MouseButtons buttons);
119 Qt::KeyboardModifiers modifiers()
const;
120 void setModifiers(Qt::KeyboardModifiers modifiers);
123 void setDelta(
int delta);
125 Qt::Orientation orientation()
const;
126 void setOrientation(Qt::Orientation orientation);
128 Qt::ScrollPhase phase()
const;
129 void setPhase(Qt::ScrollPhase scrollPhase);
131 QPoint pixelDelta()
const;
132 void setPixelDelta(QPoint delta);
134 bool isInverted()
const;
135 void setInverted(
bool inverted);
138 Q_DECLARE_PRIVATE(QGraphicsSceneWheelEvent)
139 Q_DISABLE_COPY(QGraphicsSceneWheelEvent)
146 enum Reason { Mouse, Keyboard, Other };
148 explicit QGraphicsSceneContextMenuEvent(Type type = None);
149 ~QGraphicsSceneContextMenuEvent();
152 void setPos(
const QPointF &pos);
154 QPointF scenePos()
const;
155 void setScenePos(
const QPointF &pos);
157 QPoint screenPos()
const;
158 void setScreenPos(
const QPoint &pos);
160 Qt::KeyboardModifiers modifiers()
const;
161 void setModifiers(Qt::KeyboardModifiers modifiers);
163 Reason reason()
const;
164 void setReason(Reason reason);
167 Q_DECLARE_PRIVATE(QGraphicsSceneContextMenuEvent)
168 Q_DISABLE_COPY(QGraphicsSceneContextMenuEvent)
175 explicit QGraphicsSceneHoverEvent(Type type = None);
176 ~QGraphicsSceneHoverEvent();
179 void setPos(
const QPointF &pos);
181 QPointF scenePos()
const;
182 void setScenePos(
const QPointF &pos);
184 QPoint screenPos()
const;
185 void setScreenPos(
const QPoint &pos);
187 QPointF lastPos()
const;
188 void setLastPos(
const QPointF &pos);
190 QPointF lastScenePos()
const;
191 void setLastScenePos(
const QPointF &pos);
193 QPoint lastScreenPos()
const;
194 void setLastScreenPos(
const QPoint &pos);
196 Qt::KeyboardModifiers modifiers()
const;
197 void setModifiers(Qt::KeyboardModifiers modifiers);
200 Q_DECLARE_PRIVATE(QGraphicsSceneHoverEvent)
201 Q_DISABLE_COPY(QGraphicsSceneHoverEvent)
208 explicit QGraphicsSceneHelpEvent(Type type = None);
209 ~QGraphicsSceneHelpEvent();
211 QPointF scenePos()
const;
212 void setScenePos(
const QPointF &pos);
214 QPoint screenPos()
const;
215 void setScreenPos(
const QPoint &pos);
218 Q_DECLARE_PRIVATE(QGraphicsSceneHelpEvent)
219 Q_DISABLE_COPY(QGraphicsSceneHelpEvent)
226 explicit QGraphicsSceneDragDropEvent(Type type = None);
227 ~QGraphicsSceneDragDropEvent();
230 void setPos(
const QPointF &pos);
232 QPointF scenePos()
const;
233 void setScenePos(
const QPointF &pos);
235 QPoint screenPos()
const;
236 void setScreenPos(
const QPoint &pos);
238 Qt::MouseButtons buttons()
const;
239 void setButtons(Qt::MouseButtons buttons);
241 Qt::KeyboardModifiers modifiers()
const;
242 void setModifiers(Qt::KeyboardModifiers modifiers);
244 Qt::DropActions possibleActions()
const;
245 void setPossibleActions(Qt::DropActions actions);
247 Qt::DropAction proposedAction()
const;
248 void setProposedAction(Qt::DropAction action);
249 void acceptProposedAction();
251 Qt::DropAction dropAction()
const;
252 void setDropAction(Qt::DropAction action);
254 QWidget *source()
const;
255 void setSource(QWidget *source);
257 const QMimeData *mimeData()
const;
258 void setMimeData(
const QMimeData *data);
261 Q_DECLARE_PRIVATE(QGraphicsSceneDragDropEvent)
262 Q_DISABLE_COPY(QGraphicsSceneDragDropEvent)
268 Q_DECLARE_PRIVATE(QGraphicsSceneResizeEvent)
269 Q_DISABLE_COPY(QGraphicsSceneResizeEvent)
271 QGraphicsSceneResizeEvent();
272 ~QGraphicsSceneResizeEvent();
274 QSizeF oldSize()
const;
275 void setOldSize(
const QSizeF &size);
277 QSizeF newSize()
const;
278 void setNewSize(
const QSizeF &size);
284 Q_DECLARE_PRIVATE(QGraphicsSceneMoveEvent)
285 Q_DISABLE_COPY(QGraphicsSceneMoveEvent)
287 QGraphicsSceneMoveEvent();
288 ~QGraphicsSceneMoveEvent();
290 QPointF oldPos()
const;
291 void setOldPos(
const QPointF &pos);
293 QPointF newPos()
const;
294 void setNewPos(
const QPointF &pos);
297#ifndef QT_NO_DEBUG_STREAM
298Q_WIDGETS_EXPORT
QDebug operator<<(QDebug,
const QGraphicsSceneEvent *);
The QAbstractGraphicsShapeItem class provides a common base for all path items.
The QGraphicsEllipseItem class provides an ellipse item that you can add to a QGraphicsScene.
QHash< const QGraphicsItem *, QMap< int, QVariant > > data
The QGraphicsItemGroup class provides a container that treats a group of items as a single item.
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
The QGraphicsLineItem class provides a line item that you can add to a QGraphicsScene.
The QGraphicsObject class provides a base class for all graphics items that require signals,...
QGraphicsPixmapItem::ShapeMode shapeMode
Qt::TransformationMode transformationMode
The QGraphicsPixmapItem class provides a pixmap item that you can add to a QGraphicsScene.
The QGraphicsPolygonItem class provides a polygon item that you can add to a QGraphicsScene.
The QGraphicsRectItem class provides a rectangle item that you can add to a QGraphicsScene.
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.
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.
The QGraphicsScene class provides a surface for managing a large number of 2D graphical items.
void updateBoundingRect()
The QGraphicsSimpleTextItem class provides a simple text item that you can add to a QGraphicsScene.
void _q_updateBoundingRect(const QSizeF &)
void _q_ensureVisible(QRectF)
QPointF controlOffset() const
QGraphicsTextItemPrivate()
bool _q_mouseOnEdge(QGraphicsSceneMouseEvent *)
QWidgetTextControl * control
QWidgetTextControl * textControl() const
void sendControlEvent(QEvent *e)
The QGraphicsTextItem class provides a text item that you can add to a QGraphicsScene to display form...
\inmodule QtCore\reentrant
The QPolygonF class provides a list of points using floating point precision.
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QDir::Filters filters)
static void formatGraphicsItemHelper(QDebug debug, const QGraphicsItem *item)
bool _qt_movableAncestorIsSelected(const QGraphicsItem *item)
static QRectF setupTextLayout(QTextLayout *layout)
QDebug operator<<(QDebug debug, const QGraphicsObject *item)
static QPainterPath qt_graphicsItem_shapeFromPath(const QPainterPath &path, const QPen &pen)
QDebug operator<<(QDebug debug, const QGraphicsItem *item)
static bool qt_QGraphicsItem_isObscured(const QGraphicsItem *item, const QGraphicsItem *other, const QRectF &rect)
QT_REQUIRE_CONFIG(graphicsview)
static QRectF adjustedItemBoundingRect(const QGraphicsItem *item)
static QRectF adjustedItemEffectiveBoundingRect(const QGraphicsItem *item)
static void _q_adjustRect(QRectF *rect)
QDebug operator<<(QDebug debug, QIODevice::OpenMode modes)