qgraphicsview.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/widgets/graphicsview/qgraphicsview.cpp
Switch to Source codePreprocessed file
LineSourceCount
1static const int QGRAPHICSVIEW_REGION_RECT_THRESHOLD = 50;-
2-
3static const int QGRAPHICSVIEW_PREALLOC_STYLE_OPTIONS = 503;-
4-
5-
6-
7-
8-
9-
10-
11-
12-
13bool qt_sendSpontaneousEvent(QObject *receiver, QEvent *event);-
14-
15inline int q_round_bound(qreal d)-
16{-
17 if (d <= (qreal) (-2147483647 - 1)
d <= (qreal) (-2147483647 - 1)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
18 return
never executed: return (-2147483647 - 1);
(-2147483647 - 1);
never executed: return (-2147483647 - 1);
0
19 else if (d >= (qreal) 2147483647
d >= (qreal) 2147483647Description
TRUEnever evaluated
FALSEnever evaluated
)
0
20 return
never executed: return 2147483647;
2147483647;
never executed: return 2147483647;
0
21 return
never executed: return d >= 0.0 ? int(d + 0.5) : int(d - int(d-1) + 0.5) + int(d-1);
d >= 0.0 ? int(d + 0.5) : int(d - int(d-1) + 0.5) + int(d-1);
never executed: return d >= 0.0 ? int(d + 0.5) : int(d - int(d-1) + 0.5) + int(d-1);
0
22}-
23-
24void QGraphicsViewPrivate::translateTouchEvent(QGraphicsViewPrivate *d, QTouchEvent *touchEvent)-
25{-
26 QList<QTouchEvent::TouchPoint> touchPoints = touchEvent->touchPoints();-
27 for (int i = 0; i < touchPoints.count()
i < touchPoints.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
28 QTouchEvent::TouchPoint &touchPoint = touchPoints[i];-
29-
30-
31 touchPoint.setSceneRect(d->mapToScene(touchPoint.rect()));-
32 touchPoint.setStartScenePos(d->mapToScene(touchPoint.startPos()));-
33 touchPoint.setLastScenePos(d->mapToScene(touchPoint.lastPos()));-
34-
35-
36 }
never executed: end of block
0
37-
38 touchEvent->setTouchPoints(touchPoints);-
39}
never executed: end of block
0
40-
41-
42-
43-
44QGraphicsViewPrivate::QGraphicsViewPrivate()-
45 : renderHints(QPainter::TextAntialiasing),-
46 dragMode(QGraphicsView::NoDrag),-
47 sceneInteractionAllowed(true), hasSceneRect(false),-
48 connectedToScene(false),-
49 useLastMouseEvent(false),-
50 identityMatrix(true),-
51 dirtyScroll(true),-
52 accelerateScrolling(true),-
53 keepLastCenterPoint(true),-
54 transforming(false),-
55 handScrolling(false),-
56 mustAllocateStyleOptions(false),-
57 mustResizeBackgroundPixmap(true),-
58 fullUpdatePending(true),-
59 hasUpdateClip(false),-
60 mousePressButton(Qt::NoButton),-
61 leftIndent(0), topIndent(0),-
62 lastMouseEvent(QEvent::None, QPointF(), QPointF(), QPointF(), Qt::NoButton, 0, 0),-
63 alignment(Qt::AlignCenter),-
64 transformationAnchor(QGraphicsView::AnchorViewCenter), resizeAnchor(QGraphicsView::NoAnchor),-
65 viewportUpdateMode(QGraphicsView::MinimalViewportUpdate),-
66 optimizationFlags(0),-
67 scene(0),-
68-
69 rubberBanding(false),-
70 rubberBandSelectionMode(Qt::IntersectsItemShape),-
71 rubberBandSelectionOperation(Qt::ReplaceSelection),-
72-
73 handScrollMotions(0), cacheMode(0),-
74-
75 hasStoredOriginalCursor(false),-
76-
77 lastDragDropEvent(0),-
78 updateSceneSlotReimplementedChecked(false)-
79{-
80 styleOptions.reserve(QGRAPHICSVIEW_PREALLOC_STYLE_OPTIONS);-
81}
never executed: end of block
0
82-
83QGraphicsViewPrivate::~QGraphicsViewPrivate()-
84{-
85}-
86-
87-
88-
89-
90void QGraphicsViewPrivate::recalculateContentSize()-
91{-
92 QGraphicsView * const q = q_func();-
93-
94 QSize maxSize = q->maximumViewportSize();-
95 int width = maxSize.width();-
96 int height = maxSize.height();-
97 QRectF viewRect = matrix.mapRect(q->sceneRect());-
98-
99 bool frameOnlyAround = (q->style()->styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents, 0, q));-
100 if (frameOnlyAround
frameOnlyAroundDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
101 if (hbarpolicy == Qt::ScrollBarAlwaysOn
hbarpolicy == ...ollBarAlwaysOnDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
102 height -= frameWidth * 2;
never executed: height -= frameWidth * 2;
0
103 if (vbarpolicy == Qt::ScrollBarAlwaysOn
vbarpolicy == ...ollBarAlwaysOnDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
104 width -= frameWidth * 2;
never executed: width -= frameWidth * 2;
0
105 }
never executed: end of block
0
106-
107-
108-
109 int scrollBarExtent = q->style()->pixelMetric(QStyle::PM_ScrollBarExtent, 0, q);-
110 if (frameOnlyAround
frameOnlyAroundDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
111 scrollBarExtent += frameWidth * 2;
never executed: scrollBarExtent += frameWidth * 2;
0
112-
113-
114-
115 bool useHorizontalScrollBar = (
(viewRect.width() > width)Description
TRUEnever evaluated
FALSEnever evaluated
viewRect.width() > width)
(viewRect.width() > width)Description
TRUEnever evaluated
FALSEnever evaluated
&& hbarpolicy == Qt::ScrollBarAsNeeded
hbarpolicy == ...ollBarAsNeededDescription
TRUEnever evaluated
FALSEnever evaluated
;
0
116 bool useVerticalScrollBar = (
(viewRect.height() > height)Description
TRUEnever evaluated
FALSEnever evaluated
viewRect.height() > height)
(viewRect.height() > height)Description
TRUEnever evaluated
FALSEnever evaluated
&& vbarpolicy == Qt::ScrollBarAsNeeded
vbarpolicy == ...ollBarAsNeededDescription
TRUEnever evaluated
FALSEnever evaluated
;
0
117 if (useHorizontalScrollBar
useHorizontalScrollBarDescription
TRUEnever evaluated
FALSEnever evaluated
&& vbarpolicy == Qt::ScrollBarAsNeeded
vbarpolicy == ...ollBarAsNeededDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
118 if (viewRect.height() > height - scrollBarExtent
viewRect.heigh...crollBarExtentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
119 useVerticalScrollBar = true;
never executed: useVerticalScrollBar = true;
0
120 }
never executed: end of block
0
121 if (useVerticalScrollBar
useVerticalScrollBarDescription
TRUEnever evaluated
FALSEnever evaluated
&& hbarpolicy == Qt::ScrollBarAsNeeded
hbarpolicy == ...ollBarAsNeededDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
122 if (viewRect.width() > width - scrollBarExtent
viewRect.width...crollBarExtentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
123 useHorizontalScrollBar = true;
never executed: useHorizontalScrollBar = true;
0
124 }
never executed: end of block
0
125 if (useHorizontalScrollBar
useHorizontalScrollBarDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
126 height -= scrollBarExtent;
never executed: height -= scrollBarExtent;
0
127 if (useVerticalScrollBar
useVerticalScrollBarDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
128 width -= scrollBarExtent;
never executed: width -= scrollBarExtent;
0
129-
130-
131-
132-
133 QPointF savedLastCenterPoint = lastCenterPoint;-
134-
135-
136 qreal oldLeftIndent = leftIndent;-
137 qreal oldTopIndent = topIndent;-
138-
139-
140-
141 int left = q_round_bound(viewRect.left());-
142 int right = q_round_bound(viewRect.right() - width);-
143 if (left >= right
left >= rightDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
144 hbar->setRange(0, 0);-
145-
146 switch (alignment & Qt::AlignHorizontal_Mask) {-
147 case
never executed: case Qt::AlignLeft:
Qt::AlignLeft:
never executed: case Qt::AlignLeft:
0
148 leftIndent = -viewRect.left();-
149 break;
never executed: break;
0
150 case
never executed: case Qt::AlignRight:
Qt::AlignRight:
never executed: case Qt::AlignRight:
0
151 leftIndent = width - viewRect.width() - viewRect.left() - 1;-
152 break;
never executed: break;
0
153 case
never executed: case Qt::AlignHCenter:
Qt::AlignHCenter:
never executed: case Qt::AlignHCenter:
0
154 default
never executed: default:
:
never executed: default:
0
155 leftIndent = width / 2 - (viewRect.left() + viewRect.right()) / 2;-
156 break;
never executed: break;
0
157 }-
158 } else {-
159 hbar->setRange(left, right);-
160 hbar->setPageStep(width);-
161 hbar->setSingleStep(width / 20);-
162 leftIndent = 0;-
163 }
never executed: end of block
0
164-
165-
166-
167 int top = q_round_bound(viewRect.top());-
168 int bottom = q_round_bound(viewRect.bottom() - height);-
169 if (top >= bottom
top >= bottomDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
170 vbar->setRange(0, 0);-
171-
172 switch (alignment & Qt::AlignVertical_Mask) {-
173 case
never executed: case Qt::AlignTop:
Qt::AlignTop:
never executed: case Qt::AlignTop:
0
174 topIndent = -viewRect.top();-
175 break;
never executed: break;
0
176 case
never executed: case Qt::AlignBottom:
Qt::AlignBottom:
never executed: case Qt::AlignBottom:
0
177 topIndent = height - viewRect.height() - viewRect.top() - 1;-
178 break;
never executed: break;
0
179 case
never executed: case Qt::AlignVCenter:
Qt::AlignVCenter:
never executed: case Qt::AlignVCenter:
0
180 default
never executed: default:
:
never executed: default:
0
181 topIndent = height / 2 - (viewRect.top() + viewRect.bottom()) / 2;-
182 break;
never executed: break;
0
183 }-
184 } else {-
185 vbar->setRange(top, bottom);-
186 vbar->setPageStep(height);-
187 vbar->setSingleStep(height / 20);-
188 topIndent = 0;-
189 }
never executed: end of block
0
190-
191-
192 lastCenterPoint = savedLastCenterPoint;-
193-
194-
195-
196-
197 if (oldLeftIndent != leftIndent
oldLeftIndent != leftIndentDescription
TRUEnever evaluated
FALSEnever evaluated
|| oldTopIndent != topIndent
oldTopIndent != topIndentDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
198 dirtyScroll = true;-
199 updateAll();-
200 }
never executed: end of block
else if (q->isRightToLeft()
q->isRightToLeft()Description
TRUEnever evaluated
FALSEnever evaluated
&& !leftIndent
!leftIndentDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
201-
202-
203-
204-
205 dirtyScroll = true;-
206 }
never executed: end of block
0
207-
208 if (cacheMode & QGraphicsView::CacheBackground
cacheMode & QG...acheBackgroundDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
209-
210 mustResizeBackgroundPixmap = true;-
211 }
never executed: end of block
0
212}
never executed: end of block
0
213-
214-
215-
216-
217void QGraphicsViewPrivate::centerView(QGraphicsView::ViewportAnchor anchor)-
218{-
219 QGraphicsView * const q = q_func();-
220 switch (anchor) {-
221 case
never executed: case QGraphicsView::AnchorUnderMouse:
QGraphicsView::AnchorUnderMouse:
never executed: case QGraphicsView::AnchorUnderMouse:
{
0
222 if (q->underMouse()
q->underMouse()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
223-
224-
225 QPointF transformationDiff = q->mapToScene(viewport->rect().center())-
226 - q->mapToScene(viewport->mapFromGlobal(QCursor::pos()));-
227 q->centerOn(lastMouseMoveScenePoint + transformationDiff);-
228 }
never executed: end of block
else {
0
229 q->centerOn(lastCenterPoint);-
230 }
never executed: end of block
0
231 break;
never executed: break;
0
232 }-
233 case
never executed: case QGraphicsView::AnchorViewCenter:
QGraphicsView::AnchorViewCenter:
never executed: case QGraphicsView::AnchorViewCenter:
0
234 q->centerOn(lastCenterPoint);-
235 break;
never executed: break;
0
236 case
never executed: case QGraphicsView::NoAnchor:
QGraphicsView::NoAnchor:
never executed: case QGraphicsView::NoAnchor:
0
237 break;
never executed: break;
0
238 }-
239}
never executed: end of block
0
240-
241-
242-
243-
244void QGraphicsViewPrivate::updateLastCenterPoint()-
245{-
246 QGraphicsView * const q = q_func();-
247 lastCenterPoint = q->mapToScene(viewport->rect().center());-
248}
never executed: end of block
0
249-
250-
251-
252-
253-
254-
255-
256qint64 QGraphicsViewPrivate::horizontalScroll() const-
257{-
258 if (dirtyScroll
dirtyScrollDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
259 const_cast<
never executed: const_cast<QGraphicsViewPrivate *>(this)->updateScroll();
QGraphicsViewPrivate *>(this)->updateScroll();
never executed: const_cast<QGraphicsViewPrivate *>(this)->updateScroll();
0
260 return
never executed: return scrollX;
scrollX;
never executed: return scrollX;
0
261}-
262-
263-
264-
265-
266-
267-
268-
269qint64 QGraphicsViewPrivate::verticalScroll() const-
270{-
271 if (dirtyScroll
dirtyScrollDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
272 const_cast<
never executed: const_cast<QGraphicsViewPrivate *>(this)->updateScroll();
QGraphicsViewPrivate *>(this)->updateScroll();
never executed: const_cast<QGraphicsViewPrivate *>(this)->updateScroll();
0
273 return
never executed: return scrollY;
scrollY;
never executed: return scrollY;
0
274}-
275-
276-
277-
278-
279-
280-
281QRectF QGraphicsViewPrivate::mapRectToScene(const QRect &rect) const-
282{-
283 if (dirtyScroll
dirtyScrollDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
284 const_cast<
never executed: const_cast<QGraphicsViewPrivate *>(this)->updateScroll();
QGraphicsViewPrivate *>(this)->updateScroll();
never executed: const_cast<QGraphicsViewPrivate *>(this)->updateScroll();
0
285 QRectF scrolled = QRectF(rect.translated(scrollX, scrollY));-
286 return
never executed: return identityMatrix ? scrolled : matrix.inverted().mapRect(scrolled);
identityMatrix ? scrolled : matrix.inverted().mapRect(scrolled);
never executed: return identityMatrix ? scrolled : matrix.inverted().mapRect(scrolled);
0
287}-
288-
289-
290-
291-
292-
293-
294-
295QRectF QGraphicsViewPrivate::mapRectFromScene(const QRectF &rect) const-
296{-
297 if (dirtyScroll
dirtyScrollDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
298 const_cast<
never executed: const_cast<QGraphicsViewPrivate *>(this)->updateScroll();
QGraphicsViewPrivate *>(this)->updateScroll();
never executed: const_cast<QGraphicsViewPrivate *>(this)->updateScroll();
0
299 return
never executed: return (identityMatrix ? rect : matrix.mapRect(rect)).translated(-scrollX, -scrollY);
(identityMatrix ? rect : matrix.mapRect(rect)).translated(-scrollX, -scrollY);
never executed: return (identityMatrix ? rect : matrix.mapRect(rect)).translated(-scrollX, -scrollY);
0
300}-
301-
302-
303-
304-
305void QGraphicsViewPrivate::updateScroll()-
306{-
307 QGraphicsView * const q = q_func();-
308 scrollX = qint64(-leftIndent);-
309 if (q->isRightToLeft()
q->isRightToLeft()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
310 if (!leftIndent
!leftIndentDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
311 scrollX += hbar->minimum();-
312 scrollX += hbar->maximum();-
313 scrollX -= hbar->value();-
314 }
never executed: end of block
0
315 }
never executed: end of block
else {
0
316 scrollX += hbar->value();-
317 }
never executed: end of block
0
318-
319 scrollY = qint64(vbar->value() - topIndent);-
320-
321 dirtyScroll = false;-
322}
never executed: end of block
0
323-
324-
325-
326-
327void QGraphicsViewPrivate::replayLastMouseEvent()-
328{-
329 if (!useLastMouseEvent
!useLastMouseEventDescription
TRUEnever evaluated
FALSEnever evaluated
|| !scene
!sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
330 return;
never executed: return;
0
331 mouseMoveEventHandler(&lastMouseEvent);-
332}
never executed: end of block
0
333-
334-
335-
336-
337void QGraphicsViewPrivate::storeMouseEvent(QMouseEvent *event)-
338{-
339 useLastMouseEvent = true;-
340 lastMouseEvent = QMouseEvent(QEvent::MouseMove, event->localPos(), event->windowPos(), event->screenPos(),-
341 event->button(), event->buttons(), event->modifiers());-
342}
never executed: end of block
0
343-
344void QGraphicsViewPrivate::mouseMoveEventHandler(QMouseEvent *event)-
345{-
346 QGraphicsView * const q = q_func();-
347-
348-
349 updateRubberBand(event);-
350-
351-
352 storeMouseEvent(event);-
353 lastMouseEvent.setAccepted(false);-
354-
355 if (!sceneInteractionAllowed
!sceneInteractionAllowedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
356 return;
never executed: return;
0
357 if (handScrolling
handScrollingDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
358 return;
never executed: return;
0
359 if (!scene
!sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
360 return;
never executed: return;
0
361-
362 QGraphicsSceneMouseEvent mouseEvent(QEvent::GraphicsSceneMouseMove);-
363 mouseEvent.setWidget(viewport);-
364 mouseEvent.setButtonDownScenePos(mousePressButton, mousePressScenePoint);-
365 mouseEvent.setButtonDownScreenPos(mousePressButton, mousePressScreenPoint);-
366 mouseEvent.setScenePos(q->mapToScene(event->pos()));-
367 mouseEvent.setScreenPos(event->globalPos());-
368 mouseEvent.setLastScenePos(lastMouseMoveScenePoint);-
369 mouseEvent.setLastScreenPos(lastMouseMoveScreenPoint);-
370 mouseEvent.setButtons(event->buttons());-
371 mouseEvent.setButton(event->button());-
372 mouseEvent.setModifiers(event->modifiers());-
373 mouseEvent.setSource(event->source());-
374 mouseEvent.setFlags(event->flags());-
375 lastMouseMoveScenePoint = mouseEvent.scenePos();-
376 lastMouseMoveScreenPoint = mouseEvent.screenPos();-
377 mouseEvent.setAccepted(false);-
378 if (event->spontaneous()
event->spontaneous()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
379 qt_sendSpontaneousEvent(scene, &mouseEvent);
never executed: qt_sendSpontaneousEvent(scene, &mouseEvent);
0
380 else-
381 QApplication::sendEvent(scene, &mouseEvent);
never executed: QApplication::sendEvent(scene, &mouseEvent);
0
382-
383-
384 lastMouseEvent.setAccepted(mouseEvent.isAccepted());-
385-
386 if (mouseEvent.isAccepted()
mouseEvent.isAccepted()Description
TRUEnever evaluated
FALSEnever evaluated
&& mouseEvent.buttons() != 0
mouseEvent.buttons() != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
387-
388-
389 return;
never executed: return;
0
390 }-
391-
392-
393-
394-
395-
396-
397 if (scene->d_func()->allItemsIgnoreHoverEvents
scene->d_func(...oreHoverEventsDescription
TRUEnever evaluated
FALSEnever evaluated
&& !scene->d_func()->allItemsUseDefaultCursor
!scene->d_func...eDefaultCursorDescription
TRUEnever evaluated
FALSEnever evaluated
0
398 && scene->d_func()->cachedItemsUnderMouse.isEmpty()
scene->d_func(...ouse.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
399 scene->d_func()->cachedItemsUnderMouse = scene->d_func()->itemsAtPosition(mouseEvent.screenPos(),-
400 mouseEvent.scenePos(),-
401 mouseEvent.widget());-
402 }
never executed: end of block
0
403-
404 for (QForeachContainer<typename QtPrivate::remove_reference<decltype(scene->d_func()->cachedItemsUnderMouse)>::type> _container_((scene->d_func()->cachedItemsUnderMouse)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QGraphicsItem *item = *_container_.i; _container_.control; _container_.control = 0) {-
405 if (item->hasCursor()
item->hasCursor()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
406 _q_setViewportCursor(item->cursor());-
407 return;
never executed: return;
0
408 }-
409 }
never executed: end of block
0
410-
411-
412 if (hasStoredOriginalCursor
hasStoredOriginalCursorDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
413-
414 hasStoredOriginalCursor = false;-
415 viewport->setCursor(originalCursor);-
416 }
never executed: end of block
0
417-
418}
never executed: end of block
0
419-
420-
421-
422-
423-
424QRegion QGraphicsViewPrivate::rubberBandRegion(const QWidget *widget, const QRect &rect) const-
425{-
426 QStyleHintReturnMask mask;-
427 QStyleOptionRubberBand option;-
428 option.initFrom(widget);-
429 option.rect = rect;-
430 option.opaque = false;-
431 option.shape = QRubberBand::Rectangle;-
432-
433 QRegion tmp;-
434 tmp += rect;-
435 if (widget->style()->styleHint(QStyle::SH_RubberBand_Mask, &option, widget, &mask)
widget->style(...widget, &mask)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
436 tmp &= mask.region;
never executed: tmp &= mask.region;
0
437 return
never executed: return tmp;
tmp;
never executed: return tmp;
0
438}-
439-
440void QGraphicsViewPrivate::updateRubberBand(const QMouseEvent *event)-
441{-
442 QGraphicsView * const q = q_func();-
443 if (dragMode != QGraphicsView::RubberBandDrag
dragMode != QG...RubberBandDragDescription
TRUEnever evaluated
FALSEnever evaluated
|| !sceneInteractionAllowed
!sceneInteractionAllowedDescription
TRUEnever evaluated
FALSEnever evaluated
|| !rubberBanding
!rubberBandingDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
444 return;
never executed: return;
0
445-
446 if ((
(mousePressVie...DragDistance()Description
TRUEnever evaluated
FALSEnever evaluated
mousePressViewPoint - event->pos()).manhattanLength() < QApplication::startDragDistance()
(mousePressVie...DragDistance()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
447 return;
never executed: return;
0
448-
449-
450 if (viewportUpdateMode != QGraphicsView::NoViewportUpdate
viewportUpdate...ViewportUpdateDescription
TRUEnever evaluated
FALSEnever evaluated
&& !rubberBandRect.isEmpty()
!rubberBandRect.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
451 if (viewportUpdateMode != QGraphicsView::FullViewportUpdate
viewportUpdate...ViewportUpdateDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
452 q->viewport()->update(rubberBandRegion(q->viewport(), rubberBandRect));
never executed: q->viewport()->update(rubberBandRegion(q->viewport(), rubberBandRect));
0
453 else-
454 updateAll();
never executed: updateAll();
0
455 }-
456-
457-
458-
459 if (!event->buttons()
!event->buttons()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
460 rubberBanding = false;-
461 rubberBandSelectionOperation = Qt::ReplaceSelection;-
462 if (!rubberBandRect.isNull()
!rubberBandRect.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
463 rubberBandRect = QRect();-
464 q->rubberBandChanged(rubberBandRect, QPointF(), QPointF());-
465 }
never executed: end of block
0
466 return;
never executed: return;
0
467 }-
468-
469 QRect oldRubberband = rubberBandRect;-
470-
471-
472 const QPoint mp = q->mapFromScene(mousePressScenePoint);-
473 const QPoint ep = event->pos();-
474 rubberBandRect = QRect(qMin(mp.x(), ep.x()), qMin(mp.y(), ep.y()),-
475 qAbs(mp.x() - ep.x()) + 1, qAbs(mp.y() - ep.y()) + 1);-
476-
477 if (rubberBandRect != oldRubberband
rubberBandRect... oldRubberbandDescription
TRUEnever evaluated
FALSEnever evaluated
|| lastRubberbandScenePoint != lastMouseMoveScenePoint
lastRubberband...MoveScenePointDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
478 lastRubberbandScenePoint = lastMouseMoveScenePoint;-
479 oldRubberband = rubberBandRect;-
480 q->rubberBandChanged(rubberBandRect, mousePressScenePoint, lastRubberbandScenePoint);-
481 }
never executed: end of block
0
482-
483-
484 if (viewportUpdateMode != QGraphicsView::NoViewportUpdate
viewportUpdate...ViewportUpdateDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
485 if (viewportUpdateMode != QGraphicsView::FullViewportUpdate
viewportUpdate...ViewportUpdateDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
486 q->viewport()->update(rubberBandRegion(q->viewport(), rubberBandRect));
never executed: q->viewport()->update(rubberBandRegion(q->viewport(), rubberBandRect));
0
487 else-
488 updateAll();
never executed: updateAll();
0
489 }-
490-
491 QPainterPath selectionArea;-
492 selectionArea.addPolygon(q->mapToScene(rubberBandRect));-
493 selectionArea.closeSubpath();-
494 if (scene
sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
495 scene->setSelectionArea(selectionArea, rubberBandSelectionOperation, rubberBandSelectionMode, q->viewportTransform());
never executed: scene->setSelectionArea(selectionArea, rubberBandSelectionOperation, rubberBandSelectionMode, q->viewportTransform());
0
496}
never executed: end of block
0
497-
498-
499-
500-
501-
502-
503void QGraphicsViewPrivate::_q_setViewportCursor(const QCursor &cursor)-
504{-
505 if (!hasStoredOriginalCursor
!hasStoredOriginalCursorDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
506 hasStoredOriginalCursor = true;-
507 originalCursor = viewport->cursor();-
508 }
never executed: end of block
0
509 viewport->setCursor(cursor);-
510}
never executed: end of block
0
511-
512-
513-
514-
515-
516-
517void QGraphicsViewPrivate::_q_unsetViewportCursor()-
518{-
519 QGraphicsView * const q = q_func();-
520 const auto items = q->items(lastMouseEvent.pos());-
521 for (QGraphicsItem *item : items) {-
522 if (item->hasCursor()
item->hasCursor()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
523 _q_setViewportCursor(item->cursor());-
524 return;
never executed: return;
0
525 }-
526 }
never executed: end of block
0
527-
528-
529 if (hasStoredOriginalCursor
hasStoredOriginalCursorDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
530 hasStoredOriginalCursor = false;-
531 if (dragMode == QGraphicsView::ScrollHandDrag
dragMode == QG...ScrollHandDragDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
532 viewport->setCursor(Qt::OpenHandCursor);
never executed: viewport->setCursor(Qt::OpenHandCursor);
0
533 else-
534 viewport->setCursor(originalCursor);
never executed: viewport->setCursor(originalCursor);
0
535 }-
536}
never executed: end of block
0
537-
538-
539-
540-
541-
542void QGraphicsViewPrivate::storeDragDropEvent(const QGraphicsSceneDragDropEvent *event)-
543{-
544 delete lastDragDropEvent;-
545 lastDragDropEvent = new QGraphicsSceneDragDropEvent(event->type());-
546 lastDragDropEvent->setScenePos(event->scenePos());-
547 lastDragDropEvent->setScreenPos(event->screenPos());-
548 lastDragDropEvent->setButtons(event->buttons());-
549 lastDragDropEvent->setModifiers(event->modifiers());-
550 lastDragDropEvent->setPossibleActions(event->possibleActions());-
551 lastDragDropEvent->setProposedAction(event->proposedAction());-
552 lastDragDropEvent->setDropAction(event->dropAction());-
553 lastDragDropEvent->setMimeData(event->mimeData());-
554 lastDragDropEvent->setWidget(event->widget());-
555 lastDragDropEvent->setSource(event->source());-
556}
never executed: end of block
0
557-
558-
559-
560-
561void QGraphicsViewPrivate::populateSceneDragDropEvent(QGraphicsSceneDragDropEvent *dest,-
562 QDropEvent *source)-
563{-
564-
565 QGraphicsView * const q = q_func();-
566 dest->setScenePos(q->mapToScene(source->pos()));-
567 dest->setScreenPos(q->mapToGlobal(source->pos()));-
568 dest->setButtons(source->mouseButtons());-
569 dest->setModifiers(source->keyboardModifiers());-
570 dest->setPossibleActions(source->possibleActions());-
571 dest->setProposedAction(source->proposedAction());-
572 dest->setDropAction(source->dropAction());-
573 dest->setMimeData(source->mimeData());-
574 dest->setWidget(viewport);-
575 dest->setSource(qobject_cast<QWidget *>(source->source()));-
576-
577-
578-
579-
580}
never executed: end of block
0
581-
582-
583-
584-
585QRect QGraphicsViewPrivate::mapToViewRect(const QGraphicsItem *item, const QRectF &rect) const-
586{-
587 const QGraphicsView * const q = q_func();-
588 if (dirtyScroll
dirtyScrollDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
589 const_cast<
never executed: const_cast<QGraphicsViewPrivate *>(this)->updateScroll();
QGraphicsViewPrivate *>(this)->updateScroll();
never executed: const_cast<QGraphicsViewPrivate *>(this)->updateScroll();
0
590-
591 if (item->d_ptr->itemIsUntransformable()
item->d_ptr->i...ransformable()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
592 QTransform itv = item->deviceTransform(q->viewportTransform());-
593 return
never executed: return itv.mapRect(rect).toAlignedRect();
itv.mapRect(rect).toAlignedRect();
never executed: return itv.mapRect(rect).toAlignedRect();
0
594 }-
595-
596-
597-
598 QPointF offset;-
599 const QGraphicsItem *parentItem = item;-
600 const QGraphicsItemPrivate *itemd;-
601 do {-
602 itemd = parentItem->d_ptr.data();-
603 if (itemd->transformData
itemd->transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
604 break;
never executed: break;
0
605 offset += itemd->pos;-
606 }
never executed: end of block
while ((
(parentItem = itemd->parent)Description
TRUEnever evaluated
FALSEnever evaluated
parentItem = itemd->parent)
(parentItem = itemd->parent)Description
TRUEnever evaluated
FALSEnever evaluated
);
0
607-
608 QRectF baseRect = rect.translated(offset.x(), offset.y());-
609 if (!parentItem
!parentItemDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
610 if (identityMatrix
identityMatrixDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
611 baseRect.translate(-scrollX, -scrollY);-
612 return
never executed: return baseRect.toAlignedRect();
baseRect.toAlignedRect();
never executed: return baseRect.toAlignedRect();
0
613 }-
614 return
never executed: return matrix.mapRect(baseRect).translated(-scrollX, -scrollY).toAlignedRect();
matrix.mapRect(baseRect).translated(-scrollX, -scrollY).toAlignedRect();
never executed: return matrix.mapRect(baseRect).translated(-scrollX, -scrollY).toAlignedRect();
0
615 }-
616-
617 QTransform tr = parentItem->sceneTransform();-
618 if (!identityMatrix
!identityMatrixDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
619 tr *= matrix;
never executed: tr *= matrix;
0
620 QRectF r = tr.mapRect(baseRect);-
621 r.translate(-scrollX, -scrollY);-
622 return
never executed: return r.toAlignedRect();
r.toAlignedRect();
never executed: return r.toAlignedRect();
0
623}-
624-
625-
626-
627-
628QRegion QGraphicsViewPrivate::mapToViewRegion(const QGraphicsItem *item, const QRectF &rect) const-
629{-
630 const QGraphicsView * const q = q_func();-
631 if (dirtyScroll
dirtyScrollDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
632 const_cast<
never executed: const_cast<QGraphicsViewPrivate *>(this)->updateScroll();
QGraphicsViewPrivate *>(this)->updateScroll();
never executed: const_cast<QGraphicsViewPrivate *>(this)->updateScroll();
0
633-
634-
635 QTransform itv = item->deviceTransform(q->viewportTransform());-
636 return
never executed: return item->boundingRegion(itv) & itv.mapRect(rect).toAlignedRect();
item->boundingRegion(itv) & itv.mapRect(rect).toAlignedRect();
never executed: return item->boundingRegion(itv) & itv.mapRect(rect).toAlignedRect();
0
637}-
638-
639-
640-
641-
642void QGraphicsViewPrivate::processPendingUpdates()-
643{-
644 if (!scene
!sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
645 return;
never executed: return;
0
646-
647 if (fullUpdatePending
fullUpdatePendingDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
648 viewport->update();-
649 }
never executed: end of block
else if (viewportUpdateMode == QGraphicsView::BoundingRectViewportUpdate
viewportUpdate...ViewportUpdateDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
650 viewport->update(dirtyBoundingRect);-
651 }
never executed: end of block
else {
0
652 viewport->update(dirtyRegion);-
653 }
never executed: end of block
0
654-
655 dirtyBoundingRect = QRect();-
656 dirtyRegion = QRegion();-
657}
never executed: end of block
0
658-
659static inline bool intersectsViewport(const QRect &r, int width, int height)-
660{ return
never executed: return !(r.left() > width) && !(r.right() < 0) && !(r.top() >= height) && !(r.bottom() < 0);
!(r.left() > width) && !(r.right() < 0) && !(r.top() >= height) && !(r.bottom() < 0);
never executed: return !(r.left() > width) && !(r.right() < 0) && !(r.top() >= height) && !(r.bottom() < 0);
}
0
661-
662static inline bool containsViewport(const QRect &r, int width, int height)-
663{ return
never executed: return r.left() <= 0 && r.top() <= 0 && r.right() >= width - 1 && r.bottom() >= height - 1;
r.left() <= 0 && r.top() <= 0 && r.right() >= width - 1 && r.bottom() >= height - 1;
never executed: return r.left() <= 0 && r.top() <= 0 && r.right() >= width - 1 && r.bottom() >= height - 1;
}
0
664-
665static inline void QRect_unite(QRect *rect, const QRect &other)-
666{-
667 if (rect->isEmpty()
rect->isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
668 *rect = other;-
669 }
never executed: end of block
else {
0
670 rect->setCoords(qMin(rect->left(), other.left()), qMin(rect->top(), other.top()),-
671 qMax(rect->right(), other.right()), qMax(rect->bottom(), other.bottom()));-
672 }
never executed: end of block
0
673}-
674-
675-
676-
677-
678-
679-
680void QGraphicsViewPrivate::setUpdateClip(QGraphicsItem *item)-
681{-
682 QGraphicsView * const q = q_func();-
683-
684-
685 if (!item
!itemDescription
TRUEnever evaluated
FALSEnever evaluated
|| viewportUpdateMode == QGraphicsView::NoViewportUpdate
viewportUpdate...ViewportUpdateDescription
TRUEnever evaluated
FALSEnever evaluated
0
686 || viewportUpdateMode == QGraphicsView::FullViewportUpdate
viewportUpdate...ViewportUpdateDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
687 hasUpdateClip = false;-
688 return;
never executed: return;
0
689 }-
690-
691-
692-
693-
694-
695 QRect clip;-
696 if (item->d_ptr->itemIsUntransformable()
item->d_ptr->i...ransformable()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
697 QTransform xform = item->deviceTransform(q->viewportTransform());-
698 clip = xform.mapRect(item->boundingRect()).toAlignedRect();-
699 }
never executed: end of block
else if (item->d_ptr->sceneTransformTranslateOnly
item->d_ptr->s...mTranslateOnlyDescription
TRUEnever evaluated
FALSEnever evaluated
&& identityMatrix
identityMatrixDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
700 QRectF r(item->boundingRect());-
701 r.translate(item->d_ptr->sceneTransform.dx() - horizontalScroll(),-
702 item->d_ptr->sceneTransform.dy() - verticalScroll());-
703 clip = r.toAlignedRect();-
704 }
never executed: end of block
else if (!q->isTransformed()
!q->isTransformed()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
705 clip = item->d_ptr->sceneTransform.mapRect(item->boundingRect()).toAlignedRect();-
706 }
never executed: end of block
else {
0
707 QTransform xform = item->d_ptr->sceneTransform;-
708 xform *= q->viewportTransform();-
709 clip = xform.mapRect(item->boundingRect()).toAlignedRect();-
710 }
never executed: end of block
0
711-
712 if (hasUpdateClip
hasUpdateClipDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
713-
714 updateClip &= clip;-
715 }
never executed: end of block
else {
0
716 updateClip = clip;-
717 hasUpdateClip = true;-
718 }
never executed: end of block
0
719}-
720-
721bool QGraphicsViewPrivate::updateRegion(const QRectF &rect, const QTransform &xform)-
722{-
723 if (rect.isEmpty()
rect.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
724 return
never executed: return false;
false;
never executed: return false;
0
725-
726 if (viewportUpdateMode != QGraphicsView::MinimalViewportUpdate
viewportUpdate...ViewportUpdateDescription
TRUEnever evaluated
FALSEnever evaluated
0
727 && viewportUpdateMode != QGraphicsView::SmartViewportUpdate
viewportUpdate...ViewportUpdateDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
728-
729 return
never executed: return updateRectF(xform.mapRect(rect));
updateRectF(xform.mapRect(rect));
never executed: return updateRectF(xform.mapRect(rect));
0
730 }-
731-
732-
733-
734 const QRegion region = xform.map(QRegion(rect.toAlignedRect()));-
735 QRect viewRect = region.boundingRect();-
736 const bool dontAdjustForAntialiasing = optimizationFlags & QGraphicsView::DontAdjustForAntialiasing;-
737 if (dontAdjustForAntialiasing
dontAdjustForAntialiasingDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
738 viewRect.adjust(-1, -1, 1, 1);
never executed: viewRect.adjust(-1, -1, 1, 1);
0
739 else-
740 viewRect.adjust(-2, -2, 2, 2);
never executed: viewRect.adjust(-2, -2, 2, 2);
0
741 if (!intersectsViewport(viewRect, viewport->width(), viewport->height())
!intersectsVie...ort->height())Description
TRUEnever evaluated
FALSEnever evaluated
)
0
742 return
never executed: return false;
false;
never executed: return false;
0
743-
744 const QVector<QRect> &rects = region.rects();-
745 for (int i = 0; i < rects.size()
i < rects.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
746 viewRect = rects.at(i);-
747 if (dontAdjustForAntialiasing
dontAdjustForAntialiasingDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
748 viewRect.adjust(-1, -1, 1, 1);
never executed: viewRect.adjust(-1, -1, 1, 1);
0
749 else-
750 viewRect.adjust(-2, -2, 2, 2);
never executed: viewRect.adjust(-2, -2, 2, 2);
0
751 if (hasUpdateClip
hasUpdateClipDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
752 viewRect &= updateClip;
never executed: viewRect &= updateClip;
0
753 dirtyRegion += viewRect;-
754 }
never executed: end of block
0
755-
756 return
never executed: return true;
true;
never executed: return true;
0
757}-
758-
759-
760-
761bool QGraphicsViewPrivate::updateRect(const QRect &r)-
762{-
763 if (fullUpdatePending
fullUpdatePendingDescription
TRUEnever evaluated
FALSEnever evaluated
|| viewportUpdateMode == QGraphicsView::NoViewportUpdate
viewportUpdate...ViewportUpdateDescription
TRUEnever evaluated
FALSEnever evaluated
0
764 || !intersectsViewport(r, viewport->width(), viewport->height())
!intersectsVie...ort->height())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
765 return
never executed: return false;
false;
never executed: return false;
0
766 }-
767-
768 switch (viewportUpdateMode) {-
769 case
never executed: case QGraphicsView::FullViewportUpdate:
QGraphicsView::FullViewportUpdate:
never executed: case QGraphicsView::FullViewportUpdate:
0
770 fullUpdatePending = true;-
771 viewport->update();-
772 break;
never executed: break;
0
773 case
never executed: case QGraphicsView::BoundingRectViewportUpdate:
QGraphicsView::BoundingRectViewportUpdate:
never executed: case QGraphicsView::BoundingRectViewportUpdate:
0
774 if (hasUpdateClip
hasUpdateClipDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
775 QRect_unite(&dirtyBoundingRect, r & updateClip);
never executed: QRect_unite(&dirtyBoundingRect, r & updateClip);
0
776 else-
777 QRect_unite(&dirtyBoundingRect, r);
never executed: QRect_unite(&dirtyBoundingRect, r);
0
778 if (containsViewport(dirtyBoundingRect, viewport->width(), viewport->height())
containsViewpo...ort->height())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
779 fullUpdatePending = true;-
780 viewport->update();-
781 }
never executed: end of block
0
782 break;
never executed: break;
0
783 case
never executed: case QGraphicsView::SmartViewportUpdate:
QGraphicsView::SmartViewportUpdate:
never executed: case QGraphicsView::SmartViewportUpdate:
0
784 case
never executed: case QGraphicsView::MinimalViewportUpdate:
QGraphicsView::MinimalViewportUpdate:
never executed: case QGraphicsView::MinimalViewportUpdate:
0
785 if (hasUpdateClip
hasUpdateClipDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
786 dirtyRegion += r & updateClip;
never executed: dirtyRegion += r & updateClip;
0
787 else-
788 dirtyRegion += r;
never executed: dirtyRegion += r;
0
789 break;
never executed: break;
0
790 default
never executed: default:
:
never executed: default:
0
791 break;
never executed: break;
0
792 }-
793-
794 return
never executed: return true;
true;
never executed: return true;
0
795}-
796-
797QStyleOptionGraphicsItem *QGraphicsViewPrivate::allocStyleOptionsArray(int numItems)-
798{-
799 if (mustAllocateStyleOptions
mustAllocateStyleOptionsDescription
TRUEnever evaluated
FALSEnever evaluated
|| (
(numItems > st...ns.capacity())Description
TRUEnever evaluated
FALSEnever evaluated
numItems > styleOptions.capacity())
(numItems > st...ns.capacity())Description
TRUEnever evaluated
FALSEnever evaluated
)
0
800-
801 return
never executed: return new QStyleOptionGraphicsItem[numItems];
new QStyleOptionGraphicsItem[numItems];
never executed: return new QStyleOptionGraphicsItem[numItems];
0
802-
803-
804 if (numItems > styleOptions.size()
numItems > styleOptions.size()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
805 styleOptions.resize(numItems);
never executed: styleOptions.resize(numItems);
0
806-
807 mustAllocateStyleOptions = true;-
808 return
never executed: return styleOptions.data();
styleOptions.data();
never executed: return styleOptions.data();
0
809}-
810-
811void QGraphicsViewPrivate::freeStyleOptionsArray(QStyleOptionGraphicsItem *array)-
812{-
813 mustAllocateStyleOptions = false;-
814 if (array != styleOptions.data()
array != styleOptions.data()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
815 delete [] array;
never executed: delete [] array;
0
816}
never executed: end of block
0
817-
818extern QPainterPath qt_regionToPath(const QRegion &region);-
819QList<QGraphicsItem *> QGraphicsViewPrivate::findItems(const QRegion &exposedRegion, bool *allItems,-
820 const QTransform &viewTransform) const-
821{-
822 const QGraphicsView * const q = q_func();-
823-
824-
825-
826-
827 const QRectF exposedRegionSceneBounds = q->mapToScene(exposedRegion.boundingRect().adjusted(-1, -1, 1, 1))-
828 .boundingRect();-
829 if (exposedRegionSceneBounds.contains(scene->sceneRect())
exposedRegionS...->sceneRect())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
830 ((!(allItems)) ? qt_assert("allItems",__FILE__,1128) : qt_noop());-
831 *allItems = true;-
832-
833-
834 return
never executed: return scene->items(Qt::AscendingOrder);
scene->items(Qt::AscendingOrder);
never executed: return scene->items(Qt::AscendingOrder);
0
835 }-
836-
837-
838-
839-
840 bool simpleRectLookup = exposedRegion.rectCount() == 1
exposedRegion.rectCount() == 1Description
TRUEnever evaluated
FALSEnever evaluated
&& matrix.type() <= QTransform::TxScale
matrix.type() ...sform::TxScaleDescription
TRUEnever evaluated
FALSEnever evaluated
;
0
841 if (simpleRectLookup
simpleRectLookupDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
842 return
never executed: return scene->items(exposedRegionSceneBounds, Qt::IntersectsItemBoundingRect, Qt::AscendingOrder, viewTransform);
scene->items(exposedRegionSceneBounds,
never executed: return scene->items(exposedRegionSceneBounds, Qt::IntersectsItemBoundingRect, Qt::AscendingOrder, viewTransform);
0
843 Qt::IntersectsItemBoundingRect,
never executed: return scene->items(exposedRegionSceneBounds, Qt::IntersectsItemBoundingRect, Qt::AscendingOrder, viewTransform);
0
844 Qt::AscendingOrder, viewTransform);
never executed: return scene->items(exposedRegionSceneBounds, Qt::IntersectsItemBoundingRect, Qt::AscendingOrder, viewTransform);
0
845 }-
846-
847-
848-
849-
850 QRegion adjustedRegion;-
851 const auto rects = exposedRegion.rects();-
852 for (const QRect &r : rects)-
853 adjustedRegion += r.adjusted(-1, -1, 1, 1);
never executed: adjustedRegion += r.adjusted(-1, -1, 1, 1);
0
854-
855 const QPainterPath exposedScenePath(q->mapToScene(qt_regionToPath(adjustedRegion)));-
856 return
never executed: return scene->items(exposedScenePath, Qt::IntersectsItemBoundingRect, Qt::AscendingOrder, viewTransform);
scene->items(exposedScenePath, Qt::IntersectsItemBoundingRect,
never executed: return scene->items(exposedScenePath, Qt::IntersectsItemBoundingRect, Qt::AscendingOrder, viewTransform);
0
857 Qt::AscendingOrder, viewTransform);
never executed: return scene->items(exposedScenePath, Qt::IntersectsItemBoundingRect, Qt::AscendingOrder, viewTransform);
0
858}-
859void QGraphicsViewPrivate::updateInputMethodSensitivity()-
860{-
861 QGraphicsView * const q = q_func();-
862 QGraphicsItem *focusItem = 0;-
863 bool enabled = scene
sceneDescription
TRUEnever evaluated
FALSEnever evaluated
&& (
(focusItem = s...->focusItem())Description
TRUEnever evaluated
FALSEnever evaluated
focusItem = scene->focusItem())
(focusItem = s...->focusItem())Description
TRUEnever evaluated
FALSEnever evaluated
0
864 && (
(focusItem->d_...tsInputMethod)Description
TRUEnever evaluated
FALSEnever evaluated
focusItem->d_ptr->flags & QGraphicsItem::ItemAcceptsInputMethod)
(focusItem->d_...tsInputMethod)Description
TRUEnever evaluated
FALSEnever evaluated
;
0
865 q->setAttribute(Qt::WA_InputMethodEnabled, enabled);-
866 q->viewport()->setAttribute(Qt::WA_InputMethodEnabled, enabled);-
867-
868 if (!enabled
!enabledDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
869 q->setInputMethodHints(0);-
870 return;
never executed: return;
0
871 }-
872-
873 QGraphicsProxyWidget *proxy = focusItem->d_ptr->isWidget
focusItem->d_ptr->isWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
&& focusItem->d_ptr->isProxyWidget()
focusItem->d_p...sProxyWidget()Description
TRUEnever evaluated
FALSEnever evaluated
0
874 ? static_cast<QGraphicsProxyWidget *>(focusItem) : 0;-
875 if (!proxy
!proxyDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
876 q->setInputMethodHints(focusItem->inputMethodHints());-
877 }
never executed: end of block
else if (QWidget *widget = proxy->widget()
QWidget *widge...roxy->widget()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
878 if (QWidget *fw = widget->focusWidget()
QWidget *fw = ...>focusWidget()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
879 widget = fw;
never executed: widget = fw;
0
880 q->setInputMethodHints(widget->inputMethodHints());-
881 }
never executed: end of block
else {
0
882 q->setInputMethodHints(0);-
883 }
never executed: end of block
0
884}-
885-
886-
887-
888-
889QGraphicsView::QGraphicsView(QWidget *parent)-
890 : QAbstractScrollArea(*new QGraphicsViewPrivate, parent)-
891{-
892 setViewport(0);-
893 setAcceptDrops(true);-
894 setBackgroundRole(QPalette::Base);-
895-
896 setAttribute(Qt::WA_InputMethodEnabled);-
897 viewport()->setAttribute(Qt::WA_InputMethodEnabled);-
898}
never executed: end of block
0
899-
900-
901-
902-
903-
904QGraphicsView::QGraphicsView(QGraphicsScene *scene, QWidget *parent)-
905 : QAbstractScrollArea(*new QGraphicsViewPrivate, parent)-
906{-
907 setScene(scene);-
908 setViewport(0);-
909 setAcceptDrops(true);-
910 setBackgroundRole(QPalette::Base);-
911-
912 setAttribute(Qt::WA_InputMethodEnabled);-
913 viewport()->setAttribute(Qt::WA_InputMethodEnabled);-
914}
never executed: end of block
0
915-
916-
917-
918-
919QGraphicsView::QGraphicsView(QGraphicsViewPrivate &dd, QWidget *parent)-
920 : QAbstractScrollArea(dd, parent)-
921{-
922 setViewport(0);-
923 setAcceptDrops(true);-
924 setBackgroundRole(QPalette::Base);-
925-
926 setAttribute(Qt::WA_InputMethodEnabled);-
927 viewport()->setAttribute(Qt::WA_InputMethodEnabled);-
928}
never executed: end of block
0
929-
930-
931-
932-
933QGraphicsView::~QGraphicsView()-
934{-
935 QGraphicsViewPrivate * const d = d_func();-
936 if (d->scene
d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
937 d->scene->d_func()->views.removeAll(this);
never executed: d->scene->d_func()->views.removeAll(this);
0
938 delete d->lastDragDropEvent;-
939}
never executed: end of block
0
940-
941-
942-
943-
944QSize QGraphicsView::sizeHint() const-
945{-
946 const QGraphicsViewPrivate * const d = d_func();-
947 if (d->scene
d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
948 QSizeF baseSize = d->matrix.mapRect(sceneRect()).size();-
949 baseSize += QSizeF(d->frameWidth * 2, d->frameWidth * 2);-
950 return
never executed: return baseSize.boundedTo((3 * QApplication::desktop()->size()) / 4).toSize();
baseSize.boundedTo((3 * QApplication::desktop()->size()) / 4).toSize();
never executed: return baseSize.boundedTo((3 * QApplication::desktop()->size()) / 4).toSize();
0
951 }-
952 return
never executed: return QAbstractScrollArea::sizeHint();
QAbstractScrollArea::sizeHint();
never executed: return QAbstractScrollArea::sizeHint();
0
953}-
954QPainter::RenderHints QGraphicsView::renderHints() const-
955{-
956 const QGraphicsViewPrivate * const d = d_func();-
957 return
never executed: return d->renderHints;
d->renderHints;
never executed: return d->renderHints;
0
958}-
959void QGraphicsView::setRenderHints(QPainter::RenderHints hints)-
960{-
961 QGraphicsViewPrivate * const d = d_func();-
962 if (hints == d->renderHints
hints == d->renderHintsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
963 return;
never executed: return;
0
964 d->renderHints = hints;-
965 d->updateAll();-
966}
never executed: end of block
0
967-
968-
969-
970-
971-
972-
973-
974void QGraphicsView::setRenderHint(QPainter::RenderHint hint, bool enabled)-
975{-
976 QGraphicsViewPrivate * const d = d_func();-
977 QPainter::RenderHints oldHints = d->renderHints;-
978 d->renderHints.setFlag(hint, enabled);-
979 if (oldHints != d->renderHints
oldHints != d->renderHintsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
980 d->updateAll();
never executed: d->updateAll();
0
981}
never executed: end of block
0
982Qt::Alignment QGraphicsView::alignment() const-
983{-
984 const QGraphicsViewPrivate * const d = d_func();-
985 return
never executed: return d->alignment;
d->alignment;
never executed: return d->alignment;
0
986}-
987void QGraphicsView::setAlignment(Qt::Alignment alignment)-
988{-
989 QGraphicsViewPrivate * const d = d_func();-
990 if (d->alignment != alignment
d->alignment != alignmentDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
991 d->alignment = alignment;-
992 d->recalculateContentSize();-
993 }
never executed: end of block
0
994}
never executed: end of block
0
995QGraphicsView::ViewportAnchor QGraphicsView::transformationAnchor() const-
996{-
997 const QGraphicsViewPrivate * const d = d_func();-
998 return
never executed: return d->transformationAnchor;
d->transformationAnchor;
never executed: return d->transformationAnchor;
0
999}-
1000void QGraphicsView::setTransformationAnchor(ViewportAnchor anchor)-
1001{-
1002 QGraphicsViewPrivate * const d = d_func();-
1003 d->transformationAnchor = anchor;-
1004-
1005-
1006-
1007 if (d->transformationAnchor == AnchorUnderMouse
d->transformat...chorUnderMouseDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1008 d->viewport->setMouseTracking(true);
never executed: d->viewport->setMouseTracking(true);
0
1009}
never executed: end of block
0
1010QGraphicsView::ViewportAnchor QGraphicsView::resizeAnchor() const-
1011{-
1012 const QGraphicsViewPrivate * const d = d_func();-
1013 return
never executed: return d->resizeAnchor;
d->resizeAnchor;
never executed: return d->resizeAnchor;
0
1014}-
1015void QGraphicsView::setResizeAnchor(ViewportAnchor anchor)-
1016{-
1017 QGraphicsViewPrivate * const d = d_func();-
1018 d->resizeAnchor = anchor;-
1019-
1020-
1021-
1022 if (d->resizeAnchor == AnchorUnderMouse
d->resizeAncho...chorUnderMouseDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1023 d->viewport->setMouseTracking(true);
never executed: d->viewport->setMouseTracking(true);
0
1024}
never executed: end of block
0
1025QGraphicsView::ViewportUpdateMode QGraphicsView::viewportUpdateMode() const-
1026{-
1027 const QGraphicsViewPrivate * const d = d_func();-
1028 return
never executed: return d->viewportUpdateMode;
d->viewportUpdateMode;
never executed: return d->viewportUpdateMode;
0
1029}-
1030void QGraphicsView::setViewportUpdateMode(ViewportUpdateMode mode)-
1031{-
1032 QGraphicsViewPrivate * const d = d_func();-
1033 d->viewportUpdateMode = mode;-
1034}
never executed: end of block
0
1035QGraphicsView::OptimizationFlags QGraphicsView::optimizationFlags() const-
1036{-
1037 const QGraphicsViewPrivate * const d = d_func();-
1038 return
never executed: return d->optimizationFlags;
d->optimizationFlags;
never executed: return d->optimizationFlags;
0
1039}-
1040void QGraphicsView::setOptimizationFlags(OptimizationFlags flags)-
1041{-
1042 QGraphicsViewPrivate * const d = d_func();-
1043 d->optimizationFlags = flags;-
1044}
never executed: end of block
0
1045-
1046-
1047-
1048-
1049-
1050-
1051void QGraphicsView::setOptimizationFlag(OptimizationFlag flag, bool enabled)-
1052{-
1053 QGraphicsViewPrivate * const d = d_func();-
1054 d->optimizationFlags.setFlag(flag, enabled);-
1055}
never executed: end of block
0
1056QGraphicsView::DragMode QGraphicsView::dragMode() const-
1057{-
1058 const QGraphicsViewPrivate * const d = d_func();-
1059 return
never executed: return d->dragMode;
d->dragMode;
never executed: return d->dragMode;
0
1060}-
1061void QGraphicsView::setDragMode(DragMode mode)-
1062{-
1063 QGraphicsViewPrivate * const d = d_func();-
1064 if (d->dragMode == mode
d->dragMode == modeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1065 return;
never executed: return;
0
1066-
1067-
1068 if (d->dragMode == ScrollHandDrag
d->dragMode == ScrollHandDragDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1069 viewport()->unsetCursor();
never executed: viewport()->unsetCursor();
0
1070-
1071-
1072-
1073-
1074-
1075-
1076 if (d->dragMode == ScrollHandDrag
d->dragMode == ScrollHandDragDescription
TRUEnever evaluated
FALSEnever evaluated
&& mode == NoDrag
mode == NoDragDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->handScrolling
d->handScrollingDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1077 d->handScrolling = false;
never executed: d->handScrolling = false;
0
1078-
1079 d->dragMode = mode;-
1080-
1081-
1082 if (d->dragMode == ScrollHandDrag
d->dragMode == ScrollHandDragDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1083-
1084 d->hasStoredOriginalCursor = false;-
1085 viewport()->setCursor(Qt::OpenHandCursor);-
1086 }
never executed: end of block
0
1087-
1088}
never executed: end of block
0
1089Qt::ItemSelectionMode QGraphicsView::rubberBandSelectionMode() const-
1090{-
1091 const QGraphicsViewPrivate * const d = d_func();-
1092 return
never executed: return d->rubberBandSelectionMode;
d->rubberBandSelectionMode;
never executed: return d->rubberBandSelectionMode;
0
1093}-
1094void QGraphicsView::setRubberBandSelectionMode(Qt::ItemSelectionMode mode)-
1095{-
1096 QGraphicsViewPrivate * const d = d_func();-
1097 d->rubberBandSelectionMode = mode;-
1098}
never executed: end of block
0
1099QRect QGraphicsView::rubberBandRect() const-
1100{-
1101 const QGraphicsViewPrivate * const d = d_func();-
1102 if (d->dragMode != QGraphicsView::RubberBandDrag
d->dragMode !=...RubberBandDragDescription
TRUEnever evaluated
FALSEnever evaluated
|| !d->sceneInteractionAllowed
!d->sceneInteractionAllowedDescription
TRUEnever evaluated
FALSEnever evaluated
|| !d->rubberBanding
!d->rubberBandingDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1103 return
never executed: return QRect();
QRect();
never executed: return QRect();
0
1104-
1105 return
never executed: return d->rubberBandRect;
d->rubberBandRect;
never executed: return d->rubberBandRect;
0
1106}-
1107QGraphicsView::CacheMode QGraphicsView::cacheMode() const-
1108{-
1109 const QGraphicsViewPrivate * const d = d_func();-
1110 return
never executed: return d->cacheMode;
d->cacheMode;
never executed: return d->cacheMode;
0
1111}-
1112void QGraphicsView::setCacheMode(CacheMode mode)-
1113{-
1114 QGraphicsViewPrivate * const d = d_func();-
1115 if (mode == d->cacheMode
mode == d->cacheModeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1116 return;
never executed: return;
0
1117 d->cacheMode = mode;-
1118 resetCachedContent();-
1119}
never executed: end of block
0
1120void QGraphicsView::resetCachedContent()-
1121{-
1122 QGraphicsViewPrivate * const d = d_func();-
1123 if (d->cacheMode == CacheNone
d->cacheMode == CacheNoneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1124 return;
never executed: return;
0
1125-
1126 if (d->cacheMode & CacheBackground
d->cacheMode & CacheBackgroundDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1127-
1128 d->mustResizeBackgroundPixmap = true;-
1129 d->updateAll();-
1130 }
never executed: end of block
else if (d->mustResizeBackgroundPixmap
d->mustResizeBackgroundPixmapDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1131-
1132-
1133 d->mustResizeBackgroundPixmap = false;-
1134 d->backgroundPixmap = QPixmap();-
1135 d->backgroundPixmapExposed = QRegion();-
1136 }
never executed: end of block
0
1137}
never executed: end of block
0
1138void QGraphicsView::invalidateScene(const QRectF &rect, QGraphicsScene::SceneLayers layers)-
1139{-
1140 QGraphicsViewPrivate * const d = d_func();-
1141 if ((
(layers & QGra...ckgroundLayer)Description
TRUEnever evaluated
FALSEnever evaluated
layers & QGraphicsScene::BackgroundLayer)
(layers & QGra...ckgroundLayer)Description
TRUEnever evaluated
FALSEnever evaluated
&& !d->mustResizeBackgroundPixmap
!d->mustResizeBackgroundPixmapDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1142 QRect viewRect = mapFromScene(rect).boundingRect();-
1143 if (viewport()->rect().intersects(viewRect)
viewport()->re...ects(viewRect)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1144-
1145-
1146 d->backgroundPixmapExposed += viewRect;-
1147 if (d->scene
d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1148 d->scene->update(rect);
never executed: d->scene->update(rect);
0
1149 }
never executed: end of block
0
1150 }
never executed: end of block
0
1151}
never executed: end of block
0
1152bool QGraphicsView::isInteractive() const-
1153{-
1154 const QGraphicsViewPrivate * const d = d_func();-
1155 return
never executed: return d->sceneInteractionAllowed;
d->sceneInteractionAllowed;
never executed: return d->sceneInteractionAllowed;
0
1156}-
1157void QGraphicsView::setInteractive(bool allowed)-
1158{-
1159 QGraphicsViewPrivate * const d = d_func();-
1160 d->sceneInteractionAllowed = allowed;-
1161}
never executed: end of block
0
1162-
1163-
1164-
1165-
1166-
1167-
1168-
1169QGraphicsScene *QGraphicsView::scene() const-
1170{-
1171 const QGraphicsViewPrivate * const d = d_func();-
1172 return
never executed: return d->scene;
d->scene;
never executed: return d->scene;
0
1173}-
1174void QGraphicsView::setScene(QGraphicsScene *scene)-
1175{-
1176 QGraphicsViewPrivate * const d = d_func();-
1177 if (d->scene == scene
d->scene == sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1178 return;
never executed: return;
0
1179-
1180-
1181 d->updateAll();-
1182-
1183-
1184 if (d->scene
d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1185 disconnect(d->scene, qFlagLocation("2""changed(QList<QRectF>)" "\0" __FILE__ ":" "1712"),-
1186 this, qFlagLocation("1""updateScene(QList<QRectF>)" "\0" __FILE__ ":" "1713"));-
1187 disconnect(d->scene, qFlagLocation("2""sceneRectChanged(QRectF)" "\0" __FILE__ ":" "1714"),-
1188 this, qFlagLocation("1""updateSceneRect(QRectF)" "\0" __FILE__ ":" "1715"));-
1189 d->scene->d_func()->removeView(this);-
1190 d->connectedToScene = false;-
1191-
1192 if (isActiveWindow()
isActiveWindow()Description
TRUEnever evaluated
FALSEnever evaluated
&& isVisible()
isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1193 QEvent windowDeactivate(QEvent::WindowDeactivate);-
1194 QApplication::sendEvent(d->scene, &windowDeactivate);-
1195 }
never executed: end of block
0
1196 if(hasFocus()
hasFocus()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1197 d->scene->clearFocus();
never executed: d->scene->clearFocus();
0
1198 }
never executed: end of block
0
1199-
1200-
1201 if ((
(d->scene = scene)Description
TRUEnever evaluated
FALSEnever evaluated
d->scene = scene)
(d->scene = scene)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1202 connect(d->scene, qFlagLocation("2""sceneRectChanged(QRectF)" "\0" __FILE__ ":" "1729"),-
1203 this, qFlagLocation("1""updateSceneRect(QRectF)" "\0" __FILE__ ":" "1730"));-
1204 d->updateSceneSlotReimplementedChecked = false;-
1205 d->scene->d_func()->addView(this);-
1206 d->recalculateContentSize();-
1207 d->lastCenterPoint = sceneRect().center();-
1208 d->keepLastCenterPoint = true;-
1209-
1210-
1211 if (!d->scene->d_func()->allItemsIgnoreHoverEvents
!d->scene->d_f...oreHoverEventsDescription
TRUEnever evaluated
FALSEnever evaluated
0
1212 || !d->scene->d_func()->allItemsUseDefaultCursor
!d->scene->d_f...eDefaultCursorDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1213 d->viewport->setMouseTracking(true);-
1214 }
never executed: end of block
0
1215-
1216-
1217 if (!d->scene->d_func()->allItemsIgnoreTouchEvents
!d->scene->d_f...oreTouchEventsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1218 d->viewport->setAttribute(Qt::WA_AcceptTouchEvents);
never executed: d->viewport->setAttribute(Qt::WA_AcceptTouchEvents);
0
1219-
1220 if (isActiveWindow()
isActiveWindow()Description
TRUEnever evaluated
FALSEnever evaluated
&& isVisible()
isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1221 QEvent windowActivate(QEvent::WindowActivate);-
1222 QApplication::sendEvent(d->scene, &windowActivate);-
1223 }
never executed: end of block
0
1224 }
never executed: end of block
else {
0
1225 d->recalculateContentSize();-
1226 }
never executed: end of block
0
1227-
1228 d->updateInputMethodSensitivity();-
1229-
1230 if (d->scene
d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
&& hasFocus()
hasFocus()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1231 d->scene->setFocus();
never executed: d->scene->setFocus();
0
1232}
never executed: end of block
0
1233QRectF QGraphicsView::sceneRect() const-
1234{-
1235 const QGraphicsViewPrivate * const d = d_func();-
1236 if (d->hasSceneRect
d->hasSceneRectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1237 return
never executed: return d->sceneRect;
d->sceneRect;
never executed: return d->sceneRect;
0
1238 if (d->scene
d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1239 return
never executed: return d->scene->sceneRect();
d->scene->sceneRect();
never executed: return d->scene->sceneRect();
0
1240 return
never executed: return QRectF();
QRectF();
never executed: return QRectF();
0
1241}-
1242void QGraphicsView::setSceneRect(const QRectF &rect)-
1243{-
1244 QGraphicsViewPrivate * const d = d_func();-
1245 d->hasSceneRect = !rect.isNull();-
1246 d->sceneRect = rect;-
1247 d->recalculateContentSize();-
1248}
never executed: end of block
0
1249-
1250-
1251-
1252-
1253-
1254-
1255-
1256QMatrix QGraphicsView::matrix() const-
1257{-
1258 const QGraphicsViewPrivate * const d = d_func();-
1259 return
never executed: return d->matrix.toAffine();
d->matrix.toAffine();
never executed: return d->matrix.toAffine();
0
1260}-
1261void QGraphicsView::setMatrix(const QMatrix &matrix, bool combine)-
1262{-
1263 setTransform(QTransform(matrix), combine);-
1264}
never executed: end of block
0
1265-
1266-
1267-
1268-
1269-
1270-
1271void QGraphicsView::resetMatrix()-
1272{-
1273 resetTransform();-
1274}
never executed: end of block
0
1275-
1276-
1277-
1278-
1279-
1280-
1281void QGraphicsView::rotate(qreal angle)-
1282{-
1283 QGraphicsViewPrivate * const d = d_func();-
1284 QTransform matrix = d->matrix;-
1285 matrix.rotate(angle);-
1286 setTransform(matrix);-
1287}
never executed: end of block
0
1288-
1289-
1290-
1291-
1292-
1293-
1294void QGraphicsView::scale(qreal sx, qreal sy)-
1295{-
1296 QGraphicsViewPrivate * const d = d_func();-
1297 QTransform matrix = d->matrix;-
1298 matrix.scale(sx, sy);-
1299 setTransform(matrix);-
1300}
never executed: end of block
0
1301-
1302-
1303-
1304-
1305-
1306-
1307void QGraphicsView::shear(qreal sh, qreal sv)-
1308{-
1309 QGraphicsViewPrivate * const d = d_func();-
1310 QTransform matrix = d->matrix;-
1311 matrix.shear(sh, sv);-
1312 setTransform(matrix);-
1313}
never executed: end of block
0
1314-
1315-
1316-
1317-
1318-
1319-
1320void QGraphicsView::translate(qreal dx, qreal dy)-
1321{-
1322 QGraphicsViewPrivate * const d = d_func();-
1323 QTransform matrix = d->matrix;-
1324 matrix.translate(dx, dy);-
1325 setTransform(matrix);-
1326}
never executed: end of block
0
1327void QGraphicsView::centerOn(const QPointF &pos)-
1328{-
1329 QGraphicsViewPrivate * const d = d_func();-
1330 qreal width = viewport()->width();-
1331 qreal height = viewport()->height();-
1332 QPointF viewPoint = d->matrix.map(pos);-
1333 QPointF oldCenterPoint = pos;-
1334-
1335 if (!d->leftIndent
!d->leftIndentDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1336 if (isRightToLeft()
isRightToLeft()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1337 qint64 horizontal = 0;-
1338 horizontal += horizontalScrollBar()->minimum();-
1339 horizontal += horizontalScrollBar()->maximum();-
1340 horizontal -= int(viewPoint.x() - width / 2.0);-
1341 horizontalScrollBar()->setValue(horizontal);-
1342 }
never executed: end of block
else {
0
1343 horizontalScrollBar()->setValue(int(viewPoint.x() - width / 2.0));-
1344 }
never executed: end of block
0
1345 }-
1346 if (!d->topIndent
!d->topIndentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1347 verticalScrollBar()->setValue(int(viewPoint.y() - height / 2.0));
never executed: verticalScrollBar()->setValue(int(viewPoint.y() - height / 2.0));
0
1348 d->lastCenterPoint = oldCenterPoint;-
1349}
never executed: end of block
0
1350void QGraphicsView::centerOn(const QGraphicsItem *item)-
1351{-
1352 centerOn(item->sceneBoundingRect().center());-
1353}
never executed: end of block
0
1354void QGraphicsView::ensureVisible(const QRectF &rect, int xmargin, int ymargin)-
1355{-
1356 QGraphicsViewPrivate * const d = d_func();-
1357 qreal width = viewport()->width();-
1358 qreal height = viewport()->height();-
1359 QRectF viewRect = d->matrix.mapRect(rect);-
1360-
1361 qreal left = d->horizontalScroll();-
1362 qreal right = left + width;-
1363 qreal top = d->verticalScroll();-
1364 qreal bottom = top + height;-
1365-
1366 if (viewRect.left() <= left + xmargin
viewRect.left(...left + xmarginDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1367-
1368 if (!d->leftIndent
!d->leftIndentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1369 horizontalScrollBar()->setValue(int(viewRect.left() - xmargin - 0.5));
never executed: horizontalScrollBar()->setValue(int(viewRect.left() - xmargin - 0.5));
0
1370 }
never executed: end of block
0
1371 if (viewRect.right() >= right - xmargin
viewRect.right...ight - xmarginDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1372-
1373 if (!d->leftIndent
!d->leftIndentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1374 horizontalScrollBar()->setValue(int(viewRect.right() - width + xmargin + 0.5));
never executed: horizontalScrollBar()->setValue(int(viewRect.right() - width + xmargin + 0.5));
0
1375 }
never executed: end of block
0
1376 if (viewRect.top() <= top + ymargin
viewRect.top()... top + ymarginDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1377-
1378 if (!d->topIndent
!d->topIndentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1379 verticalScrollBar()->setValue(int(viewRect.top() - ymargin - 0.5));
never executed: verticalScrollBar()->setValue(int(viewRect.top() - ymargin - 0.5));
0
1380 }
never executed: end of block
0
1381 if (viewRect.bottom() >= bottom - ymargin
viewRect.botto...ttom - ymarginDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1382-
1383 if (!d->topIndent
!d->topIndentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1384 verticalScrollBar()->setValue(int(viewRect.bottom() - height + ymargin + 0.5));
never executed: verticalScrollBar()->setValue(int(viewRect.bottom() - height + ymargin + 0.5));
0
1385 }
never executed: end of block
0
1386}
never executed: end of block
0
1387void QGraphicsView::ensureVisible(const QGraphicsItem *item, int xmargin, int ymargin)-
1388{-
1389 ensureVisible(item->sceneBoundingRect(), xmargin, ymargin);-
1390}
never executed: end of block
0
1391void QGraphicsView::fitInView(const QRectF &rect, Qt::AspectRatioMode aspectRatioMode)-
1392{-
1393 QGraphicsViewPrivate * const d = d_func();-
1394 if (!d->scene
!d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
|| rect.isNull()
rect.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1395 return;
never executed: return;
0
1396-
1397-
1398 QRectF unity = d->matrix.mapRect(QRectF(0, 0, 1, 1));-
1399 if (unity.isEmpty()
unity.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1400 return;
never executed: return;
0
1401 scale(1 / unity.width(), 1 / unity.height());-
1402-
1403-
1404 int margin = 2;-
1405 QRectF viewRect = viewport()->rect().adjusted(margin, margin, -margin, -margin);-
1406 if (viewRect.isEmpty()
viewRect.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1407 return;
never executed: return;
0
1408 QRectF sceneRect = d->matrix.mapRect(rect);-
1409 if (sceneRect.isEmpty()
sceneRect.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1410 return;
never executed: return;
0
1411 qreal xratio = viewRect.width() / sceneRect.width();-
1412 qreal yratio = viewRect.height() / sceneRect.height();-
1413-
1414-
1415 switch (aspectRatioMode) {-
1416 case
never executed: case Qt::KeepAspectRatio:
Qt::KeepAspectRatio:
never executed: case Qt::KeepAspectRatio:
0
1417 xratio = yratio = qMin(xratio, yratio);-
1418 break;
never executed: break;
0
1419 case
never executed: case Qt::KeepAspectRatioByExpanding:
Qt::KeepAspectRatioByExpanding:
never executed: case Qt::KeepAspectRatioByExpanding:
0
1420 xratio = yratio = qMax(xratio, yratio);-
1421 break;
never executed: break;
0
1422 case
never executed: case Qt::IgnoreAspectRatio:
Qt::IgnoreAspectRatio:
never executed: case Qt::IgnoreAspectRatio:
0
1423 break;
never executed: break;
0
1424 }-
1425-
1426-
1427 scale(xratio, yratio);-
1428 centerOn(rect.center());-
1429}
never executed: end of block
0
1430void QGraphicsView::fitInView(const QGraphicsItem *item, Qt::AspectRatioMode aspectRatioMode)-
1431{-
1432 QPainterPath path = item->isClipped()
item->isClipped()Description
TRUEnever evaluated
FALSEnever evaluated
? item->clipPath() : item->shape();
0
1433 if (item->d_ptr->hasTranslateOnlySceneTransform()
item->d_ptr->h...eneTransform()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1434 path.translate(item->d_ptr->sceneTransform.dx(), item->d_ptr->sceneTransform.dy());-
1435 fitInView(path.boundingRect(), aspectRatioMode);-
1436 }
never executed: end of block
else {
0
1437 fitInView(item->d_ptr->sceneTransform.map(path).boundingRect(), aspectRatioMode);-
1438 }
never executed: end of block
0
1439}-
1440void QGraphicsView::render(QPainter *painter, const QRectF &target, const QRect &source,-
1441 Qt::AspectRatioMode aspectRatioMode)-
1442{-
1443-
1444-
1445 QGraphicsViewPrivate * const d = d_func();-
1446 if (!d->scene
!d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
|| !(painter
painterDescription
TRUEnever evaluated
FALSEnever evaluated
&& painter->isActive()
painter->isActive()Description
TRUEnever evaluated
FALSEnever evaluated
))
0
1447 return;
never executed: return;
0
1448-
1449-
1450 QRect sourceRect = source;-
1451 if (source.isNull()
source.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1452 sourceRect = viewport()->rect();
never executed: sourceRect = viewport()->rect();
0
1453-
1454-
1455 QRectF targetRect = target;-
1456 if (target.isNull()
target.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1457 if (painter->device()->devType() == QInternal::Picture
painter->devic...ernal::PictureDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1458 targetRect = sourceRect;
never executed: targetRect = sourceRect;
0
1459 else-
1460 targetRect.setRect(0, 0, painter->device()->width(), painter->device()->height());
never executed: targetRect.setRect(0, 0, painter->device()->width(), painter->device()->height());
0
1461 }-
1462-
1463-
1464 qreal xratio = targetRect.width() / sourceRect.width();-
1465 qreal yratio = targetRect.height() / sourceRect.height();-
1466-
1467-
1468 switch (aspectRatioMode) {-
1469 case
never executed: case Qt::KeepAspectRatio:
Qt::KeepAspectRatio:
never executed: case Qt::KeepAspectRatio:
0
1470 xratio = yratio = qMin(xratio, yratio);-
1471 break;
never executed: break;
0
1472 case
never executed: case Qt::KeepAspectRatioByExpanding:
Qt::KeepAspectRatioByExpanding:
never executed: case Qt::KeepAspectRatioByExpanding:
0
1473 xratio = yratio = qMax(xratio, yratio);-
1474 break;
never executed: break;
0
1475 case
never executed: case Qt::IgnoreAspectRatio:
Qt::IgnoreAspectRatio:
never executed: case Qt::IgnoreAspectRatio:
0
1476 break;
never executed: break;
0
1477 }-
1478-
1479-
1480-
1481 QPolygonF sourceScenePoly = mapToScene(sourceRect.adjusted(-1, -1, 1, 1));-
1482 QList<QGraphicsItem *> itemList = d->scene->items(sourceScenePoly,-
1483 Qt::IntersectsItemBoundingRect);-
1484 QGraphicsItem **itemArray = new QGraphicsItem *[itemList.size()];-
1485 int numItems = itemList.size();-
1486 for (int i = 0; i < numItems
i < numItemsDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
1487 itemArray[numItems - i - 1] = itemList.at(i);
never executed: itemArray[numItems - i - 1] = itemList.at(i);
0
1488 itemList.clear();-
1489-
1490-
1491 QTransform moveMatrix = QTransform::fromTranslate(-d->horizontalScroll(), -d->verticalScroll());-
1492 QTransform painterMatrix = d->matrix * moveMatrix;-
1493 painterMatrix *= QTransform()-
1494 .translate(targetRect.left(), targetRect.top())-
1495 .scale(xratio, yratio)-
1496 .translate(-sourceRect.left(), -sourceRect.top());-
1497-
1498-
1499 QStyleOptionGraphicsItem *styleOptionArray = d->allocStyleOptionsArray(numItems);-
1500 for (int i = 0; i < numItems
i < numItemsDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
1501 itemArray[i]->d_ptr->initStyleOption(&styleOptionArray[i], painterMatrix, targetRect.toRect());
never executed: itemArray[i]->d_ptr->initStyleOption(&styleOptionArray[i], painterMatrix, targetRect.toRect());
0
1502-
1503 painter->save();-
1504-
1505-
1506 painter->setClipRect(targetRect);-
1507 QPainterPath path;-
1508 path.addPolygon(sourceScenePoly);-
1509 path.closeSubpath();-
1510 painter->setClipPath(painterMatrix.map(path), Qt::IntersectClip);-
1511-
1512-
1513 painter->setTransform(painterMatrix, true);-
1514-
1515-
1516 QRectF sourceSceneRect = sourceScenePoly.boundingRect();-
1517 drawBackground(painter, sourceSceneRect);-
1518 drawItems(painter, numItems, itemArray, styleOptionArray);-
1519 drawForeground(painter, sourceSceneRect);-
1520-
1521 delete [] itemArray;-
1522 d->freeStyleOptionsArray(styleOptionArray);-
1523-
1524 painter->restore();-
1525}
never executed: end of block
0
1526QList<QGraphicsItem *> QGraphicsView::items() const-
1527{-
1528 const QGraphicsViewPrivate * const d = d_func();-
1529 if (!d->scene
!d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1530 return
never executed: return QList<QGraphicsItem *>();
QList<QGraphicsItem *>();
never executed: return QList<QGraphicsItem *>();
0
1531 return
never executed: return d->scene->items();
d->scene->items();
never executed: return d->scene->items();
0
1532}-
1533QList<QGraphicsItem *> QGraphicsView::items(const QPoint &pos) const-
1534{-
1535 const QGraphicsViewPrivate * const d = d_func();-
1536 if (!d->scene
!d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1537 return
never executed: return QList<QGraphicsItem *>();
QList<QGraphicsItem *>();
never executed: return QList<QGraphicsItem *>();
0
1538-
1539-
1540-
1541 if ((d->identityMatrix
d->identityMatrixDescription
TRUEnever evaluated
FALSEnever evaluated
|| d->matrix.type() <= QTransform::TxScale
d->matrix.type...sform::TxScaleDescription
TRUEnever evaluated
FALSEnever evaluated
)) {
0
1542-
1543 QTransform xinv = viewportTransform().inverted();-
1544 return
never executed: return d->scene->items(xinv.mapRect(QRectF(pos.x(), pos.y(), 1, 1)), Qt::IntersectsItemShape, Qt::DescendingOrder, viewportTransform());
d->scene->items(xinv.mapRect(QRectF(pos.x(), pos.y(), 1, 1)),
never executed: return d->scene->items(xinv.mapRect(QRectF(pos.x(), pos.y(), 1, 1)), Qt::IntersectsItemShape, Qt::DescendingOrder, viewportTransform());
0
1545 Qt::IntersectsItemShape,
never executed: return d->scene->items(xinv.mapRect(QRectF(pos.x(), pos.y(), 1, 1)), Qt::IntersectsItemShape, Qt::DescendingOrder, viewportTransform());
0
1546 Qt::DescendingOrder,
never executed: return d->scene->items(xinv.mapRect(QRectF(pos.x(), pos.y(), 1, 1)), Qt::IntersectsItemShape, Qt::DescendingOrder, viewportTransform());
0
1547 viewportTransform());
never executed: return d->scene->items(xinv.mapRect(QRectF(pos.x(), pos.y(), 1, 1)), Qt::IntersectsItemShape, Qt::DescendingOrder, viewportTransform());
0
1548 }-
1549-
1550 return
never executed: return d->scene->items(mapToScene(pos.x(), pos.y(), 1, 1), Qt::IntersectsItemShape, Qt::DescendingOrder, viewportTransform());
d->scene->items(mapToScene(pos.x(), pos.y(), 1, 1),
never executed: return d->scene->items(mapToScene(pos.x(), pos.y(), 1, 1), Qt::IntersectsItemShape, Qt::DescendingOrder, viewportTransform());
0
1551 Qt::IntersectsItemShape,
never executed: return d->scene->items(mapToScene(pos.x(), pos.y(), 1, 1), Qt::IntersectsItemShape, Qt::DescendingOrder, viewportTransform());
0
1552 Qt::DescendingOrder,
never executed: return d->scene->items(mapToScene(pos.x(), pos.y(), 1, 1), Qt::IntersectsItemShape, Qt::DescendingOrder, viewportTransform());
0
1553 viewportTransform());
never executed: return d->scene->items(mapToScene(pos.x(), pos.y(), 1, 1), Qt::IntersectsItemShape, Qt::DescendingOrder, viewportTransform());
0
1554}-
1555QList<QGraphicsItem *> QGraphicsView::items(const QRect &rect, Qt::ItemSelectionMode mode) const-
1556{-
1557 const QGraphicsViewPrivate * const d = d_func();-
1558 if (!d->scene
!d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1559 return
never executed: return QList<QGraphicsItem *>();
QList<QGraphicsItem *>();
never executed: return QList<QGraphicsItem *>();
0
1560 return
never executed: return d->scene->items(mapToScene(rect), mode, Qt::DescendingOrder, viewportTransform());
d->scene->items(mapToScene(rect), mode, Qt::DescendingOrder, viewportTransform());
never executed: return d->scene->items(mapToScene(rect), mode, Qt::DescendingOrder, viewportTransform());
0
1561}-
1562QList<QGraphicsItem *> QGraphicsView::items(const QPolygon &polygon, Qt::ItemSelectionMode mode) const-
1563{-
1564 const QGraphicsViewPrivate * const d = d_func();-
1565 if (!d->scene
!d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1566 return
never executed: return QList<QGraphicsItem *>();
QList<QGraphicsItem *>();
never executed: return QList<QGraphicsItem *>();
0
1567 return
never executed: return d->scene->items(mapToScene(polygon), mode, Qt::DescendingOrder, viewportTransform());
d->scene->items(mapToScene(polygon), mode, Qt::DescendingOrder, viewportTransform());
never executed: return d->scene->items(mapToScene(polygon), mode, Qt::DescendingOrder, viewportTransform());
0
1568}-
1569QList<QGraphicsItem *> QGraphicsView::items(const QPainterPath &path, Qt::ItemSelectionMode mode) const-
1570{-
1571 const QGraphicsViewPrivate * const d = d_func();-
1572 if (!d->scene
!d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1573 return
never executed: return QList<QGraphicsItem *>();
QList<QGraphicsItem *>();
never executed: return QList<QGraphicsItem *>();
0
1574 return
never executed: return d->scene->items(mapToScene(path), mode, Qt::DescendingOrder, viewportTransform());
d->scene->items(mapToScene(path), mode, Qt::DescendingOrder, viewportTransform());
never executed: return d->scene->items(mapToScene(path), mode, Qt::DescendingOrder, viewportTransform());
0
1575}-
1576QGraphicsItem *QGraphicsView::itemAt(const QPoint &pos) const-
1577{-
1578 const QGraphicsViewPrivate * const d = d_func();-
1579 if (!d->scene
!d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1580 return
never executed: return 0;
0;
never executed: return 0;
0
1581 const QList<QGraphicsItem *> itemsAtPos = items(pos);-
1582 return
never executed: return itemsAtPos.isEmpty() ? 0 : itemsAtPos.first();
itemsAtPos.isEmpty() ? 0 : itemsAtPos.first();
never executed: return itemsAtPos.isEmpty() ? 0 : itemsAtPos.first();
0
1583}-
1584QPointF QGraphicsView::mapToScene(const QPoint &point) const-
1585{-
1586 const QGraphicsViewPrivate * const d = d_func();-
1587 QPointF p = point;-
1588 p.rx() += d->horizontalScroll();-
1589 p.ry() += d->verticalScroll();-
1590 return
never executed: return d->identityMatrix ? p : d->matrix.inverted().map(p);
d->identityMatrix ? p : d->matrix.inverted().map(p);
never executed: return d->identityMatrix ? p : d->matrix.inverted().map(p);
0
1591}-
1592QPolygonF QGraphicsView::mapToScene(const QRect &rect) const-
1593{-
1594 const QGraphicsViewPrivate * const d = d_func();-
1595 if (!rect.isValid()
!rect.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1596 return
never executed: return QPolygonF();
QPolygonF();
never executed: return QPolygonF();
0
1597-
1598 QPointF scrollOffset(d->horizontalScroll(), d->verticalScroll());-
1599 QRect r = rect.adjusted(0, 0, 1, 1);-
1600 QPointF tl = scrollOffset + r.topLeft();-
1601 QPointF tr = scrollOffset + r.topRight();-
1602 QPointF br = scrollOffset + r.bottomRight();-
1603 QPointF bl = scrollOffset + r.bottomLeft();-
1604-
1605 QPolygonF poly(4);-
1606 if (!d->identityMatrix
!d->identityMatrixDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1607 QTransform x = d->matrix.inverted();-
1608 poly[0] = x.map(tl);-
1609 poly[1] = x.map(tr);-
1610 poly[2] = x.map(br);-
1611 poly[3] = x.map(bl);-
1612 }
never executed: end of block
else {
0
1613 poly[0] = tl;-
1614 poly[1] = tr;-
1615 poly[2] = br;-
1616 poly[3] = bl;-
1617 }
never executed: end of block
0
1618 return
never executed: return poly;
poly;
never executed: return poly;
0
1619}-
1620QPolygonF QGraphicsView::mapToScene(const QPolygon &polygon) const-
1621{-
1622 QPolygonF poly;-
1623 poly.reserve(polygon.count());-
1624 for (const QPoint &point : polygon)-
1625 poly << mapToScene(point);
never executed: poly << mapToScene(point);
0
1626 return
never executed: return poly;
poly;
never executed: return poly;
0
1627}-
1628-
1629-
1630-
1631-
1632-
1633-
1634-
1635QPainterPath QGraphicsView::mapToScene(const QPainterPath &path) const-
1636{-
1637 const QGraphicsViewPrivate * const d = d_func();-
1638 QTransform matrix = QTransform::fromTranslate(d->horizontalScroll(), d->verticalScroll());-
1639 matrix *= d->matrix.inverted();-
1640 return
never executed: return matrix.map(path);
matrix.map(path);
never executed: return matrix.map(path);
0
1641}-
1642-
1643-
1644-
1645-
1646-
1647-
1648QPoint QGraphicsView::mapFromScene(const QPointF &point) const-
1649{-
1650 const QGraphicsViewPrivate * const d = d_func();-
1651 QPointF p = d->identityMatrix
d->identityMatrixDescription
TRUEnever evaluated
FALSEnever evaluated
? point : d->matrix.map(point);
0
1652 p.rx() -= d->horizontalScroll();-
1653 p.ry() -= d->verticalScroll();-
1654 return
never executed: return p.toPoint();
p.toPoint();
never executed: return p.toPoint();
0
1655}-
1656QPolygon QGraphicsView::mapFromScene(const QRectF &rect) const-
1657{-
1658 const QGraphicsViewPrivate * const d = d_func();-
1659 QPointF tl;-
1660 QPointF tr;-
1661 QPointF br;-
1662 QPointF bl;-
1663 if (!d->identityMatrix
!d->identityMatrixDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1664 const QTransform &x = d->matrix;-
1665 tl = x.map(rect.topLeft());-
1666 tr = x.map(rect.topRight());-
1667 br = x.map(rect.bottomRight());-
1668 bl = x.map(rect.bottomLeft());-
1669 }
never executed: end of block
else {
0
1670 tl = rect.topLeft();-
1671 tr = rect.topRight();-
1672 br = rect.bottomRight();-
1673 bl = rect.bottomLeft();-
1674 }
never executed: end of block
0
1675 QPointF scrollOffset(d->horizontalScroll(), d->verticalScroll());-
1676 tl -= scrollOffset;-
1677 tr -= scrollOffset;-
1678 br -= scrollOffset;-
1679 bl -= scrollOffset;-
1680-
1681 QPolygon poly(4);-
1682 poly[0] = tl.toPoint();-
1683 poly[1] = tr.toPoint();-
1684 poly[2] = br.toPoint();-
1685 poly[3] = bl.toPoint();-
1686 return
never executed: return poly;
poly;
never executed: return poly;
0
1687}-
1688QPolygon QGraphicsView::mapFromScene(const QPolygonF &polygon) const-
1689{-
1690 QPolygon poly;-
1691 poly.reserve(polygon.count());-
1692 for (const QPointF &point : polygon)-
1693 poly << mapFromScene(point);
never executed: poly << mapFromScene(point);
0
1694 return
never executed: return poly;
poly;
never executed: return poly;
0
1695}-
1696-
1697-
1698-
1699-
1700-
1701-
1702-
1703QPainterPath QGraphicsView::mapFromScene(const QPainterPath &path) const-
1704{-
1705 const QGraphicsViewPrivate * const d = d_func();-
1706 QTransform matrix = d->matrix;-
1707 matrix *= QTransform::fromTranslate(-d->horizontalScroll(), -d->verticalScroll());-
1708 return
never executed: return matrix.map(path);
matrix.map(path);
never executed: return matrix.map(path);
0
1709}-
1710-
1711-
1712-
1713-
1714QVariant QGraphicsView::inputMethodQuery(Qt::InputMethodQuery query) const-
1715{-
1716 const QGraphicsViewPrivate * const d = d_func();-
1717 if (!d->scene
!d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1718 return
never executed: return QVariant();
QVariant();
never executed: return QVariant();
0
1719-
1720 QVariant value = d->scene->inputMethodQuery(query);-
1721 if (value.type() == QVariant::RectF
value.type() =...Variant::RectFDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1722 value = d->mapRectFromScene(value.toRectF());
never executed: value = d->mapRectFromScene(value.toRectF());
0
1723 else if (value.type() == QVariant::PointF
value.type() =...ariant::PointFDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1724 value = mapFromScene(value.toPointF());
never executed: value = mapFromScene(value.toPointF());
0
1725 else if (value.type() == QVariant::Rect
value.type() == QVariant::RectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1726 value = d->mapRectFromScene(value.toRect()).toRect();
never executed: value = d->mapRectFromScene(value.toRect()).toRect();
0
1727 else if (value.type() == QVariant::Point
value.type() =...Variant::PointDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1728 value = mapFromScene(value.toPoint());
never executed: value = mapFromScene(value.toPoint());
0
1729 return
never executed: return value;
value;
never executed: return value;
0
1730}-
1731QBrush QGraphicsView::backgroundBrush() const-
1732{-
1733 const QGraphicsViewPrivate * const d = d_func();-
1734 return
never executed: return d->backgroundBrush;
d->backgroundBrush;
never executed: return d->backgroundBrush;
0
1735}-
1736void QGraphicsView::setBackgroundBrush(const QBrush &brush)-
1737{-
1738 QGraphicsViewPrivate * const d = d_func();-
1739 d->backgroundBrush = brush;-
1740 d->updateAll();-
1741-
1742 if (d->cacheMode & CacheBackground
d->cacheMode & CacheBackgroundDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1743-
1744 d->mustResizeBackgroundPixmap = true;-
1745 }
never executed: end of block
0
1746}
never executed: end of block
0
1747QBrush QGraphicsView::foregroundBrush() const-
1748{-
1749 const QGraphicsViewPrivate * const d = d_func();-
1750 return
never executed: return d->foregroundBrush;
d->foregroundBrush;
never executed: return d->foregroundBrush;
0
1751}-
1752void QGraphicsView::setForegroundBrush(const QBrush &brush)-
1753{-
1754 QGraphicsViewPrivate * const d = d_func();-
1755 d->foregroundBrush = brush;-
1756 d->updateAll();-
1757}
never executed: end of block
0
1758-
1759-
1760-
1761-
1762-
1763-
1764void QGraphicsView::updateScene(const QList<QRectF> &rects)-
1765{-
1766-
1767-
1768-
1769-
1770-
1771 QGraphicsViewPrivate * const d = d_func();-
1772 if (d->fullUpdatePending
d->fullUpdatePendingDescription
TRUEnever evaluated
FALSEnever evaluated
|| d->viewportUpdateMode == QGraphicsView::NoViewportUpdate
d->viewportUpd...ViewportUpdateDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1773 return;
never executed: return;
0
1774-
1775-
1776 QVector<QRect> dirtyViewportRects;-
1777 const QVector<QRect> &dirtyRects = d->dirtyRegion.rects();-
1778 const int dirtyRectsCount = dirtyRects.size();-
1779 dirtyViewportRects.reserve(dirtyRectsCount + rects.count());-
1780 for (int i = 0; i < dirtyRectsCount
i < dirtyRectsCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
1781 dirtyViewportRects += dirtyRects.at(i);
never executed: dirtyViewportRects += dirtyRects.at(i);
0
1782 d->dirtyRegion = QRegion();-
1783 d->dirtyBoundingRect = QRect();-
1784-
1785 bool fullUpdate = !d->accelerateScrolling
!d->accelerateScrollingDescription
TRUEnever evaluated
FALSEnever evaluated
|| d->viewportUpdateMode == QGraphicsView::FullViewportUpdate
d->viewportUpd...ViewportUpdateDescription
TRUEnever evaluated
FALSEnever evaluated
;
0
1786 bool boundingRectUpdate = (
(d->viewportUp...iewportUpdate)Description
TRUEnever evaluated
FALSEnever evaluated
d->viewportUpdateMode == QGraphicsView::BoundingRectViewportUpdate)
(d->viewportUp...iewportUpdate)Description
TRUEnever evaluated
FALSEnever evaluated
0
1787 || (d->viewportUpdateMode == QGraphicsView::SmartViewportUpdate
d->viewportUpd...ViewportUpdateDescription
TRUEnever evaluated
FALSEnever evaluated
0
1788 && ((
((dirtyViewpor...ECT_THRESHOLD)Description
TRUEnever evaluated
FALSEnever evaluated
dirtyViewportRects.size() + rects.size()) >= QGRAPHICSVIEW_REGION_RECT_THRESHOLD)
((dirtyViewpor...ECT_THRESHOLD)Description
TRUEnever evaluated
FALSEnever evaluated
);
0
1789-
1790 QRegion updateRegion;-
1791 QRect boundingRect;-
1792 QRect viewportRect = viewport()->rect();-
1793 bool redraw = false;-
1794 QTransform transform = viewportTransform();-
1795-
1796-
1797 for (const QRectF &rect : rects) {-
1798 QRect xrect = transform.mapRect(rect).toAlignedRect();-
1799 if (!(d->optimizationFlags & DontAdjustForAntialiasing)
!(d->optimizat...rAntialiasing)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1800 xrect.adjust(-2, -2, 2, 2);
never executed: xrect.adjust(-2, -2, 2, 2);
0
1801 else-
1802 xrect.adjust(-1, -1, 1, 1);
never executed: xrect.adjust(-1, -1, 1, 1);
0
1803 if (!viewportRect.intersects(xrect)
!viewportRect....ersects(xrect)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1804 continue;
never executed: continue;
0
1805 dirtyViewportRects << xrect;-
1806 }
never executed: end of block
0
1807-
1808 for (QForeachContainer<typename QtPrivate::remove_reference<decltype(dirtyViewportRects)>::type> _container_((dirtyViewportRects)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (const QRect &rect = *_container_.i; _container_.control; _container_.control = 0) {-
1809-
1810-
1811 if (!boundingRectUpdate
!boundingRectUpdateDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1812 updateRegion += rect;-
1813 }
never executed: end of block
else {
0
1814 boundingRect |= rect;-
1815 }
never executed: end of block
0
1816 redraw = true;-
1817 if (fullUpdate
fullUpdateDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1818-
1819-
1820 break;
never executed: break;
0
1821 }-
1822 }
never executed: end of block
0
1823-
1824 if (!redraw
!redrawDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1825 return;
never executed: return;
0
1826-
1827 if (fullUpdate
fullUpdateDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1828 viewport()->update();
never executed: viewport()->update();
0
1829 else if (boundingRectUpdate
boundingRectUpdateDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1830 viewport()->update(boundingRect);
never executed: viewport()->update(boundingRect);
0
1831 else-
1832 viewport()->update(updateRegion);
never executed: viewport()->update(updateRegion);
0
1833}-
1834void QGraphicsView::updateSceneRect(const QRectF &rect)-
1835{-
1836 QGraphicsViewPrivate * const d = d_func();-
1837 if (!d->hasSceneRect
!d->hasSceneRectDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1838 d->sceneRect = rect;-
1839 d->recalculateContentSize();-
1840 }
never executed: end of block
0
1841}
never executed: end of block
0
1842void QGraphicsView::setupViewport(QWidget *widget)-
1843{-
1844 QGraphicsViewPrivate * const d = d_func();-
1845-
1846 if (!widget
!widgetDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1847 QMessageLogger(__FILE__, 2765, __PRETTY_FUNCTION__).warning("QGraphicsView::setupViewport: cannot initialize null widget");-
1848 return;
never executed: return;
0
1849 }-
1850-
1851 const bool isGLWidget = widget->inherits("QGLWidget")
widget->inherits("QGLWidget")Description
TRUEnever evaluated
FALSEnever evaluated
|| widget->inherits("QOpenGLWidget")
widget->inheri...OpenGLWidget")Description
TRUEnever evaluated
FALSEnever evaluated
;
0
1852-
1853 d->accelerateScrolling = !(isGLWidget);-
1854-
1855 widget->setFocusPolicy(Qt::StrongFocus);-
1856-
1857 if (!isGLWidget
!isGLWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1858-
1859 widget->setAutoFillBackground(true);-
1860 }
never executed: end of block
0
1861-
1862-
1863-
1864-
1865 if ((d->scene
d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
&& (!d->scene->d_func()->allItemsIgnoreHoverEvents
!d->scene->d_f...oreHoverEventsDescription
TRUEnever evaluated
FALSEnever evaluated
0
1866 || !d->scene->d_func()->allItemsUseDefaultCursor
!d->scene->d_f...eDefaultCursorDescription
TRUEnever evaluated
FALSEnever evaluated
))
0
1867 || d->transformationAnchor == AnchorUnderMouse
d->transformat...chorUnderMouseDescription
TRUEnever evaluated
FALSEnever evaluated
0
1868 || d->resizeAnchor == AnchorUnderMouse
d->resizeAncho...chorUnderMouseDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1869 widget->setMouseTracking(true);-
1870 }
never executed: end of block
0
1871-
1872-
1873 if (d->scene
d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
&& !d->scene->d_func()->allItemsIgnoreTouchEvents
!d->scene->d_f...oreTouchEventsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1874 widget->setAttribute(Qt::WA_AcceptTouchEvents);
never executed: widget->setAttribute(Qt::WA_AcceptTouchEvents);
0
1875-
1876-
1877 if (d->scene
d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1878 const auto gestures = d->scene->d_func()->grabbedGestures.keys();-
1879 for (Qt::GestureType gesture : gestures)-
1880 widget->grabGesture(gesture);
never executed: widget->grabGesture(gesture);
0
1881 }
never executed: end of block
0
1882-
1883-
1884 widget->setAcceptDrops(acceptDrops());-
1885}
never executed: end of block
0
1886-
1887-
1888-
1889-
1890bool QGraphicsView::event(QEvent *event)-
1891{-
1892 QGraphicsViewPrivate * const d = d_func();-
1893-
1894 if (d->sceneInteractionAllowed
d->sceneInteractionAllowedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1895 switch (event->type()) {-
1896 case
never executed: case QEvent::ShortcutOverride:
QEvent::ShortcutOverride:
never executed: case QEvent::ShortcutOverride:
0
1897 if (d->scene
d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1898 return
never executed: return QApplication::sendEvent(d->scene, event);
QApplication::sendEvent(d->scene, event);
never executed: return QApplication::sendEvent(d->scene, event);
0
1899 break;
never executed: break;
0
1900 case
never executed: case QEvent::KeyPress:
QEvent::KeyPress:
never executed: case QEvent::KeyPress:
0
1901 if (d->scene
d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1902 QKeyEvent *k = static_cast<QKeyEvent *>(event);-
1903 if (k->key() == Qt::Key_Tab
k->key() == Qt::Key_TabDescription
TRUEnever evaluated
FALSEnever evaluated
|| k->key() == Qt::Key_Backtab
k->key() == Qt::Key_BacktabDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1904-
1905-
1906-
1907-
1908-
1909-
1910 QApplication::sendEvent(d->scene, event);-
1911 if (event->isAccepted()
event->isAccepted()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1912 return
never executed: return true;
true;
never executed: return true;
0
1913-
1914-
1915-
1916 event->accept();-
1917 }
never executed: end of block
0
1918 }
never executed: end of block
0
1919 break;
never executed: break;
0
1920 default
never executed: default:
:
never executed: default:
0
1921 break;
never executed: break;
0
1922 }-
1923 }-
1924-
1925 return
never executed: return QAbstractScrollArea::event(event);
QAbstractScrollArea::event(event);
never executed: return QAbstractScrollArea::event(event);
0
1926}-
1927-
1928-
1929-
1930-
1931bool QGraphicsView::viewportEvent(QEvent *event)-
1932{-
1933 QGraphicsViewPrivate * const d = d_func();-
1934 if (!d->scene
!d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1935 return
never executed: return QAbstractScrollArea::viewportEvent(event);
QAbstractScrollArea::viewportEvent(event);
never executed: return QAbstractScrollArea::viewportEvent(event);
0
1936-
1937 switch (event->type()) {-
1938 case
never executed: case QEvent::Enter:
QEvent::Enter:
never executed: case QEvent::Enter:
0
1939 QApplication::sendEvent(d->scene, event);-
1940 break;
never executed: break;
0
1941 case
never executed: case QEvent::WindowActivate:
QEvent::WindowActivate:
never executed: case QEvent::WindowActivate:
0
1942 QApplication::sendEvent(d->scene, event);-
1943 break;
never executed: break;
0
1944 case
never executed: case QEvent::WindowDeactivate:
QEvent::WindowDeactivate:
never executed: case QEvent::WindowDeactivate:
0
1945-
1946-
1947-
1948-
1949 if (!d->scene->d_func()->popupWidgets.isEmpty()
!d->scene->d_f...gets.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1950 d->scene->d_func()->removePopup(d->scene->d_func()->popupWidgets.constFirst());
never executed: d->scene->d_func()->removePopup(d->scene->d_func()->popupWidgets.constFirst());
0
1951 QApplication::sendEvent(d->scene, event);-
1952 break;
never executed: break;
0
1953 case
never executed: case QEvent::Show:
QEvent::Show:
never executed: case QEvent::Show:
0
1954 if (d->scene
d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
&& isActiveWindow()
isActiveWindow()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1955 QEvent windowActivate(QEvent::WindowActivate);-
1956 QApplication::sendEvent(d->scene, &windowActivate);-
1957 }
never executed: end of block
0
1958 break;
never executed: break;
0
1959 case
never executed: case QEvent::Hide:
QEvent::Hide:
never executed: case QEvent::Hide:
0
1960-
1961 if (!event->spontaneous()
!event->spontaneous()Description
TRUEnever evaluated
FALSEnever evaluated
&& d->scene
d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
&& isActiveWindow()
isActiveWindow()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1962 QEvent windowDeactivate(QEvent::WindowDeactivate);-
1963 QApplication::sendEvent(d->scene, &windowDeactivate);-
1964 }
never executed: end of block
0
1965 break;
never executed: break;
0
1966 case
never executed: case QEvent::Leave:
QEvent::Leave:
never executed: case QEvent::Leave:
{
0
1967-
1968-
1969-
1970 if ((QApplication::activePopupWidget()
QApplication::...ePopupWidget()Description
TRUEnever evaluated
FALSEnever evaluated
&& QApplication::activePopupWidget() != window()
QApplication::...() != window()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1971 || (QApplication::activeModalWidget()
QApplication::...eModalWidget()Description
TRUEnever evaluated
FALSEnever evaluated
&& QApplication::activeModalWidget() != window()
QApplication::...() != window()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1972 || (
(QApplication:...) != window())Description
TRUEnever evaluated
FALSEnever evaluated
QApplication::activeWindow() != window())
(QApplication:...) != window())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1973 if (!d->scene->d_func()->popupWidgets.isEmpty()
!d->scene->d_f...gets.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1974 d->scene->d_func()->removePopup(d->scene->d_func()->popupWidgets.constFirst());
never executed: d->scene->d_func()->removePopup(d->scene->d_func()->popupWidgets.constFirst());
0
1975 }
never executed: end of block
0
1976 d->useLastMouseEvent = false;-
1977-
1978 ((!(event->d == 0)) ? qt_assert("event->d == 0",__FILE__,2896) : qt_noop());-
1979 QScopedValueRollback<QEventPrivate *> rb(event->d);-
1980 event->d = reinterpret_cast<QEventPrivate *>(viewport());-
1981 QApplication::sendEvent(d->scene, event);-
1982 break;
never executed: break;
0
1983 }-
1984-
1985 case
never executed: case QEvent::ToolTip:
QEvent::ToolTip:
never executed: case QEvent::ToolTip:
{
0
1986 QHelpEvent *toolTip = static_cast<QHelpEvent *>(event);-
1987 QGraphicsSceneHelpEvent helpEvent(QEvent::GraphicsSceneHelp);-
1988 helpEvent.setWidget(viewport());-
1989 helpEvent.setScreenPos(toolTip->globalPos());-
1990 helpEvent.setScenePos(mapToScene(toolTip->pos()));-
1991 QApplication::sendEvent(d->scene, &helpEvent);-
1992 toolTip->setAccepted(helpEvent.isAccepted());-
1993 return
never executed: return true;
true;
never executed: return true;
0
1994 }-
1995-
1996 case
never executed: case QEvent::Paint:
QEvent::Paint:
never executed: case QEvent::Paint:
0
1997-
1998 d->fullUpdatePending = false;-
1999 d->dirtyScrollOffset = QPoint();-
2000 if (d->scene
d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2001-
2002-
2003-
2004 if (!d->updateSceneSlotReimplementedChecked
!d->updateScen...ementedCheckedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2005 d->updateSceneSlotReimplementedChecked = true;-
2006 const QMetaObject *mo = metaObject();-
2007 if (mo != &QGraphicsView::staticMetaObject
mo != &QGraphi...aticMetaObjectDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2008 if (mo->indexOfSlot("updateScene(QList<QRectF>)")
mo->indexOfSlo...ist<QRectF>)")Description
TRUEnever evaluated
FALSEnever evaluated
0
2009 != QGraphicsView::staticMetaObject.indexOfSlot("updateScene(QList<QRectF>)")
mo->indexOfSlo...ist<QRectF>)")Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2010 connect(d->scene, qFlagLocation("2""changed(QList<QRectF>)" "\0" __FILE__ ":" "2928"),-
2011 this, qFlagLocation("1""updateScene(QList<QRectF>)" "\0" __FILE__ ":" "2929"));-
2012 }
never executed: end of block
0
2013 }
never executed: end of block
0
2014 }
never executed: end of block
0
2015 }
never executed: end of block
0
2016 break;
never executed: break;
0
2017 case
never executed: case QEvent::TouchBegin:
QEvent::TouchBegin:
never executed: case QEvent::TouchBegin:
0
2018 case
never executed: case QEvent::TouchUpdate:
QEvent::TouchUpdate:
never executed: case QEvent::TouchUpdate:
0
2019 case
never executed: case QEvent::TouchEnd:
QEvent::TouchEnd:
never executed: case QEvent::TouchEnd:
0
2020 {-
2021 if (!isEnabled()
!isEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2022 return
never executed: return false;
false;
never executed: return false;
0
2023-
2024 if (d->scene
d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->sceneInteractionAllowed
d->sceneInteractionAllowedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2025-
2026 QTouchEvent *touchEvent = static_cast<QTouchEvent *>(event);-
2027 touchEvent->setTarget(viewport());-
2028 QGraphicsViewPrivate::translateTouchEvent(d, touchEvent);-
2029 (void) QApplication::sendEvent(d->scene, touchEvent);-
2030 }
never executed: end of block
else {
0
2031 event->ignore();-
2032 }
never executed: end of block
0
2033-
2034 return
never executed: return true;
true;
never executed: return true;
0
2035 }-
2036-
2037 case
never executed: case QEvent::Gesture:
QEvent::Gesture:
never executed: case QEvent::Gesture:
0
2038 case
never executed: case QEvent::GestureOverride:
QEvent::GestureOverride:
never executed: case QEvent::GestureOverride:
0
2039 {-
2040 if (!isEnabled()
!isEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2041 return
never executed: return false;
false;
never executed: return false;
0
2042-
2043 if (d->scene
d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->sceneInteractionAllowed
d->sceneInteractionAllowedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2044 QGestureEvent *gestureEvent = static_cast<QGestureEvent *>(event);-
2045 gestureEvent->setWidget(viewport());-
2046 (void) QApplication::sendEvent(d->scene, gestureEvent);-
2047 }
never executed: end of block
0
2048 return
never executed: return true;
true;
never executed: return true;
0
2049 }-
2050-
2051 default
never executed: default:
:
never executed: default:
0
2052 break;
never executed: break;
0
2053 }-
2054-
2055 return
never executed: return QAbstractScrollArea::viewportEvent(event);
QAbstractScrollArea::viewportEvent(event);
never executed: return QAbstractScrollArea::viewportEvent(event);
0
2056}-
2057-
2058-
2059-
2060-
2061-
2062void QGraphicsView::contextMenuEvent(QContextMenuEvent *event)-
2063{-
2064 QGraphicsViewPrivate * const d = d_func();-
2065 if (!d->scene
!d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
|| !d->sceneInteractionAllowed
!d->sceneInteractionAllowedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2066 return;
never executed: return;
0
2067-
2068 d->mousePressViewPoint = event->pos();-
2069 d->mousePressScenePoint = mapToScene(d->mousePressViewPoint);-
2070 d->mousePressScreenPoint = event->globalPos();-
2071 d->lastMouseMoveScenePoint = d->mousePressScenePoint;-
2072 d->lastMouseMoveScreenPoint = d->mousePressScreenPoint;-
2073-
2074 QGraphicsSceneContextMenuEvent contextEvent(QEvent::GraphicsSceneContextMenu);-
2075 contextEvent.setWidget(viewport());-
2076 contextEvent.setScenePos(d->mousePressScenePoint);-
2077 contextEvent.setScreenPos(d->mousePressScreenPoint);-
2078 contextEvent.setModifiers(event->modifiers());-
2079 contextEvent.setReason((QGraphicsSceneContextMenuEvent::Reason)(event->reason()));-
2080 contextEvent.setAccepted(event->isAccepted());-
2081 QApplication::sendEvent(d->scene, &contextEvent);-
2082 event->setAccepted(contextEvent.isAccepted());-
2083}
never executed: end of block
0
2084-
2085-
2086-
2087-
2088-
2089void QGraphicsView::dropEvent(QDropEvent *event)-
2090{-
2091-
2092 QGraphicsViewPrivate * const d = d_func();-
2093 if (!d->scene
!d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
|| !d->sceneInteractionAllowed
!d->sceneInteractionAllowedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2094 return;
never executed: return;
0
2095-
2096-
2097 QGraphicsSceneDragDropEvent sceneEvent(QEvent::GraphicsSceneDrop);-
2098 d->populateSceneDragDropEvent(&sceneEvent, event);-
2099-
2100-
2101 QApplication::sendEvent(d->scene, &sceneEvent);-
2102-
2103-
2104 event->setAccepted(sceneEvent.isAccepted());-
2105 if (sceneEvent.isAccepted()
sceneEvent.isAccepted()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2106 event->setDropAction(sceneEvent.dropAction());
never executed: event->setDropAction(sceneEvent.dropAction());
0
2107-
2108 delete d->lastDragDropEvent;-
2109 d->lastDragDropEvent = 0;-
2110-
2111-
2112-
2113-
2114}
never executed: end of block
0
2115-
2116-
2117-
2118-
2119void QGraphicsView::dragEnterEvent(QDragEnterEvent *event)-
2120{-
2121-
2122 QGraphicsViewPrivate * const d = d_func();-
2123 if (!d->scene
!d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
|| !d->sceneInteractionAllowed
!d->sceneInteractionAllowedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2124 return;
never executed: return;
0
2125-
2126-
2127 d->useLastMouseEvent = false;-
2128-
2129-
2130 QGraphicsSceneDragDropEvent sceneEvent(QEvent::GraphicsSceneDragEnter);-
2131 d->populateSceneDragDropEvent(&sceneEvent, event);-
2132-
2133-
2134 d->storeDragDropEvent(&sceneEvent);-
2135-
2136-
2137 QApplication::sendEvent(d->scene, &sceneEvent);-
2138-
2139-
2140 if (sceneEvent.isAccepted()
sceneEvent.isAccepted()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2141 event->setAccepted(true);-
2142 event->setDropAction(sceneEvent.dropAction());-
2143 }
never executed: end of block
0
2144-
2145-
2146-
2147}
never executed: end of block
0
2148-
2149-
2150-
2151-
2152void QGraphicsView::dragLeaveEvent(QDragLeaveEvent *event)-
2153{-
2154-
2155 QGraphicsViewPrivate * const d = d_func();-
2156 if (!d->scene
!d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
|| !d->sceneInteractionAllowed
!d->sceneInteractionAllowedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2157 return;
never executed: return;
0
2158 if (!d->lastDragDropEvent
!d->lastDragDropEventDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2159 QMessageLogger(__FILE__, 3077, __PRETTY_FUNCTION__).warning("QGraphicsView::dragLeaveEvent: drag leave received before drag enter");-
2160 return;
never executed: return;
0
2161 }-
2162-
2163-
2164 QGraphicsSceneDragDropEvent sceneEvent(QEvent::GraphicsSceneDragLeave);-
2165 sceneEvent.setScenePos(d->lastDragDropEvent->scenePos());-
2166 sceneEvent.setScreenPos(d->lastDragDropEvent->screenPos());-
2167 sceneEvent.setButtons(d->lastDragDropEvent->buttons());-
2168 sceneEvent.setModifiers(d->lastDragDropEvent->modifiers());-
2169 sceneEvent.setPossibleActions(d->lastDragDropEvent->possibleActions());-
2170 sceneEvent.setProposedAction(d->lastDragDropEvent->proposedAction());-
2171 sceneEvent.setDropAction(d->lastDragDropEvent->dropAction());-
2172 sceneEvent.setMimeData(d->lastDragDropEvent->mimeData());-
2173 sceneEvent.setWidget(d->lastDragDropEvent->widget());-
2174 sceneEvent.setSource(d->lastDragDropEvent->source());-
2175 delete d->lastDragDropEvent;-
2176 d->lastDragDropEvent = 0;-
2177-
2178-
2179 QApplication::sendEvent(d->scene, &sceneEvent);-
2180-
2181-
2182 if (sceneEvent.isAccepted()
sceneEvent.isAccepted()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2183 event->setAccepted(true);
never executed: event->setAccepted(true);
0
2184-
2185-
2186-
2187}
never executed: end of block
0
2188-
2189-
2190-
2191-
2192void QGraphicsView::dragMoveEvent(QDragMoveEvent *event)-
2193{-
2194-
2195 QGraphicsViewPrivate * const d = d_func();-
2196 if (!d->scene
!d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
|| !d->sceneInteractionAllowed
!d->sceneInteractionAllowedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2197 return;
never executed: return;
0
2198-
2199-
2200 QGraphicsSceneDragDropEvent sceneEvent(QEvent::GraphicsSceneDragMove);-
2201 d->populateSceneDragDropEvent(&sceneEvent, event);-
2202-
2203-
2204 d->storeDragDropEvent(&sceneEvent);-
2205-
2206-
2207 QApplication::sendEvent(d->scene, &sceneEvent);-
2208-
2209-
2210 event->setAccepted(sceneEvent.isAccepted());-
2211 if (sceneEvent.isAccepted()
sceneEvent.isAccepted()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2212 event->setDropAction(sceneEvent.dropAction());
never executed: event->setDropAction(sceneEvent.dropAction());
0
2213-
2214-
2215-
2216}
never executed: end of block
0
2217-
2218-
2219-
2220-
2221void QGraphicsView::focusInEvent(QFocusEvent *event)-
2222{-
2223 QGraphicsViewPrivate * const d = d_func();-
2224 d->updateInputMethodSensitivity();-
2225 QAbstractScrollArea::focusInEvent(event);-
2226 if (d->scene
d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2227 QApplication::sendEvent(d->scene, event);
never executed: QApplication::sendEvent(d->scene, event);
0
2228-
2229 if (!d->scene
!d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
|| !event->isAccepted()
!event->isAccepted()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2230 QAbstractScrollArea::focusInEvent(event);
never executed: QAbstractScrollArea::focusInEvent(event);
0
2231}
never executed: end of block
0
2232-
2233-
2234-
2235-
2236bool QGraphicsView::focusNextPrevChild(bool next)-
2237{-
2238 return
never executed: return QAbstractScrollArea::focusNextPrevChild(next);
QAbstractScrollArea::focusNextPrevChild(next);
never executed: return QAbstractScrollArea::focusNextPrevChild(next);
0
2239}-
2240-
2241-
2242-
2243-
2244void QGraphicsView::focusOutEvent(QFocusEvent *event)-
2245{-
2246 QGraphicsViewPrivate * const d = d_func();-
2247 QAbstractScrollArea::focusOutEvent(event);-
2248 if (d->scene
d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2249 QApplication::sendEvent(d->scene, event);
never executed: QApplication::sendEvent(d->scene, event);
0
2250}
never executed: end of block
0
2251-
2252-
2253-
2254-
2255void QGraphicsView::keyPressEvent(QKeyEvent *event)-
2256{-
2257 QGraphicsViewPrivate * const d = d_func();-
2258 if (!d->scene
!d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
|| !d->sceneInteractionAllowed
!d->sceneInteractionAllowedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2259 QAbstractScrollArea::keyPressEvent(event);-
2260 return;
never executed: return;
0
2261 }-
2262 QApplication::sendEvent(d->scene, event);-
2263 if (!event->isAccepted()
!event->isAccepted()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2264 QAbstractScrollArea::keyPressEvent(event);
never executed: QAbstractScrollArea::keyPressEvent(event);
0
2265}
never executed: end of block
0
2266-
2267-
2268-
2269-
2270void QGraphicsView::keyReleaseEvent(QKeyEvent *event)-
2271{-
2272 QGraphicsViewPrivate * const d = d_func();-
2273 if (!d->scene
!d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
|| !d->sceneInteractionAllowed
!d->sceneInteractionAllowedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2274 return;
never executed: return;
0
2275 QApplication::sendEvent(d->scene, event);-
2276 if (!event->isAccepted()
!event->isAccepted()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2277 QAbstractScrollArea::keyReleaseEvent(event);
never executed: QAbstractScrollArea::keyReleaseEvent(event);
0
2278}
never executed: end of block
0
2279-
2280-
2281-
2282-
2283void QGraphicsView::mouseDoubleClickEvent(QMouseEvent *event)-
2284{-
2285 QGraphicsViewPrivate * const d = d_func();-
2286 if (!d->scene
!d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
|| !d->sceneInteractionAllowed
!d->sceneInteractionAllowedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2287 return;
never executed: return;
0
2288-
2289 d->storeMouseEvent(event);-
2290 d->mousePressViewPoint = event->pos();-
2291 d->mousePressScenePoint = mapToScene(d->mousePressViewPoint);-
2292 d->mousePressScreenPoint = event->globalPos();-
2293 d->lastMouseMoveScenePoint = d->mousePressScenePoint;-
2294 d->lastMouseMoveScreenPoint = d->mousePressScreenPoint;-
2295 d->mousePressButton = event->button();-
2296-
2297 QGraphicsSceneMouseEvent mouseEvent(QEvent::GraphicsSceneMouseDoubleClick);-
2298 mouseEvent.setWidget(viewport());-
2299 mouseEvent.setButtonDownScenePos(d->mousePressButton, d->mousePressScenePoint);-
2300 mouseEvent.setButtonDownScreenPos(d->mousePressButton, d->mousePressScreenPoint);-
2301 mouseEvent.setScenePos(mapToScene(d->mousePressViewPoint));-
2302 mouseEvent.setScreenPos(d->mousePressScreenPoint);-
2303 mouseEvent.setLastScenePos(d->lastMouseMoveScenePoint);-
2304 mouseEvent.setLastScreenPos(d->lastMouseMoveScreenPoint);-
2305 mouseEvent.setButtons(event->buttons());-
2306 mouseEvent.setAccepted(false);-
2307 mouseEvent.setButton(event->button());-
2308 mouseEvent.setModifiers(event->modifiers());-
2309 mouseEvent.setSource(event->source());-
2310 mouseEvent.setFlags(event->flags());-
2311 if (event->spontaneous()
event->spontaneous()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2312 qt_sendSpontaneousEvent(d->scene, &mouseEvent);
never executed: qt_sendSpontaneousEvent(d->scene, &mouseEvent);
0
2313 else-
2314 QApplication::sendEvent(d->scene, &mouseEvent);
never executed: QApplication::sendEvent(d->scene, &mouseEvent);
0
2315-
2316-
2317 const bool isAccepted = mouseEvent.isAccepted();-
2318 event->setAccepted(isAccepted);-
2319-
2320-
2321 d->lastMouseEvent.setAccepted(isAccepted);-
2322}
never executed: end of block
0
2323-
2324-
2325-
2326-
2327void QGraphicsView::mousePressEvent(QMouseEvent *event)-
2328{-
2329 QGraphicsViewPrivate * const d = d_func();-
2330-
2331-
2332-
2333-
2334 d->storeMouseEvent(event);-
2335 d->lastMouseEvent.setAccepted(false);-
2336-
2337 if (d->sceneInteractionAllowed
d->sceneInteractionAllowedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2338-
2339 d->mousePressViewPoint = event->pos();-
2340 d->mousePressScenePoint = mapToScene(d->mousePressViewPoint);-
2341 d->mousePressScreenPoint = event->globalPos();-
2342 d->lastMouseMoveScenePoint = d->mousePressScenePoint;-
2343 d->lastMouseMoveScreenPoint = d->mousePressScreenPoint;-
2344 d->mousePressButton = event->button();-
2345-
2346 if (d->scene
d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2347-
2348 QGraphicsSceneMouseEvent mouseEvent(QEvent::GraphicsSceneMousePress);-
2349 mouseEvent.setWidget(viewport());-
2350 mouseEvent.setButtonDownScenePos(d->mousePressButton, d->mousePressScenePoint);-
2351 mouseEvent.setButtonDownScreenPos(d->mousePressButton, d->mousePressScreenPoint);-
2352 mouseEvent.setScenePos(d->mousePressScenePoint);-
2353 mouseEvent.setScreenPos(d->mousePressScreenPoint);-
2354 mouseEvent.setLastScenePos(d->lastMouseMoveScenePoint);-
2355 mouseEvent.setLastScreenPos(d->lastMouseMoveScreenPoint);-
2356 mouseEvent.setButtons(event->buttons());-
2357 mouseEvent.setButton(event->button());-
2358 mouseEvent.setModifiers(event->modifiers());-
2359 mouseEvent.setSource(event->source());-
2360 mouseEvent.setFlags(event->flags());-
2361 mouseEvent.setAccepted(false);-
2362 if (event->spontaneous()
event->spontaneous()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2363 qt_sendSpontaneousEvent(d->scene, &mouseEvent);
never executed: qt_sendSpontaneousEvent(d->scene, &mouseEvent);
0
2364 else-
2365 QApplication::sendEvent(d->scene, &mouseEvent);
never executed: QApplication::sendEvent(d->scene, &mouseEvent);
0
2366-
2367-
2368 bool isAccepted = mouseEvent.isAccepted();-
2369 event->setAccepted(isAccepted);-
2370-
2371-
2372 d->lastMouseEvent.setAccepted(isAccepted);-
2373-
2374 if (isAccepted
isAcceptedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2375 return;
never executed: return;
0
2376 }
never executed: end of block
0
2377 }
never executed: end of block
0
2378-
2379-
2380 if (d->dragMode == QGraphicsView::RubberBandDrag
d->dragMode ==...RubberBandDragDescription
TRUEnever evaluated
FALSEnever evaluated
&& !d->rubberBanding
!d->rubberBandingDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2381 if (d->sceneInteractionAllowed
d->sceneInteractionAllowedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2382-
2383 event->accept();-
2384 d->rubberBanding = true;-
2385 d->rubberBandRect = QRect();-
2386 if (d->scene
d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2387 bool extendSelection = (event->modifiers() & Qt::ControlModifier) != 0;-
2388-
2389 if (extendSelection
extendSelectionDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2390 d->rubberBandSelectionOperation = Qt::AddToSelection;-
2391 }
never executed: end of block
else {
0
2392 d->rubberBandSelectionOperation = Qt::ReplaceSelection;-
2393 d->scene->clearSelection();-
2394 }
never executed: end of block
0
2395 }-
2396 }
never executed: end of block
0
2397 }
never executed: end of block
else
0
2398-
2399 if (d->dragMode == QGraphicsView::ScrollHandDrag
d->dragMode ==...ScrollHandDragDescription
TRUEnever evaluated
FALSEnever evaluated
&& event->button() == Qt::LeftButton
event->button(...Qt::LeftButtonDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2400-
2401 event->accept();-
2402 d->handScrolling = true;-
2403 d->handScrollMotions = 0;-
2404-
2405 viewport()->setCursor(Qt::ClosedHandCursor);-
2406-
2407 }
never executed: end of block
0
2408}
never executed: end of block
0
2409-
2410-
2411-
2412-
2413void QGraphicsView::mouseMoveEvent(QMouseEvent *event)-
2414{-
2415 QGraphicsViewPrivate * const d = d_func();-
2416-
2417 if (d->dragMode == QGraphicsView::ScrollHandDrag
d->dragMode ==...ScrollHandDragDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2418 if (d->handScrolling
d->handScrollingDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2419 QScrollBar *hBar = horizontalScrollBar();-
2420 QScrollBar *vBar = verticalScrollBar();-
2421 QPoint delta = event->pos() - d->lastMouseEvent.pos();-
2422 hBar->setValue(hBar->value() + (isRightToLeft() ? delta.x() : -delta.x()));-
2423 vBar->setValue(vBar->value() - delta.y());-
2424-
2425-
2426-
2427 ++d->handScrollMotions;-
2428 }
never executed: end of block
0
2429 }
never executed: end of block
0
2430-
2431 d->mouseMoveEventHandler(event);-
2432}
never executed: end of block
0
2433-
2434-
2435-
2436-
2437void QGraphicsView::mouseReleaseEvent(QMouseEvent *event)-
2438{-
2439 QGraphicsViewPrivate * const d = d_func();-
2440-
2441-
2442 if (d->dragMode == QGraphicsView::RubberBandDrag
d->dragMode ==...RubberBandDragDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->sceneInteractionAllowed
d->sceneInteractionAllowedDescription
TRUEnever evaluated
FALSEnever evaluated
&& !event->buttons()
!event->buttons()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2443 if (d->rubberBanding
d->rubberBandingDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2444 if (d->viewportUpdateMode != QGraphicsView::NoViewportUpdate
d->viewportUpd...ViewportUpdateDescription
TRUEnever evaluated
FALSEnever evaluated
){
0
2445 if (d->viewportUpdateMode != FullViewportUpdate
d->viewportUpd...ViewportUpdateDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2446 viewport()->update(d->rubberBandRegion(viewport(), d->rubberBandRect));
never executed: viewport()->update(d->rubberBandRegion(viewport(), d->rubberBandRect));
0
2447 else-
2448 d->updateAll();
never executed: d->updateAll();
0
2449 }-
2450 d->rubberBanding = false;-
2451 d->rubberBandSelectionOperation = Qt::ReplaceSelection;-
2452 if (!d->rubberBandRect.isNull()
!d->rubberBandRect.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2453 d->rubberBandRect = QRect();-
2454 rubberBandChanged(d->rubberBandRect, QPointF(), QPointF());-
2455 }
never executed: end of block
0
2456 }
never executed: end of block
0
2457 }
never executed: end of block
else
0
2458-
2459 if (d->dragMode == QGraphicsView::ScrollHandDrag
d->dragMode ==...ScrollHandDragDescription
TRUEnever evaluated
FALSEnever evaluated
&& event->button() == Qt::LeftButton
event->button(...Qt::LeftButtonDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2460-
2461-
2462-
2463-
2464 viewport()->setCursor(Qt::OpenHandCursor);-
2465-
2466 d->handScrolling = false;-
2467-
2468 if (d->scene
d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->sceneInteractionAllowed
d->sceneInteractionAllowedDescription
TRUEnever evaluated
FALSEnever evaluated
&& !d->lastMouseEvent.isAccepted()
!d->lastMouseE...t.isAccepted()Description
TRUEnever evaluated
FALSEnever evaluated
&& d->handScrollMotions <= 6
d->handScrollMotions <= 6Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2469-
2470-
2471-
2472 d->scene->clearSelection();-
2473 }
never executed: end of block
0
2474 }
never executed: end of block
0
2475-
2476 d->storeMouseEvent(event);-
2477-
2478 if (!d->sceneInteractionAllowed
!d->sceneInteractionAllowedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2479 return;
never executed: return;
0
2480-
2481 if (!d->scene
!d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2482 return;
never executed: return;
0
2483-
2484 QGraphicsSceneMouseEvent mouseEvent(QEvent::GraphicsSceneMouseRelease);-
2485 mouseEvent.setWidget(viewport());-
2486 mouseEvent.setButtonDownScenePos(d->mousePressButton, d->mousePressScenePoint);-
2487 mouseEvent.setButtonDownScreenPos(d->mousePressButton, d->mousePressScreenPoint);-
2488 mouseEvent.setScenePos(mapToScene(event->pos()));-
2489 mouseEvent.setScreenPos(event->globalPos());-
2490 mouseEvent.setLastScenePos(d->lastMouseMoveScenePoint);-
2491 mouseEvent.setLastScreenPos(d->lastMouseMoveScreenPoint);-
2492 mouseEvent.setButtons(event->buttons());-
2493 mouseEvent.setButton(event->button());-
2494 mouseEvent.setModifiers(event->modifiers());-
2495 mouseEvent.setSource(event->source());-
2496 mouseEvent.setFlags(event->flags());-
2497 mouseEvent.setAccepted(false);-
2498 if (event->spontaneous()
event->spontaneous()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2499 qt_sendSpontaneousEvent(d->scene, &mouseEvent);
never executed: qt_sendSpontaneousEvent(d->scene, &mouseEvent);
0
2500 else-
2501 QApplication::sendEvent(d->scene, &mouseEvent);
never executed: QApplication::sendEvent(d->scene, &mouseEvent);
0
2502-
2503-
2504 d->lastMouseEvent.setAccepted(mouseEvent.isAccepted());-
2505-
2506-
2507 if (mouseEvent.isAccepted()
mouseEvent.isAccepted()Description
TRUEnever evaluated
FALSEnever evaluated
&& mouseEvent.buttons() == 0
mouseEvent.buttons() == 0Description
TRUEnever evaluated
FALSEnever evaluated
&& viewport()->testAttribute(Qt::WA_SetCursor)
viewport()->te...:WA_SetCursor)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2508-
2509 d->_q_unsetViewportCursor();-
2510 }
never executed: end of block
0
2511-
2512}
never executed: end of block
0
2513-
2514-
2515-
2516-
2517-
2518void QGraphicsView::wheelEvent(QWheelEvent *event)-
2519{-
2520 QGraphicsViewPrivate * const d = d_func();-
2521 if (!d->scene
!d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
|| !d->sceneInteractionAllowed
!d->sceneInteractionAllowedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2522 QAbstractScrollArea::wheelEvent(event);-
2523 return;
never executed: return;
0
2524 }-
2525-
2526 event->ignore();-
2527-
2528 QGraphicsSceneWheelEvent wheelEvent(QEvent::GraphicsSceneWheel);-
2529 wheelEvent.setWidget(viewport());-
2530 wheelEvent.setScenePos(mapToScene(event->pos()));-
2531 wheelEvent.setScreenPos(event->globalPos());-
2532 wheelEvent.setButtons(event->buttons());-
2533 wheelEvent.setModifiers(event->modifiers());-
2534 wheelEvent.setDelta(event->delta());-
2535 wheelEvent.setOrientation(event->orientation());-
2536 wheelEvent.setAccepted(false);-
2537 QApplication::sendEvent(d->scene, &wheelEvent);-
2538 event->setAccepted(wheelEvent.isAccepted());-
2539 if (!event->isAccepted()
!event->isAccepted()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2540 QAbstractScrollArea::wheelEvent(event);
never executed: QAbstractScrollArea::wheelEvent(event);
0
2541}
never executed: end of block
0
2542-
2543-
2544-
2545-
2546-
2547void QGraphicsView::paintEvent(QPaintEvent *event)-
2548{-
2549 QGraphicsViewPrivate * const d = d_func();-
2550 if (!d->scene
!d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2551 QAbstractScrollArea::paintEvent(event);-
2552 return;
never executed: return;
0
2553 }-
2554-
2555-
2556 d->scene->d_func()->painterStateProtection = !(d->optimizationFlags & DontSavePainterState);-
2557-
2558-
2559 d->exposedRegion = event->region();-
2560 QRectF exposedSceneRect = mapToScene(d->exposedRegion.boundingRect()).boundingRect();-
2561-
2562-
2563 QPainter painter(viewport());-
2564-
2565 if (d->rubberBanding
d->rubberBandingDescription
TRUEnever evaluated
FALSEnever evaluated
&& !d->rubberBandRect.isEmpty()
!d->rubberBandRect.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2566 painter.save();
never executed: painter.save();
0
2567-
2568-
2569 painter.setRenderHints(painter.renderHints(), false);-
2570 painter.setRenderHints(d->renderHints, true);-
2571-
2572-
2573 const bool viewTransformed = isTransformed();-
2574 if (viewTransformed
viewTransformedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2575 painter.setWorldTransform(viewportTransform());
never executed: painter.setWorldTransform(viewportTransform());
0
2576 const QTransform viewTransform = painter.worldTransform();-
2577-
2578-
2579 if ((
(d->cacheMode ...cheBackground)Description
TRUEnever evaluated
FALSEnever evaluated
d->cacheMode & CacheBackground)
(d->cacheMode ...cheBackground)Description
TRUEnever evaluated
FALSEnever evaluated
0
2580-
2581-
2582-
2583 ) {-
2584-
2585-
2586 if (d->mustResizeBackgroundPixmap
d->mustResizeBackgroundPixmapDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2587 d->backgroundPixmap = QPixmap(viewport()->size());-
2588 QBrush bgBrush = viewport()->palette().brush(viewport()->backgroundRole());-
2589 if (!bgBrush.isOpaque()
!bgBrush.isOpaque()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2590 d->backgroundPixmap.fill(Qt::transparent);
never executed: d->backgroundPixmap.fill(Qt::transparent);
0
2591 QPainter p(&d->backgroundPixmap);-
2592 p.fillRect(0, 0, d->backgroundPixmap.width(), d->backgroundPixmap.height(), bgBrush);-
2593 d->backgroundPixmapExposed = QRegion(viewport()->rect());-
2594 d->mustResizeBackgroundPixmap = false;-
2595 }
never executed: end of block
0
2596-
2597-
2598 if (!d->backgroundPixmapExposed.isEmpty()
!d->background...osed.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2599 QPainter backgroundPainter(&d->backgroundPixmap);-
2600 backgroundPainter.setClipRegion(d->backgroundPixmapExposed, Qt::ReplaceClip);-
2601 if (viewTransformed
viewTransformedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2602 backgroundPainter.setTransform(viewTransform);
never executed: backgroundPainter.setTransform(viewTransform);
0
2603 QRectF backgroundExposedSceneRect = mapToScene(d->backgroundPixmapExposed.boundingRect()).boundingRect();-
2604 drawBackground(&backgroundPainter, backgroundExposedSceneRect);-
2605 d->backgroundPixmapExposed = QRegion();-
2606 }
never executed: end of block
0
2607-
2608-
2609 if (viewTransformed
viewTransformedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2610 painter.setWorldTransform(QTransform());-
2611 painter.drawPixmap(QPoint(), d->backgroundPixmap);-
2612 painter.setWorldTransform(viewTransform);-
2613 }
never executed: end of block
else {
0
2614 painter.drawPixmap(QPoint(), d->backgroundPixmap);-
2615 }
never executed: end of block
0
2616 } else {-
2617 if (!(d->optimizationFlags & DontSavePainterState)
!(d->optimizat...ePainterState)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2618 painter.save();
never executed: painter.save();
0
2619 drawBackground(&painter, exposedSceneRect);-
2620 if (!(d->optimizationFlags & DontSavePainterState)
!(d->optimizat...ePainterState)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2621 painter.restore();
never executed: painter.restore();
0
2622 }
never executed: end of block
0
2623-
2624-
2625 if (!(d->optimizationFlags & IndirectPainting)
!(d->optimizat...irectPainting)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2626 const quint32 oldRectAdjust = d->scene->d_func()->rectAdjust;-
2627 if (d->optimizationFlags & QGraphicsView::DontAdjustForAntialiasing
d->optimizatio...orAntialiasingDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2628 d->scene->d_func()->rectAdjust = 1;
never executed: d->scene->d_func()->rectAdjust = 1;
0
2629 else-
2630 d->scene->d_func()->rectAdjust = 2;
never executed: d->scene->d_func()->rectAdjust = 2;
0
2631 d->scene->d_func()->drawItems(&painter, viewTransformed ? &viewTransform : 0,-
2632 &d->exposedRegion, viewport());-
2633 d->scene->d_func()->rectAdjust = oldRectAdjust;-
2634-
2635-
2636-
2637-
2638-
2639-
2640 if (!d->scene->d_func()->painterStateProtection
!d->scene->d_f...tateProtectionDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2641 painter.setOpacity(1.0);
never executed: painter.setOpacity(1.0);
0
2642 painter.setWorldTransform(viewTransform);-
2643 }
never executed: end of block
else {
0
2644-
2645 if (!d->scene->d_func()->unpolishedItems.isEmpty()
!d->scene->d_f...tems.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2646 d->scene->d_func()->_q_polishItems();
never executed: d->scene->d_func()->_q_polishItems();
0
2647-
2648-
2649 d->scene->d_func()->updateAll = false;-
2650-
2651-
2652 bool allItems = false;-
2653 QList<QGraphicsItem *> itemList = d->findItems(d->exposedRegion, &allItems, viewTransform);-
2654 if (!itemList.isEmpty()
!itemList.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2655-
2656 const int numItems = itemList.size();-
2657 QGraphicsItem **itemArray = &itemList[0];-
2658 QStyleOptionGraphicsItem *styleOptionArray = d->allocStyleOptionsArray(numItems);-
2659 QTransform transform(Qt::Uninitialized);-
2660 for (int i = 0; i < numItems
i < numItemsDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
2661 QGraphicsItem *item = itemArray[i];-
2662 QGraphicsItemPrivate *itemd = item->d_ptr.data();-
2663 itemd->initStyleOption(&styleOptionArray[i], viewTransform, d->exposedRegion, allItems);-
2664-
2665-
2666-
2667-
2668-
2669 const QRectF brect = adjustedItemEffectiveBoundingRect(item);-
2670 if (!itemd->itemIsUntransformable()
!itemd->itemIs...ransformable()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2671 transform = item->sceneTransform();-
2672 if (viewTransformed
viewTransformedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2673 transform *= viewTransform;
never executed: transform *= viewTransform;
0
2674 }
never executed: end of block
else {
0
2675 transform = item->deviceTransform(viewTransform);-
2676 }
never executed: end of block
0
2677 itemd->paintedViewBoundingRects.insert(d->viewport, transform.mapRect(brect).toRect());-
2678 }
never executed: end of block
0
2679-
2680 drawItems(&painter, numItems, itemArray, styleOptionArray);-
2681 d->freeStyleOptionsArray(styleOptionArray);-
2682 }
never executed: end of block
0
2683 }
never executed: end of block
0
2684-
2685-
2686 drawForeground(&painter, exposedSceneRect);-
2687-
2688-
2689-
2690 if (d->rubberBanding
d->rubberBandingDescription
TRUEnever evaluated
FALSEnever evaluated
&& !d->rubberBandRect.isEmpty()
!d->rubberBandRect.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2691 painter.restore();-
2692 QStyleOptionRubberBand option;-
2693 option.initFrom(viewport());-
2694 option.rect = d->rubberBandRect;-
2695 option.shape = QRubberBand::Rectangle;-
2696-
2697 QStyleHintReturnMask mask;-
2698 if (viewport()->style()->styleHint(QStyle::SH_RubberBand_Mask, &option, viewport(), &mask)
viewport()->st...port(), &mask)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2699-
2700 painter.setClipRegion(mask.region, Qt::IntersectClip);-
2701 }
never executed: end of block
0
2702-
2703 viewport()->style()->drawControl(QStyle::CE_RubberBand, &option, &painter, viewport());-
2704 }
never executed: end of block
0
2705-
2706-
2707 painter.end();-
2708-
2709-
2710 d->scene->d_func()->painterStateProtection = true;-
2711}
never executed: end of block
0
2712-
2713-
2714-
2715-
2716void QGraphicsView::resizeEvent(QResizeEvent *event)-
2717{-
2718 QGraphicsViewPrivate * const d = d_func();-
2719-
2720-
2721 QPointF oldLastCenterPoint = d->lastCenterPoint;-
2722-
2723 QAbstractScrollArea::resizeEvent(event);-
2724 d->recalculateContentSize();-
2725-
2726-
2727 if (d->resizeAnchor == NoAnchor
d->resizeAnchor == NoAnchorDescription
TRUEnever evaluated
FALSEnever evaluated
&& !d->keepLastCenterPoint
!d->keepLastCenterPointDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2728 d->updateLastCenterPoint();-
2729 }
never executed: end of block
else {
0
2730 d->lastCenterPoint = oldLastCenterPoint;-
2731 }
never executed: end of block
0
2732 d->centerView(d->resizeAnchor);-
2733 d->keepLastCenterPoint = false;-
2734-
2735 if (d->cacheMode & CacheBackground
d->cacheMode & CacheBackgroundDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2736-
2737 d->mustResizeBackgroundPixmap = true;-
2738 }
never executed: end of block
0
2739}
never executed: end of block
0
2740-
2741-
2742-
2743-
2744void QGraphicsView::scrollContentsBy(int dx, int dy)-
2745{-
2746 QGraphicsViewPrivate * const d = d_func();-
2747 d->dirtyScroll = true;-
2748 if (d->transforming
d->transformingDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2749 return;
never executed: return;
0
2750 if (isRightToLeft()
isRightToLeft()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2751 dx = -dx;
never executed: dx = -dx;
0
2752-
2753 if (d->viewportUpdateMode != QGraphicsView::NoViewportUpdate
d->viewportUpd...ViewportUpdateDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2754 if (d->viewportUpdateMode != QGraphicsView::FullViewportUpdate
d->viewportUpd...ViewportUpdateDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2755 if (d->accelerateScrolling
d->accelerateScrollingDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2756-
2757-
2758 if (!d->rubberBandRect.isEmpty()
!d->rubberBandRect.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2759 QRegion rubberBandRegion(d->rubberBandRegion(viewport(), d->rubberBandRect));-
2760 rubberBandRegion += rubberBandRegion.translated(-dx, -dy);-
2761 viewport()->update(rubberBandRegion);-
2762 }
never executed: end of block
0
2763-
2764 d->dirtyScrollOffset.rx() += dx;-
2765 d->dirtyScrollOffset.ry() += dy;-
2766 d->dirtyRegion.translate(dx, dy);-
2767 viewport()->scroll(dx, dy);-
2768 }
never executed: end of block
else {
0
2769 d->updateAll();-
2770 }
never executed: end of block
0
2771 } else {-
2772 d->updateAll();-
2773 }
never executed: end of block
0
2774 }-
2775-
2776 d->updateLastCenterPoint();-
2777-
2778 if ((
(d->cacheMode ...cheBackground)Description
TRUEnever evaluated
FALSEnever evaluated
d->cacheMode & CacheBackground)
(d->cacheMode ...cheBackground)Description
TRUEnever evaluated
FALSEnever evaluated
0
2779-
2780-
2781-
2782 ) {-
2783-
2784 QRegion exposed;-
2785 if (!d->backgroundPixmap.isNull()
!d->backgroundPixmap.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2786 d->backgroundPixmap.scroll(dx, dy, d->backgroundPixmap.rect(), &exposed);
never executed: d->backgroundPixmap.scroll(dx, dy, d->backgroundPixmap.rect(), &exposed);
0
2787-
2788-
2789 d->backgroundPixmapExposed.translate(dx, dy);-
2790 d->backgroundPixmapExposed += exposed;-
2791 }
never executed: end of block
0
2792-
2793-
2794 if (d->sceneInteractionAllowed
d->sceneInteractionAllowedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2795 d->replayLastMouseEvent();
never executed: d->replayLastMouseEvent();
0
2796}
never executed: end of block
0
2797-
2798-
2799-
2800-
2801void QGraphicsView::showEvent(QShowEvent *event)-
2802{-
2803 QGraphicsViewPrivate * const d = d_func();-
2804 d->recalculateContentSize();-
2805 d->centerView(d->transformationAnchor);-
2806 QAbstractScrollArea::showEvent(event);-
2807}
never executed: end of block
0
2808-
2809-
2810-
2811-
2812void QGraphicsView::inputMethodEvent(QInputMethodEvent *event)-
2813{-
2814 QGraphicsViewPrivate * const d = d_func();-
2815 if (d->scene
d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2816 QApplication::sendEvent(d->scene, event);
never executed: QApplication::sendEvent(d->scene, event);
0
2817}
never executed: end of block
0
2818void QGraphicsView::drawBackground(QPainter *painter, const QRectF &rect)-
2819{-
2820 QGraphicsViewPrivate * const d = d_func();-
2821 if (d->scene
d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->backgroundBrush.style() == Qt::NoBrush
d->backgroundB...== Qt::NoBrushDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2822 d->scene->drawBackground(painter, rect);-
2823 return;
never executed: return;
0
2824 }-
2825-
2826 painter->fillRect(rect, d->backgroundBrush);-
2827}
never executed: end of block
0
2828void QGraphicsView::drawForeground(QPainter *painter, const QRectF &rect)-
2829{-
2830 QGraphicsViewPrivate * const d = d_func();-
2831 if (d->scene
d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->foregroundBrush.style() == Qt::NoBrush
d->foregroundB...== Qt::NoBrushDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2832 d->scene->drawForeground(painter, rect);-
2833 return;
never executed: return;
0
2834 }-
2835-
2836 painter->fillRect(rect, d->foregroundBrush);-
2837}
never executed: end of block
0
2838void QGraphicsView::drawItems(QPainter *painter, int numItems,-
2839 QGraphicsItem *items[],-
2840 const QStyleOptionGraphicsItem options[])-
2841{-
2842 QGraphicsViewPrivate * const d = d_func();-
2843 if (d->scene
d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2844 QWidget *widget = painter->device() == viewport()
painter->devic... == viewport()Description
TRUEnever evaluated
FALSEnever evaluated
? viewport() : 0;
0
2845 d->scene->drawItems(painter, numItems, items, options, widget);-
2846 }
never executed: end of block
0
2847}
never executed: end of block
0
2848-
2849-
2850-
2851-
2852-
2853-
2854-
2855QTransform QGraphicsView::transform() const-
2856{-
2857 const QGraphicsViewPrivate * const d = d_func();-
2858 return
never executed: return d->matrix;
d->matrix;
never executed: return d->matrix;
0
2859}-
2860-
2861-
2862-
2863-
2864-
2865-
2866QTransform QGraphicsView::viewportTransform() const-
2867{-
2868 const QGraphicsViewPrivate * const d = d_func();-
2869 QTransform moveMatrix = QTransform::fromTranslate(-d->horizontalScroll(), -d->verticalScroll());-
2870 return
never executed: return d->identityMatrix ? moveMatrix : d->matrix * moveMatrix;
d->identityMatrix ? moveMatrix : d->matrix * moveMatrix;
never executed: return d->identityMatrix ? moveMatrix : d->matrix * moveMatrix;
0
2871}-
2872bool QGraphicsView::isTransformed() const-
2873{-
2874 const QGraphicsViewPrivate * const d = d_func();-
2875 return
never executed: return !d->identityMatrix || d->horizontalScroll() || d->verticalScroll();
!d->identityMatrix || d->horizontalScroll() || d->verticalScroll();
never executed: return !d->identityMatrix || d->horizontalScroll() || d->verticalScroll();
0
2876}-
2877void QGraphicsView::setTransform(const QTransform &matrix, bool combine )-
2878{-
2879 QGraphicsViewPrivate * const d = d_func();-
2880 QTransform oldMatrix = d->matrix;-
2881 if (!combine
!combineDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2882 d->matrix = matrix;
never executed: d->matrix = matrix;
0
2883 else-
2884 d->matrix = matrix * d->matrix;
never executed: d->matrix = matrix * d->matrix;
0
2885 if (oldMatrix == d->matrix
oldMatrix == d->matrixDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2886 return;
never executed: return;
0
2887-
2888 d->identityMatrix = d->matrix.isIdentity();-
2889 d->transforming = true;-
2890 if (d->scene
d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2891 d->recalculateContentSize();-
2892 d->centerView(d->transformationAnchor);-
2893 }
never executed: end of block
else {
0
2894 d->updateLastCenterPoint();-
2895 }
never executed: end of block
0
2896-
2897 if (d->sceneInteractionAllowed
d->sceneInteractionAllowedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2898 d->replayLastMouseEvent();
never executed: d->replayLastMouseEvent();
0
2899 d->transforming = false;-
2900-
2901-
2902 d->updateAll();-
2903}
never executed: end of block
0
2904-
2905-
2906-
2907-
2908-
2909-
2910void QGraphicsView::resetTransform()-
2911{-
2912 setTransform(QTransform());-
2913}
never executed: end of block
0
2914-
2915QPointF QGraphicsViewPrivate::mapToScene(const QPointF &point) const-
2916{-
2917 QPointF p = point;-
2918 p.rx() += horizontalScroll();-
2919 p.ry() += verticalScroll();-
2920 return
never executed: return identityMatrix ? p : matrix.inverted().map(p);
identityMatrix ? p : matrix.inverted().map(p);
never executed: return identityMatrix ? p : matrix.inverted().map(p);
0
2921}-
2922-
2923QRectF QGraphicsViewPrivate::mapToScene(const QRectF &rect) const-
2924{-
2925 QPointF scrollOffset(horizontalScroll(), verticalScroll());-
2926 QPointF tl = scrollOffset + rect.topLeft();-
2927 QPointF tr = scrollOffset + rect.topRight();-
2928 QPointF br = scrollOffset + rect.bottomRight();-
2929 QPointF bl = scrollOffset + rect.bottomLeft();-
2930-
2931 QPolygonF poly(4);-
2932 if (!identityMatrix
!identityMatrixDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2933 QTransform x = matrix.inverted();-
2934 poly[0] = x.map(tl);-
2935 poly[1] = x.map(tr);-
2936 poly[2] = x.map(br);-
2937 poly[3] = x.map(bl);-
2938 }
never executed: end of block
else {
0
2939 poly[0] = tl;-
2940 poly[1] = tr;-
2941 poly[2] = br;-
2942 poly[3] = bl;-
2943 }
never executed: end of block
0
2944 return
never executed: return poly.boundingRect();
poly.boundingRect();
never executed: return poly.boundingRect();
0
2945}-
2946-
2947-
2948-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9