37 Q_DECLARE_PUBLIC(QGraphicsView)
39 QGraphicsViewPrivate();
40 ~QGraphicsViewPrivate();
42 void recalculateContentSize();
43 void centerView(QGraphicsView::ViewportAnchor anchor);
45 QPainter::RenderHints renderHints;
47 QGraphicsView::DragMode dragMode;
49 quint32 sceneInteractionAllowed : 1;
50 quint32 hasSceneRect : 1;
51 quint32 connectedToScene : 1;
52 quint32 useLastMouseEvent : 1;
53 quint32 identityMatrix : 1;
54 quint32 dirtyScroll : 1;
55 quint32 accelerateScrolling : 1;
56 quint32 keepLastCenterPoint : 1;
57 quint32 transforming : 1;
58 quint32 handScrolling : 1;
59 quint32 mustAllocateStyleOptions : 1;
60 quint32 mustResizeBackgroundPixmap : 1;
61 quint32 fullUpdatePending : 1;
62 quint32 hasUpdateClip : 1;
66 void updateLastCenterPoint();
68 qint64 horizontalScroll()
const;
69 qint64 verticalScroll()
const;
71 QRectF mapRectToScene(
const QRect &rect)
const;
72 QRectF mapRectFromScene(
const QRectF &rect)
const;
75 QPointF mousePressItemPoint;
76 QPointF mousePressScenePoint;
77 QPoint mousePressViewPoint;
78 QPoint mousePressScreenPoint;
79 QPointF lastMouseMoveScenePoint;
80 QPointF lastRubberbandScenePoint;
81 QPoint lastMouseMoveScreenPoint;
82 QPoint dirtyScrollOffset;
83 Qt::MouseButton mousePressButton;
85 qint64 scrollX, scrollY;
87 bool canStartScrollingAt(
const QPoint &startPos)
const override;
93 QEventStorage<QMouseEvent> lastMouseEvent;
94 void replayLastMouseEvent();
95 void storeMouseEvent(QMouseEvent *event);
96 void mouseMoveEventHandler(QMouseEvent *event);
98 QPointF lastCenterPoint;
99 Qt::Alignment alignment;
101 QGraphicsView::ViewportAnchor transformationAnchor;
102 QGraphicsView::ViewportAnchor resizeAnchor;
103 QGraphicsView::ViewportUpdateMode viewportUpdateMode;
104 QGraphicsView::OptimizationFlags optimizationFlags;
106 bool stereoEnabled =
false;
108 QPointer<QGraphicsScene> scene;
109#if QT_CONFIG(rubberband)
110 QRect rubberBandRect;
111 QRegion rubberBandRegion(
const QWidget *widget,
const QRect &rect)
const;
112 void updateRubberBand(
const QMouseEvent *event);
113 void clearRubberBand();
115 Qt::ItemSelectionMode rubberBandSelectionMode;
116 Qt::ItemSelectionOperation rubberBandSelectionOperation;
118 int handScrollMotions;
120 QGraphicsView::CacheMode cacheMode;
122 QList<QStyleOptionGraphicsItem> styleOptions;
123 QStyleOptionGraphicsItem *allocStyleOptionsArray(
int numItems);
124 void freeStyleOptionsArray(QStyleOptionGraphicsItem *array);
126 QBrush backgroundBrush;
127 QBrush foregroundBrush;
128 QPixmap backgroundPixmap;
129 QRegion backgroundPixmapExposed;
132 QCursor originalCursor;
133 bool hasStoredOriginalCursor;
134 void _q_setViewportCursor(
const QCursor &cursor);
135 void _q_unsetViewportCursor();
138 QGraphicsSceneDragDropEvent *lastDragDropEvent;
139 void storeDragDropEvent(
const QGraphicsSceneDragDropEvent *event);
140 void populateSceneDragDropEvent(QGraphicsSceneDragDropEvent *dest,
143 QTransform mapToViewTransform(
const QGraphicsItem *item)
const;
144 QRect mapToViewRect(
const QGraphicsItem *item,
const QRectF &rect)
const;
145 QRegion mapToViewRegion(
const QGraphicsItem *item,
const QRectF &rect)
const;
147 QRect dirtyBoundingRect;
148 void processPendingUpdates();
149 inline void updateAll()
152 fullUpdatePending =
true;
153 dirtyBoundingRect = QRect();
154 dirtyRegion = QRegion();
157 inline void dispatchPendingUpdateRequests()
159 if (qt_widget_private(viewport)->shouldPaintOnScreen())
160 QCoreApplication::sendPostedEvents(viewport, QEvent::UpdateRequest);
162 QCoreApplication::sendPostedEvents(viewport->window(), QEvent::UpdateRequest);
165 void setUpdateClip(QGraphicsItem *);
167 inline bool updateRectF(
const QRectF &rect)
171 if (optimizationFlags & QGraphicsView::DontAdjustForAntialiasing)
172 return updateRect(rect.toAlignedRect().adjusted(-1, -1, 1, 1));
173 return updateRect(rect.toAlignedRect().adjusted(-2, -2, 2, 2));
176 bool updateRect(
const QRect &rect);
177 bool updateRegion(
const QRectF &rect,
const QTransform &xform);
178 bool updateSceneSlotReimplementedChecked;
179 QRegion exposedRegion;
181 QList<QGraphicsItem *> findItems(
const QRegion &exposedRegion,
bool *allItems,
182 const QTransform &viewTransform)
const;
184 QPointF mapToScene(
const QPointF &point)
const;
185 QRectF mapToScene(
const QRectF &rect)
const;
186 static void translateTouchEvent(QGraphicsViewPrivate *d, QTouchEvent *touchEvent);
187 void updateInputMethodSensitivity();
The QGraphicsSimpleTextItem class provides a simple text item that you can add to a QGraphicsScene.
bool _q_mouseOnEdge(QGraphicsSceneMouseEvent *)
QWidgetTextControl * textControl() const
The QGraphicsTextItem class provides a text item that you can add to a QGraphicsScene to display form...