qgraphicssceneindex.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/widgets/graphicsview/qgraphicssceneindex.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6namespace QtPrivate {-
7-
8 static bool intersect_rect(const QGraphicsItem *item, const QRectF &exposeRect, Qt::ItemSelectionMode mode,-
9 const QTransform &deviceTransform, const void *intersectData)-
10 {-
11 const QRectF sceneRect = *static_cast<const QRectF *>(intersectData);-
12-
13 QRectF brect = item->boundingRect();-
14 _q_adjustRect(&brect);-
15-
16-
17 (void)exposeRect;;-
18-
19 bool keep = true;-
20 const QGraphicsItemPrivate *itemd = QGraphicsItemPrivate::get(item);-
21 if (itemd->itemIsUntransformable()
itemd->itemIsUntransformable()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
22-
23 const QTransform transform = item->deviceTransform(deviceTransform);-
24 QRectF itemRect = (deviceTransform * transform.inverted()).mapRect(sceneRect);-
25 if (mode == Qt::ContainsItemShape
mode == Qt::ContainsItemShapeDescription
TRUEnever evaluated
FALSEnever evaluated
|| mode == Qt::ContainsItemBoundingRect
mode == Qt::Co...emBoundingRectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
26 keep = itemRect.contains(brect)
itemRect.contains(brect)Description
TRUEnever evaluated
FALSEnever evaluated
&& itemRect != brect
itemRect != brectDescription
TRUEnever evaluated
FALSEnever evaluated
;
never executed: keep = itemRect.contains(brect) && itemRect != brect;
0
27 else-
28 keep = itemRect.intersects(brect);
never executed: keep = itemRect.intersects(brect);
0
29 if (keep
keepDescription
TRUEnever evaluated
FALSEnever evaluated
&& (mode == Qt::ContainsItemShape
mode == Qt::ContainsItemShapeDescription
TRUEnever evaluated
FALSEnever evaluated
|| mode == Qt::IntersectsItemShape
mode == Qt::In...sectsItemShapeDescription
TRUEnever evaluated
FALSEnever evaluated
)) {
0
30 QPainterPath itemPath;-
31 itemPath.addRect(itemRect);-
32 keep = QGraphicsSceneIndexPrivate::itemCollidesWithPath(item, itemPath, mode);-
33 }
never executed: end of block
0
34 }
never executed: end of block
else {
0
35 ((!(!itemd->dirtySceneTransform)) ? qt_assert("!itemd->dirtySceneTransform",__FILE__,97) : qt_noop());-
36 const QRectF itemSceneBoundingRect = itemd->sceneTransformTranslateOnly
itemd->sceneTr...mTranslateOnlyDescription
TRUEnever evaluated
FALSEnever evaluated
0
37 ? brect.translated(itemd->sceneTransform.dx(),-
38 itemd->sceneTransform.dy())-
39 : itemd->sceneTransform.mapRect(brect);-
40 if (mode == Qt::ContainsItemShape
mode == Qt::ContainsItemShapeDescription
TRUEnever evaluated
FALSEnever evaluated
|| mode == Qt::ContainsItemBoundingRect
mode == Qt::Co...emBoundingRectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
41 keep = sceneRect != brect
sceneRect != brectDescription
TRUEnever evaluated
FALSEnever evaluated
&& sceneRect.contains(itemSceneBoundingRect)
sceneRect.cont...eBoundingRect)Description
TRUEnever evaluated
FALSEnever evaluated
;
never executed: keep = sceneRect != brect && sceneRect.contains(itemSceneBoundingRect);
0
42 else-
43 keep = sceneRect.intersects(itemSceneBoundingRect);
never executed: keep = sceneRect.intersects(itemSceneBoundingRect);
0
44 if (keep
keepDescription
TRUEnever evaluated
FALSEnever evaluated
&& (mode == Qt::ContainsItemShape
mode == Qt::ContainsItemShapeDescription
TRUEnever evaluated
FALSEnever evaluated
|| mode == Qt::IntersectsItemShape
mode == Qt::In...sectsItemShapeDescription
TRUEnever evaluated
FALSEnever evaluated
)) {
0
45 QPainterPath rectPath;-
46 rectPath.addRect(sceneRect);-
47 if (itemd->sceneTransformTranslateOnly
itemd->sceneTr...mTranslateOnlyDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
48 rectPath.translate(-itemd->sceneTransform.dx(), -itemd->sceneTransform.dy());
never executed: rectPath.translate(-itemd->sceneTransform.dx(), -itemd->sceneTransform.dy());
0
49 else-
50 rectPath = itemd->sceneTransform.inverted().map(rectPath);
never executed: rectPath = itemd->sceneTransform.inverted().map(rectPath);
0
51 keep = QGraphicsSceneIndexPrivate::itemCollidesWithPath(item, rectPath, mode);-
52 }
never executed: end of block
0
53 }
never executed: end of block
0
54 return
never executed: return keep;
keep;
never executed: return keep;
0
55 }-
56-
57 static bool intersect_point(const QGraphicsItem *item, const QRectF &exposeRect, Qt::ItemSelectionMode mode,-
58 const QTransform &deviceTransform, const void *intersectData)-
59 {-
60 const QPointF scenePoint = *static_cast<const QPointF *>(intersectData);-
61-
62 QRectF brect = item->boundingRect();-
63 _q_adjustRect(&brect);-
64-
65-
66 (void)exposeRect;;-
67-
68 bool keep = false;-
69 const QGraphicsItemPrivate *itemd = QGraphicsItemPrivate::get(item);-
70 if (itemd->itemIsUntransformable()
itemd->itemIsUntransformable()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
71-
72 const QTransform transform = item->deviceTransform(deviceTransform);-
73 QPointF itemPoint = (deviceTransform * transform.inverted()).map(scenePoint);-
74 keep = brect.contains(itemPoint);-
75 if (keep
keepDescription
TRUEnever evaluated
FALSEnever evaluated
&& (mode == Qt::ContainsItemShape
mode == Qt::ContainsItemShapeDescription
TRUEnever evaluated
FALSEnever evaluated
|| mode == Qt::IntersectsItemShape
mode == Qt::In...sectsItemShapeDescription
TRUEnever evaluated
FALSEnever evaluated
)) {
0
76 QPainterPath pointPath;-
77 pointPath.addRect(QRectF(itemPoint, QSizeF(1, 1)));-
78 keep = QGraphicsSceneIndexPrivate::itemCollidesWithPath(item, pointPath, mode);-
79 }
never executed: end of block
0
80 }
never executed: end of block
else {
0
81 ((!(!itemd->dirtySceneTransform)) ? qt_assert("!itemd->dirtySceneTransform",__FILE__,143) : qt_noop());-
82 QRectF sceneBoundingRect = itemd->sceneTransformTranslateOnly
itemd->sceneTr...mTranslateOnlyDescription
TRUEnever evaluated
FALSEnever evaluated
0
83 ? brect.translated(itemd->sceneTransform.dx(),-
84 itemd->sceneTransform.dy())-
85 : itemd->sceneTransform.mapRect(brect);-
86 keep = sceneBoundingRect.intersects(QRectF(scenePoint, QSizeF(1, 1)));-
87 if (keep
keepDescription
TRUEnever evaluated
FALSEnever evaluated
&& (mode == Qt::ContainsItemShape
mode == Qt::ContainsItemShapeDescription
TRUEnever evaluated
FALSEnever evaluated
|| mode == Qt::IntersectsItemShape
mode == Qt::In...sectsItemShapeDescription
TRUEnever evaluated
FALSEnever evaluated
)) {
0
88 QPointF p = itemd->sceneTransformTranslateOnly
itemd->sceneTr...mTranslateOnlyDescription
TRUEnever evaluated
FALSEnever evaluated
0
89 ? QPointF(scenePoint.x() - itemd->sceneTransform.dx(),-
90 scenePoint.y() - itemd->sceneTransform.dy())-
91 : itemd->sceneTransform.inverted().map(scenePoint);-
92 keep = item->contains(p);-
93 }
never executed: end of block
0
94 }
never executed: end of block
0
95-
96 return
never executed: return keep;
keep;
never executed: return keep;
0
97 }-
98-
99 static bool intersect_path(const QGraphicsItem *item, const QRectF &exposeRect, Qt::ItemSelectionMode mode,-
100 const QTransform &deviceTransform, const void *intersectData)-
101 {-
102 const QPainterPath scenePath = *static_cast<const QPainterPath *>(intersectData);-
103-
104 QRectF brect = item->boundingRect();-
105 _q_adjustRect(&brect);-
106-
107-
108 (void)exposeRect;;-
109-
110 bool keep = true;-
111 const QGraphicsItemPrivate *itemd = QGraphicsItemPrivate::get(item);-
112 if (itemd->itemIsUntransformable()
itemd->itemIsUntransformable()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
113-
114 const QTransform transform = item->deviceTransform(deviceTransform);-
115 QPainterPath itemPath = (deviceTransform * transform.inverted()).map(scenePath);-
116 if (mode == Qt::ContainsItemShape
mode == Qt::ContainsItemShapeDescription
TRUEnever evaluated
FALSEnever evaluated
|| mode == Qt::ContainsItemBoundingRect
mode == Qt::Co...emBoundingRectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
117 keep = itemPath.contains(brect);
never executed: keep = itemPath.contains(brect);
0
118 else-
119 keep = itemPath.intersects(brect);
never executed: keep = itemPath.intersects(brect);
0
120 if (keep
keepDescription
TRUEnever evaluated
FALSEnever evaluated
&& (mode == Qt::ContainsItemShape
mode == Qt::ContainsItemShapeDescription
TRUEnever evaluated
FALSEnever evaluated
|| mode == Qt::IntersectsItemShape
mode == Qt::In...sectsItemShapeDescription
TRUEnever evaluated
FALSEnever evaluated
))
0
121 keep = QGraphicsSceneIndexPrivate::itemCollidesWithPath(item, itemPath, mode);
never executed: keep = QGraphicsSceneIndexPrivate::itemCollidesWithPath(item, itemPath, mode);
0
122 }
never executed: end of block
else {
0
123 ((!(!itemd->dirtySceneTransform)) ? qt_assert("!itemd->dirtySceneTransform",__FILE__,185) : qt_noop());-
124 const QRectF itemSceneBoundingRect = itemd->sceneTransformTranslateOnly
itemd->sceneTr...mTranslateOnlyDescription
TRUEnever evaluated
FALSEnever evaluated
0
125 ? brect.translated(itemd->sceneTransform.dx(),-
126 itemd->sceneTransform.dy())-
127 : itemd->sceneTransform.mapRect(brect);-
128 if (mode == Qt::ContainsItemShape
mode == Qt::ContainsItemShapeDescription
TRUEnever evaluated
FALSEnever evaluated
|| mode == Qt::ContainsItemBoundingRect
mode == Qt::Co...emBoundingRectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
129 keep = scenePath.contains(itemSceneBoundingRect);
never executed: keep = scenePath.contains(itemSceneBoundingRect);
0
130 else-
131 keep = scenePath.intersects(itemSceneBoundingRect);
never executed: keep = scenePath.intersects(itemSceneBoundingRect);
0
132 if (keep
keepDescription
TRUEnever evaluated
FALSEnever evaluated
&& (mode == Qt::ContainsItemShape
mode == Qt::ContainsItemShapeDescription
TRUEnever evaluated
FALSEnever evaluated
|| mode == Qt::IntersectsItemShape
mode == Qt::In...sectsItemShapeDescription
TRUEnever evaluated
FALSEnever evaluated
)) {
0
133 QPainterPath itemPath = itemd->sceneTransformTranslateOnly
itemd->sceneTr...mTranslateOnlyDescription
TRUEnever evaluated
FALSEnever evaluated
0
134 ? scenePath.translated(-itemd->sceneTransform.dx(),-
135 -itemd->sceneTransform.dy())-
136 : itemd->sceneTransform.inverted().map(scenePath);-
137 keep = QGraphicsSceneIndexPrivate::itemCollidesWithPath(item, itemPath, mode);-
138 }
never executed: end of block
0
139 }
never executed: end of block
0
140 return
never executed: return keep;
keep;
never executed: return keep;
0
141 }-
142-
143}-
144-
145-
146-
147-
148QGraphicsSceneIndexPrivate::QGraphicsSceneIndexPrivate(QGraphicsScene *scene) : scene(scene)-
149{-
150}
never executed: end of block
0
151-
152-
153-
154-
155QGraphicsSceneIndexPrivate::~QGraphicsSceneIndexPrivate()-
156{-
157}-
158-
159-
160-
161-
162-
163-
164-
165bool QGraphicsSceneIndexPrivate::itemCollidesWithPath(const QGraphicsItem *item,-
166 const QPainterPath &path,-
167 Qt::ItemSelectionMode mode)-
168{-
169 if (item->collidesWithPath(path, mode)
item->collides...th(path, mode)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
170 return
never executed: return true;
true;
never executed: return true;
0
171 if (item->isWidget()
item->isWidget()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
172-
173 const QGraphicsWidget *widget = static_cast<const QGraphicsWidget *>(item);-
174 if (widget->isWindow()
widget->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
175 QRectF frameRect = widget->windowFrameRect();-
176 QPainterPath framePath;-
177 framePath.addRect(frameRect);-
178 bool intersects = path.intersects(frameRect);-
179 if (mode == Qt::IntersectsItemShape
mode == Qt::In...sectsItemShapeDescription
TRUEnever evaluated
FALSEnever evaluated
|| mode == Qt::IntersectsItemBoundingRect
mode == Qt::In...emBoundingRectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
180 return
never executed: return intersects || path.contains(frameRect.topLeft()) || framePath.contains(path.elementAt(0));
intersects || path.contains(frameRect.topLeft())
never executed: return intersects || path.contains(frameRect.topLeft()) || framePath.contains(path.elementAt(0));
0
181 || framePath.contains(path.elementAt(0));
never executed: return intersects || path.contains(frameRect.topLeft()) || framePath.contains(path.elementAt(0));
0
182 return
never executed: return !intersects && path.contains(frameRect.topLeft());
!intersects && path.contains(frameRect.topLeft());
never executed: return !intersects && path.contains(frameRect.topLeft());
0
183 }-
184 }
never executed: end of block
0
185 return
never executed: return false;
false;
never executed: return false;
0
186}-
187-
188-
189-
190-
191-
192void QGraphicsSceneIndexPrivate::recursive_items_helper(QGraphicsItem *item, QRectF exposeRect,-
193 QGraphicsSceneIndexIntersector intersect,-
194 QList<QGraphicsItem *> *items,-
195 const QTransform &viewTransform,-
196 Qt::ItemSelectionMode mode,-
197 qreal parentOpacity, const void *intersectData) const-
198{-
199 ((!(item)) ? qt_assert("item",__FILE__,261) : qt_noop());-
200 if (!item->d_ptr->visible
!item->d_ptr->visibleDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
201 return;
never executed: return;
0
202-
203 const qreal opacity = item->d_ptr->combineOpacityFromParent(parentOpacity);-
204 const bool itemIsFullyTransparent = QGraphicsItemPrivate::isOpacityNull(opacity);-
205 const bool itemHasChildren = !item->d_ptr->children.isEmpty();-
206 if (itemIsFullyTransparent
itemIsFullyTransparentDescription
TRUEnever evaluated
FALSEnever evaluated
&& (!itemHasChildren
!itemHasChildrenDescription
TRUEnever evaluated
FALSEnever evaluated
|| item->d_ptr->childrenCombineOpacity()
item->d_ptr->c...mbineOpacity()Description
TRUEnever evaluated
FALSEnever evaluated
))
0
207 return;
never executed: return;
0
208-
209-
210 const bool itemIsUntransformable = item->d_ptr->itemIsUntransformable();-
211 const bool wasDirtyParentSceneTransform = item->d_ptr->dirtySceneTransform
item->d_ptr->d...SceneTransformDescription
TRUEnever evaluated
FALSEnever evaluated
&& !itemIsUntransformable
!itemIsUntransformableDescription
TRUEnever evaluated
FALSEnever evaluated
;
0
212 if (wasDirtyParentSceneTransform
wasDirtyParentSceneTransformDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
213 item->d_ptr->updateSceneTransformFromParent();-
214 ((!(!item->d_ptr->dirtySceneTransform)) ? qt_assert("!item->d_ptr->dirtySceneTransform",__FILE__,276) : qt_noop());-
215 }
never executed: end of block
0
216-
217 const bool itemClipsChildrenToShape = (item->d_ptr->flags & QGraphicsItem::ItemClipsChildrenToShape
item->d_ptr->f...hildrenToShapeDescription
TRUEnever evaluated
FALSEnever evaluated
0
218 || item->d_ptr->flags & QGraphicsItem::ItemContainsChildrenInShape
item->d_ptr->f...hildrenInShapeDescription
TRUEnever evaluated
FALSEnever evaluated
);
0
219 bool processItem = !itemIsFullyTransparent;-
220 if (processItem
processItemDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
221 processItem = intersect(item, exposeRect, mode, viewTransform, intersectData);-
222 if (!processItem
!processItemDescription
TRUEnever evaluated
FALSEnever evaluated
&& (!itemHasChildren
!itemHasChildrenDescription
TRUEnever evaluated
FALSEnever evaluated
|| itemClipsChildrenToShape
itemClipsChildrenToShapeDescription
TRUEnever evaluated
FALSEnever evaluated
)) {
0
223 if (wasDirtyParentSceneTransform
wasDirtyParentSceneTransformDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
224 item->d_ptr->invalidateChildrenSceneTransform();
never executed: item->d_ptr->invalidateChildrenSceneTransform();
0
225 return;
never executed: return;
0
226 }-
227 }
never executed: end of block
0
228-
229 int i = 0;-
230 if (itemHasChildren
itemHasChildrenDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
231-
232 item->d_ptr->ensureSortedChildren();-
233-
234-
235 if (itemClipsChildrenToShape
itemClipsChildrenToShapeDescription
TRUEnever evaluated
FALSEnever evaluated
&& !itemIsUntransformable
!itemIsUntransformableDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
236 QPainterPath mappedShape = item->d_ptr->sceneTransformTranslateOnly
item->d_ptr->s...mTranslateOnlyDescription
TRUEnever evaluated
FALSEnever evaluated
0
237 ? item->shape().translated(item->d_ptr->sceneTransform.dx(),-
238 item->d_ptr->sceneTransform.dy())-
239 : item->d_ptr->sceneTransform.map(item->shape());-
240 exposeRect &= mappedShape.controlPointRect();-
241 }
never executed: end of block
0
242-
243-
244 for (i = 0; i < item->d_ptr->children.size()
i < item->d_pt...hildren.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
245 QGraphicsItem *child = item->d_ptr->children.at(i);-
246 if (wasDirtyParentSceneTransform
wasDirtyParentSceneTransformDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
247 child->d_ptr->dirtySceneTransform = 1;
never executed: child->d_ptr->dirtySceneTransform = 1;
0
248 if (!(child->d_ptr->flags & QGraphicsItem::ItemStacksBehindParent)
!(child->d_ptr...sBehindParent)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
249 break;
never executed: break;
0
250 if (itemIsFullyTransparent
itemIsFullyTransparentDescription
TRUEnever evaluated
FALSEnever evaluated
&& !(child->d_ptr->flags & QGraphicsItem::ItemIgnoresParentOpacity)
!(child->d_ptr...ParentOpacity)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
251 continue;
never executed: continue;
0
252 recursive_items_helper(child, exposeRect, intersect, items, viewTransform,-
253 mode, opacity, intersectData);-
254 }
never executed: end of block
0
255 }
never executed: end of block
0
256-
257-
258 if (processItem
processItemDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
259 items->append(item);
never executed: items->append(item);
0
260-
261-
262 if (itemHasChildren
itemHasChildrenDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
263 for (; i < item->d_ptr->children.size()
i < item->d_pt...hildren.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
264 QGraphicsItem *child = item->d_ptr->children.at(i);-
265 if (wasDirtyParentSceneTransform
wasDirtyParentSceneTransformDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
266 child->d_ptr->dirtySceneTransform = 1;
never executed: child->d_ptr->dirtySceneTransform = 1;
0
267 if (itemIsFullyTransparent
itemIsFullyTransparentDescription
TRUEnever evaluated
FALSEnever evaluated
&& !(child->d_ptr->flags & QGraphicsItem::ItemIgnoresParentOpacity)
!(child->d_ptr...ParentOpacity)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
268 continue;
never executed: continue;
0
269 recursive_items_helper(child, exposeRect, intersect, items, viewTransform,-
270 mode, opacity, intersectData);-
271 }
never executed: end of block
0
272 }
never executed: end of block
0
273}
never executed: end of block
0
274-
275void QGraphicsSceneIndexPrivate::init()-
276{-
277 if (!scene
!sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
278 return;
never executed: return;
0
279-
280 QObject::connect(scene, qFlagLocation("2""sceneRectChanged(QRectF)" "\0" __FILE__ ":" "342"),-
281 q_func(), qFlagLocation("1""updateSceneRect(QRectF)" "\0" __FILE__ ":" "343"));-
282}
never executed: end of block
0
283-
284-
285-
286-
287QGraphicsSceneIndex::QGraphicsSceneIndex(QGraphicsScene *scene)-
288: QObject(*new QGraphicsSceneIndexPrivate(scene), scene)-
289{-
290 d_func()->init();-
291}
never executed: end of block
0
292-
293-
294-
295-
296QGraphicsSceneIndex::QGraphicsSceneIndex(QGraphicsSceneIndexPrivate &dd, QGraphicsScene *scene)-
297 : QObject(dd, scene)-
298{-
299 d_func()->init();-
300}
never executed: end of block
0
301-
302-
303-
304-
305QGraphicsSceneIndex::~QGraphicsSceneIndex()-
306{-
307-
308}-
309-
310-
311-
312-
313QGraphicsScene* QGraphicsSceneIndex::scene() const-
314{-
315 const QGraphicsSceneIndexPrivate * const d = d_func();-
316 return
never executed: return d->scene;
d->scene;
never executed: return d->scene;
0
317}-
318QList<QGraphicsItem *> QGraphicsSceneIndex::items(const QPointF &pos, Qt::ItemSelectionMode mode,-
319 Qt::SortOrder order, const QTransform &deviceTransform) const-
320{-
321-
322 const QGraphicsSceneIndexPrivate * const d = d_func();-
323 QList<QGraphicsItem *> itemList;-
324 d->items_helper(QRectF(pos, QSizeF(1, 1)), &QtPrivate::intersect_point, &itemList, deviceTransform, mode, order, &pos);-
325 return
never executed: return itemList;
itemList;
never executed: return itemList;
0
326}-
327QList<QGraphicsItem *> QGraphicsSceneIndex::items(const QRectF &rect, Qt::ItemSelectionMode mode,-
328 Qt::SortOrder order, const QTransform &deviceTransform) const-
329{-
330 const QGraphicsSceneIndexPrivate * const d = d_func();-
331 QRectF exposeRect = rect;-
332 _q_adjustRect(&exposeRect);-
333 QList<QGraphicsItem *> itemList;-
334 d->items_helper(exposeRect, &QtPrivate::intersect_rect, &itemList, deviceTransform, mode, order, &rect);-
335 return
never executed: return itemList;
itemList;
never executed: return itemList;
0
336}-
337QList<QGraphicsItem *> QGraphicsSceneIndex::items(const QPolygonF &polygon, Qt::ItemSelectionMode mode,-
338 Qt::SortOrder order, const QTransform &deviceTransform) const-
339{-
340 const QGraphicsSceneIndexPrivate * const d = d_func();-
341 QList<QGraphicsItem *> itemList;-
342 QRectF exposeRect = polygon.boundingRect();-
343 _q_adjustRect(&exposeRect);-
344 QPainterPath path;-
345 path.addPolygon(polygon);-
346 d->items_helper(exposeRect, &QtPrivate::intersect_path, &itemList, deviceTransform, mode, order, &path);-
347 return
never executed: return itemList;
itemList;
never executed: return itemList;
0
348}-
349QList<QGraphicsItem *> QGraphicsSceneIndex::items(const QPainterPath &path, Qt::ItemSelectionMode mode,-
350 Qt::SortOrder order, const QTransform &deviceTransform) const-
351{-
352 const QGraphicsSceneIndexPrivate * const d = d_func();-
353 QList<QGraphicsItem *> itemList;-
354 QRectF exposeRect = path.controlPointRect();-
355 _q_adjustRect(&exposeRect);-
356 d->items_helper(exposeRect, &QtPrivate::intersect_path, &itemList, deviceTransform, mode, order, &path);-
357 return
never executed: return itemList;
itemList;
never executed: return itemList;
0
358}-
359-
360-
361-
362-
363-
364QList<QGraphicsItem *> QGraphicsSceneIndex::estimateItems(const QPointF &point, Qt::SortOrder order) const-
365{-
366 return
never executed: return estimateItems(QRectF(point, QSize(1, 1)), order);
estimateItems(QRectF(point, QSize(1, 1)), order);
never executed: return estimateItems(QRectF(point, QSize(1, 1)), order);
0
367}-
368-
369QList<QGraphicsItem *> QGraphicsSceneIndex::estimateTopLevelItems(const QRectF &rect, Qt::SortOrder order) const-
370{-
371 const QGraphicsSceneIndexPrivate * const d = d_func();-
372 (void)rect;;-
373 QGraphicsScenePrivate *scened = d->scene->d_func();-
374 scened->ensureSortedTopLevelItems();-
375 if (order == Qt::DescendingOrder
order == Qt::DescendingOrderDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
376 QList<QGraphicsItem *> sorted;-
377 const int numTopLevelItems = scened->topLevelItems.size();-
378 sorted.reserve(numTopLevelItems);-
379 for (int i = numTopLevelItems - 1; i >= 0
i >= 0Description
TRUEnever evaluated
FALSEnever evaluated
; --i)
0
380 sorted << scened->topLevelItems.at(i);
never executed: sorted << scened->topLevelItems.at(i);
0
381 return
never executed: return sorted;
sorted;
never executed: return sorted;
0
382 }-
383 return
never executed: return scened->topLevelItems;
scened->topLevelItems;
never executed: return scened->topLevelItems;
0
384}-
385void QGraphicsSceneIndex::updateSceneRect(const QRectF &rect)-
386{-
387 (void)rect;;-
388}
never executed: end of block
0
389-
390-
391-
392-
393void QGraphicsSceneIndex::clear()-
394{-
395 const QList<QGraphicsItem *> allItems = items();-
396 for (int i = 0 ; i < allItems.size()
i < allItems.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
397 removeItem(allItems.at(i));
never executed: removeItem(allItems.at(i));
0
398}
never executed: end of block
0
399void QGraphicsSceneIndex::deleteItem(QGraphicsItem *item)-
400{-
401 removeItem(item);-
402}
never executed: end of block
0
403void QGraphicsSceneIndex::itemChange(const QGraphicsItem *item, QGraphicsItem::GraphicsItemChange change, const void *const value)-
404{-
405 (void)item;;-
406 (void)change;;-
407 (void)value;;-
408}
never executed: end of block
0
409-
410-
411-
412-
413-
414-
415void QGraphicsSceneIndex::prepareBoundingRectChange(const QGraphicsItem *item)-
416{-
417 (void)item;;-
418}
never executed: end of block
0
419-
420-
421-
Switch to Source codePreprocessed file

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