Line | Source | Count |
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | | - |
12 | | - |
13 | | - |
14 | | - |
15 | | - |
16 | | - |
17 | | - |
18 | | - |
19 | | - |
20 | | - |
21 | | - |
22 | | - |
23 | | - |
24 | | - |
25 | | - |
26 | | - |
27 | | - |
28 | | - |
29 | | - |
30 | | - |
31 | | - |
32 | | - |
33 | | - |
34 | | - |
35 | | - |
36 | | - |
37 | | - |
38 | | - |
39 | | - |
40 | | - |
41 | | - |
42 | | - |
43 | | - |
44 | | - |
45 | | - |
46 | | - |
47 | | - |
48 | | - |
49 | | - |
50 | | - |
51 | | - |
52 | | - |
53 | | - |
54 | | - |
55 | | - |
56 | #include "qdebug.h" | - |
57 | #include "qgraphicsscene.h" | - |
58 | #include "qgraphicsitem_p.h" | - |
59 | #include "qgraphicsscene_p.h" | - |
60 | #include "qgraphicswidget.h" | - |
61 | #include "qgraphicssceneindex_p.h" | - |
62 | #include "qgraphicsscenebsptreeindex_p.h" | - |
63 | | - |
64 | #ifndef QT_NO_GRAPHICSVIEW | - |
65 | | - |
66 | QT_BEGIN_NAMESPACE | - |
67 | | - |
68 | namespace QtPrivate { | - |
69 | | - |
70 | static bool intersect_rect(const QGraphicsItem *item, const QRectF &exposeRect, Qt::ItemSelectionMode mode, | - |
71 | const QTransform &deviceTransform, const void *intersectData) | - |
72 | { | - |
73 | const QRectF sceneRect = *static_cast<const QRectF *>(intersectData); | - |
74 | | - |
75 | QRectF brect = item->boundingRect(); | - |
76 | _q_adjustRect(&brect); | - |
77 | | - |
78 | | - |
79 | Q_UNUSED(exposeRect); | - |
80 | | - |
81 | bool keep = true; | - |
82 | const QGraphicsItemPrivate *itemd = QGraphicsItemPrivate::get(item); | - |
83 | if (itemd->itemIsUntransformable()) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
84 | | - |
85 | const QTransform transform = item->deviceTransform(deviceTransform); | - |
86 | QRectF itemRect = (deviceTransform * transform.inverted()).mapRect(sceneRect); | - |
87 | if (mode == Qt::ContainsItemShape || mode == Qt::ContainsItemBoundingRect)TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
88 | keep = itemRect.contains(brect) && itemRect != brect; never executed: keep = itemRect.contains(brect) && itemRect != brect; TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
89 | else | - |
90 | keep = itemRect.intersects(brect); never executed: keep = itemRect.intersects(brect); | 0 |
91 | if (keep && (mode == Qt::ContainsItemShape || mode == Qt::IntersectsItemShape)) {TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
92 | QPainterPath itemPath; | - |
93 | itemPath.addRect(itemRect); | - |
94 | keep = QGraphicsSceneIndexPrivate::itemCollidesWithPath(item, itemPath, mode); | - |
95 | } never executed: end of block | 0 |
96 | } else { never executed: end of block | 0 |
97 | Q_ASSERT(!itemd->dirtySceneTransform); | - |
98 | const QRectF itemSceneBoundingRect = itemd->sceneTransformTranslateOnlyTRUE | never evaluated | FALSE | never evaluated |
| 0 |
99 | ? brect.translated(itemd->sceneTransform.dx(), | - |
100 | itemd->sceneTransform.dy()) | - |
101 | : itemd->sceneTransform.mapRect(brect); | - |
102 | if (mode == Qt::ContainsItemShape || mode == Qt::ContainsItemBoundingRect)TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
103 | keep = sceneRect != brect && sceneRect.contains(itemSceneBoundingRect); never executed: keep = sceneRect != brect && sceneRect.contains(itemSceneBoundingRect); TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
104 | else | - |
105 | keep = sceneRect.intersects(itemSceneBoundingRect); never executed: keep = sceneRect.intersects(itemSceneBoundingRect); | 0 |
106 | if (keep && (mode == Qt::ContainsItemShape || mode == Qt::IntersectsItemShape)) {TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
107 | QPainterPath rectPath; | - |
108 | rectPath.addRect(sceneRect); | - |
109 | if (itemd->sceneTransformTranslateOnly)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
110 | rectPath.translate(-itemd->sceneTransform.dx(), -itemd->sceneTransform.dy()); never executed: rectPath.translate(-itemd->sceneTransform.dx(), -itemd->sceneTransform.dy()); | 0 |
111 | else | - |
112 | rectPath = itemd->sceneTransform.inverted().map(rectPath); never executed: rectPath = itemd->sceneTransform.inverted().map(rectPath); | 0 |
113 | keep = QGraphicsSceneIndexPrivate::itemCollidesWithPath(item, rectPath, mode); | - |
114 | } never executed: end of block | 0 |
115 | } never executed: end of block | 0 |
116 | return keep; never executed: return keep; | 0 |
117 | } | - |
118 | | - |
119 | static bool intersect_point(const QGraphicsItem *item, const QRectF &exposeRect, Qt::ItemSelectionMode mode, | - |
120 | const QTransform &deviceTransform, const void *intersectData) | - |
121 | { | - |
122 | const QPointF scenePoint = *static_cast<const QPointF *>(intersectData); | - |
123 | | - |
124 | QRectF brect = item->boundingRect(); | - |
125 | _q_adjustRect(&brect); | - |
126 | | - |
127 | | - |
128 | Q_UNUSED(exposeRect); | - |
129 | | - |
130 | bool keep = false; | - |
131 | const QGraphicsItemPrivate *itemd = QGraphicsItemPrivate::get(item); | - |
132 | if (itemd->itemIsUntransformable()) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
133 | | - |
134 | const QTransform transform = item->deviceTransform(deviceTransform); | - |
135 | QPointF itemPoint = (deviceTransform * transform.inverted()).map(scenePoint); | - |
136 | keep = brect.contains(itemPoint); | - |
137 | if (keep && (mode == Qt::ContainsItemShape || mode == Qt::IntersectsItemShape)) {TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
138 | QPainterPath pointPath; | - |
139 | pointPath.addRect(QRectF(itemPoint, QSizeF(1, 1))); | - |
140 | keep = QGraphicsSceneIndexPrivate::itemCollidesWithPath(item, pointPath, mode); | - |
141 | } never executed: end of block | 0 |
142 | } else { never executed: end of block | 0 |
143 | Q_ASSERT(!itemd->dirtySceneTransform); | - |
144 | QRectF sceneBoundingRect = itemd->sceneTransformTranslateOnlyTRUE | never evaluated | FALSE | never evaluated |
| 0 |
145 | ? brect.translated(itemd->sceneTransform.dx(), | - |
146 | itemd->sceneTransform.dy()) | - |
147 | : itemd->sceneTransform.mapRect(brect); | - |
148 | keep = sceneBoundingRect.intersects(QRectF(scenePoint, QSizeF(1, 1))); | - |
149 | if (keep && (mode == Qt::ContainsItemShape || mode == Qt::IntersectsItemShape)) {TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
150 | QPointF p = itemd->sceneTransformTranslateOnlyTRUE | never evaluated | FALSE | never evaluated |
| 0 |
151 | ? QPointF(scenePoint.x() - itemd->sceneTransform.dx(), | - |
152 | scenePoint.y() - itemd->sceneTransform.dy()) | - |
153 | : itemd->sceneTransform.inverted().map(scenePoint); | - |
154 | keep = item->contains(p); | - |
155 | } never executed: end of block | 0 |
156 | } never executed: end of block | 0 |
157 | | - |
158 | return keep; never executed: return keep; | 0 |
159 | } | - |
160 | | - |
161 | static bool intersect_path(const QGraphicsItem *item, const QRectF &exposeRect, Qt::ItemSelectionMode mode, | - |
162 | const QTransform &deviceTransform, const void *intersectData) | - |
163 | { | - |
164 | const QPainterPath scenePath = *static_cast<const QPainterPath *>(intersectData); | - |
165 | | - |
166 | QRectF brect = item->boundingRect(); | - |
167 | _q_adjustRect(&brect); | - |
168 | | - |
169 | | - |
170 | Q_UNUSED(exposeRect); | - |
171 | | - |
172 | bool keep = true; | - |
173 | const QGraphicsItemPrivate *itemd = QGraphicsItemPrivate::get(item); | - |
174 | if (itemd->itemIsUntransformable()) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
175 | | - |
176 | const QTransform transform = item->deviceTransform(deviceTransform); | - |
177 | QPainterPath itemPath = (deviceTransform * transform.inverted()).map(scenePath); | - |
178 | if (mode == Qt::ContainsItemShape || mode == Qt::ContainsItemBoundingRect)TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
179 | keep = itemPath.contains(brect); never executed: keep = itemPath.contains(brect); | 0 |
180 | else | - |
181 | keep = itemPath.intersects(brect); never executed: keep = itemPath.intersects(brect); | 0 |
182 | if (keep && (mode == Qt::ContainsItemShape || mode == Qt::IntersectsItemShape))TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
183 | keep = QGraphicsSceneIndexPrivate::itemCollidesWithPath(item, itemPath, mode); never executed: keep = QGraphicsSceneIndexPrivate::itemCollidesWithPath(item, itemPath, mode); | 0 |
184 | } else { never executed: end of block | 0 |
185 | Q_ASSERT(!itemd->dirtySceneTransform); | - |
186 | const QRectF itemSceneBoundingRect = itemd->sceneTransformTranslateOnlyTRUE | never evaluated | FALSE | never evaluated |
| 0 |
187 | ? brect.translated(itemd->sceneTransform.dx(), | - |
188 | itemd->sceneTransform.dy()) | - |
189 | : itemd->sceneTransform.mapRect(brect); | - |
190 | if (mode == Qt::ContainsItemShape || mode == Qt::ContainsItemBoundingRect)TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
191 | keep = scenePath.contains(itemSceneBoundingRect); never executed: keep = scenePath.contains(itemSceneBoundingRect); | 0 |
192 | else | - |
193 | keep = scenePath.intersects(itemSceneBoundingRect); never executed: keep = scenePath.intersects(itemSceneBoundingRect); | 0 |
194 | if (keep && (mode == Qt::ContainsItemShape || mode == Qt::IntersectsItemShape)) {TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
195 | QPainterPath itemPath = itemd->sceneTransformTranslateOnlyTRUE | never evaluated | FALSE | never evaluated |
| 0 |
196 | ? scenePath.translated(-itemd->sceneTransform.dx(), | - |
197 | -itemd->sceneTransform.dy()) | - |
198 | : itemd->sceneTransform.inverted().map(scenePath); | - |
199 | keep = QGraphicsSceneIndexPrivate::itemCollidesWithPath(item, itemPath, mode); | - |
200 | } never executed: end of block | 0 |
201 | } never executed: end of block | 0 |
202 | return keep; never executed: return keep; | 0 |
203 | } | - |
204 | | - |
205 | } | - |
206 | | - |
207 | | - |
208 | | - |
209 | | - |
210 | QGraphicsSceneIndexPrivate::QGraphicsSceneIndexPrivate(QGraphicsScene *scene) : scene(scene) | - |
211 | { | - |
212 | } never executed: end of block | 0 |
213 | | - |
214 | | - |
215 | | - |
216 | | - |
217 | QGraphicsSceneIndexPrivate::~QGraphicsSceneIndexPrivate() | - |
218 | { | - |
219 | } | - |
220 | | - |
221 | | - |
222 | | - |
223 | | - |
224 | | - |
225 | | - |
226 | | - |
227 | bool QGraphicsSceneIndexPrivate::itemCollidesWithPath(const QGraphicsItem *item, | - |
228 | const QPainterPath &path, | - |
229 | Qt::ItemSelectionMode mode) | - |
230 | { | - |
231 | if (item->collidesWithPath(path, mode))TRUE | never evaluated | FALSE | never evaluated |
| 0 |
232 | return true; never executed: return true; | 0 |
233 | if (item->isWidget()) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
234 | | - |
235 | const QGraphicsWidget *widget = static_cast<const QGraphicsWidget *>(item); | - |
236 | if (widget->isWindow()) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
237 | QRectF frameRect = widget->windowFrameRect(); | - |
238 | QPainterPath framePath; | - |
239 | framePath.addRect(frameRect); | - |
240 | bool intersects = path.intersects(frameRect); | - |
241 | if (mode == Qt::IntersectsItemShape || mode == Qt::IntersectsItemBoundingRect)TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
242 | return intersects || path.contains(frameRect.topLeft()) never executed: return intersects || path.contains(frameRect.topLeft()) || framePath.contains(path.elementAt(0)); | 0 |
243 | || framePath.contains(path.elementAt(0)); never executed: return intersects || path.contains(frameRect.topLeft()) || framePath.contains(path.elementAt(0)); | 0 |
244 | return !intersects && path.contains(frameRect.topLeft()); never executed: return !intersects && path.contains(frameRect.topLeft()); | 0 |
245 | } | - |
246 | } never executed: end of block | 0 |
247 | return false; never executed: return false; | 0 |
248 | } | - |
249 | | - |
250 | | - |
251 | | - |
252 | | - |
253 | | - |
254 | void QGraphicsSceneIndexPrivate::recursive_items_helper(QGraphicsItem *item, QRectF exposeRect, | - |
255 | QGraphicsSceneIndexIntersector intersect, | - |
256 | QList<QGraphicsItem *> *items, | - |
257 | const QTransform &viewTransform, | - |
258 | Qt::ItemSelectionMode mode, | - |
259 | qreal parentOpacity, const void *intersectData) const | - |
260 | { | - |
261 | Q_ASSERT(item); | - |
262 | if (!item->d_ptr->visible)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
263 | return; never executed: return; | 0 |
264 | | - |
265 | const qreal opacity = item->d_ptr->combineOpacityFromParent(parentOpacity); | - |
266 | const bool itemIsFullyTransparent = QGraphicsItemPrivate::isOpacityNull(opacity); | - |
267 | const bool itemHasChildren = !item->d_ptr->children.isEmpty(); | - |
268 | if (itemIsFullyTransparent && (!itemHasChildren || item->d_ptr->childrenCombineOpacity()))TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
269 | return; never executed: return; | 0 |
270 | | - |
271 | | - |
272 | const bool itemIsUntransformable = item->d_ptr->itemIsUntransformable(); | - |
273 | const bool wasDirtyParentSceneTransform = item->d_ptr->dirtySceneTransform && !itemIsUntransformable;TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
274 | if (wasDirtyParentSceneTransform) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
275 | item->d_ptr->updateSceneTransformFromParent(); | - |
276 | Q_ASSERT(!item->d_ptr->dirtySceneTransform); | - |
277 | } never executed: end of block | 0 |
278 | | - |
279 | const bool itemClipsChildrenToShape = (item->d_ptr->flags & QGraphicsItem::ItemClipsChildrenToShapeTRUE | never evaluated | FALSE | never evaluated |
| 0 |
280 | || item->d_ptr->flags & QGraphicsItem::ItemContainsChildrenInShape);TRUE | never evaluated | FALSE | never evaluated |
| 0 |
281 | bool processItem = !itemIsFullyTransparent; | - |
282 | if (processItem) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
283 | processItem = intersect(item, exposeRect, mode, viewTransform, intersectData); | - |
284 | if (!processItem && (!itemHasChildren || itemClipsChildrenToShape)) {TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
285 | if (wasDirtyParentSceneTransform)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
286 | item->d_ptr->invalidateChildrenSceneTransform(); never executed: item->d_ptr->invalidateChildrenSceneTransform(); | 0 |
287 | return; never executed: return; | 0 |
288 | } | - |
289 | } never executed: end of block | 0 |
290 | | - |
291 | int i = 0; | - |
292 | if (itemHasChildren) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
293 | | - |
294 | item->d_ptr->ensureSortedChildren(); | - |
295 | | - |
296 | | - |
297 | if (itemClipsChildrenToShape && !itemIsUntransformable) {TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
298 | QPainterPath mappedShape = item->d_ptr->sceneTransformTranslateOnlyTRUE | never evaluated | FALSE | never evaluated |
| 0 |
299 | ? item->shape().translated(item->d_ptr->sceneTransform.dx(), | - |
300 | item->d_ptr->sceneTransform.dy()) | - |
301 | : item->d_ptr->sceneTransform.map(item->shape()); | - |
302 | exposeRect &= mappedShape.controlPointRect(); | - |
303 | } never executed: end of block | 0 |
304 | | - |
305 | | - |
306 | for (i = 0; i < item->d_ptr->children.size(); ++i) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
307 | QGraphicsItem *child = item->d_ptr->children.at(i); | - |
308 | if (wasDirtyParentSceneTransform)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
309 | child->d_ptr->dirtySceneTransform = 1; never executed: child->d_ptr->dirtySceneTransform = 1; | 0 |
310 | if (!(child->d_ptr->flags & QGraphicsItem::ItemStacksBehindParent))TRUE | never evaluated | FALSE | never evaluated |
| 0 |
311 | break; never executed: break; | 0 |
312 | if (itemIsFullyTransparent && !(child->d_ptr->flags & QGraphicsItem::ItemIgnoresParentOpacity))TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
313 | continue; never executed: continue; | 0 |
314 | recursive_items_helper(child, exposeRect, intersect, items, viewTransform, | - |
315 | mode, opacity, intersectData); | - |
316 | } never executed: end of block | 0 |
317 | } never executed: end of block | 0 |
318 | | - |
319 | | - |
320 | if (processItem)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
321 | items->append(item); never executed: items->append(item); | 0 |
322 | | - |
323 | | - |
324 | if (itemHasChildren) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
325 | for (; i < item->d_ptr->children.size(); ++i) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
326 | QGraphicsItem *child = item->d_ptr->children.at(i); | - |
327 | if (wasDirtyParentSceneTransform)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
328 | child->d_ptr->dirtySceneTransform = 1; never executed: child->d_ptr->dirtySceneTransform = 1; | 0 |
329 | if (itemIsFullyTransparent && !(child->d_ptr->flags & QGraphicsItem::ItemIgnoresParentOpacity))TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
330 | continue; never executed: continue; | 0 |
331 | recursive_items_helper(child, exposeRect, intersect, items, viewTransform, | - |
332 | mode, opacity, intersectData); | - |
333 | } never executed: end of block | 0 |
334 | } never executed: end of block | 0 |
335 | } never executed: end of block | 0 |
336 | | - |
337 | void QGraphicsSceneIndexPrivate::init() | - |
338 | { | - |
339 | if (!scene)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
340 | return; never executed: return; | 0 |
341 | | - |
342 | QObject::connect(scene, SIGNAL(sceneRectChanged(QRectF)), | - |
343 | q_func(), SLOT(updateSceneRect(QRectF))); | - |
344 | } never executed: end of block | 0 |
345 | | - |
346 | | - |
347 | | - |
348 | | - |
349 | QGraphicsSceneIndex::QGraphicsSceneIndex(QGraphicsScene *scene) | - |
350 | : QObject(*new QGraphicsSceneIndexPrivate(scene), scene) | - |
351 | { | - |
352 | d_func()->init(); | - |
353 | } never executed: end of block | 0 |
354 | | - |
355 | | - |
356 | | - |
357 | | - |
358 | QGraphicsSceneIndex::QGraphicsSceneIndex(QGraphicsSceneIndexPrivate &dd, QGraphicsScene *scene) | - |
359 | : QObject(dd, scene) | - |
360 | { | - |
361 | d_func()->init(); | - |
362 | } never executed: end of block | 0 |
363 | | - |
364 | | - |
365 | | - |
366 | | - |
367 | QGraphicsSceneIndex::~QGraphicsSceneIndex() | - |
368 | { | - |
369 | | - |
370 | } | - |
371 | | - |
372 | | - |
373 | | - |
374 | | - |
375 | QGraphicsScene* QGraphicsSceneIndex::scene() const | - |
376 | { | - |
377 | Q_D(const QGraphicsSceneIndex); | - |
378 | return d->scene; never executed: return d->scene; | 0 |
379 | } | - |
380 | | - |
381 | | - |
382 | | - |
383 | | - |
384 | | - |
385 | | - |
386 | | - |
387 | | - |
388 | | - |
389 | | - |
390 | | - |
391 | | - |
392 | | - |
393 | | - |
394 | | - |
395 | | - |
396 | | - |
397 | | - |
398 | | - |
399 | | - |
400 | | - |
401 | QList<QGraphicsItem *> QGraphicsSceneIndex::items(const QPointF &pos, Qt::ItemSelectionMode mode, | - |
402 | Qt::SortOrder order, const QTransform &deviceTransform) const | - |
403 | { | - |
404 | | - |
405 | Q_D(const QGraphicsSceneIndex); | - |
406 | QList<QGraphicsItem *> itemList; | - |
407 | d->items_helper(QRectF(pos, QSizeF(1, 1)), &QtPrivate::intersect_point, &itemList, deviceTransform, mode, order, &pos); | - |
408 | return itemList; never executed: return itemList; | 0 |
409 | } | - |
410 | | - |
411 | | - |
412 | | - |
413 | | - |
414 | | - |
415 | | - |
416 | | - |
417 | | - |
418 | | - |
419 | | - |
420 | | - |
421 | | - |
422 | | - |
423 | | - |
424 | | - |
425 | | - |
426 | | - |
427 | | - |
428 | | - |
429 | | - |
430 | | - |
431 | | - |
432 | | - |
433 | QList<QGraphicsItem *> QGraphicsSceneIndex::items(const QRectF &rect, Qt::ItemSelectionMode mode, | - |
434 | Qt::SortOrder order, const QTransform &deviceTransform) const | - |
435 | { | - |
436 | Q_D(const QGraphicsSceneIndex); | - |
437 | QRectF exposeRect = rect; | - |
438 | _q_adjustRect(&exposeRect); | - |
439 | QList<QGraphicsItem *> itemList; | - |
440 | d->items_helper(exposeRect, &QtPrivate::intersect_rect, &itemList, deviceTransform, mode, order, &rect); | - |
441 | return itemList; never executed: return itemList; | 0 |
442 | } | - |
443 | | - |
444 | | - |
445 | | - |
446 | | - |
447 | | - |
448 | | - |
449 | | - |
450 | | - |
451 | | - |
452 | | - |
453 | | - |
454 | | - |
455 | | - |
456 | | - |
457 | | - |
458 | | - |
459 | | - |
460 | | - |
461 | | - |
462 | | - |
463 | | - |
464 | | - |
465 | | - |
466 | QList<QGraphicsItem *> QGraphicsSceneIndex::items(const QPolygonF &polygon, Qt::ItemSelectionMode mode, | - |
467 | Qt::SortOrder order, const QTransform &deviceTransform) const | - |
468 | { | - |
469 | Q_D(const QGraphicsSceneIndex); | - |
470 | QList<QGraphicsItem *> itemList; | - |
471 | QRectF exposeRect = polygon.boundingRect(); | - |
472 | _q_adjustRect(&exposeRect); | - |
473 | QPainterPath path; | - |
474 | path.addPolygon(polygon); | - |
475 | d->items_helper(exposeRect, &QtPrivate::intersect_path, &itemList, deviceTransform, mode, order, &path); | - |
476 | return itemList; never executed: return itemList; | 0 |
477 | } | - |
478 | | - |
479 | | - |
480 | | - |
481 | | - |
482 | | - |
483 | | - |
484 | | - |
485 | | - |
486 | | - |
487 | | - |
488 | | - |
489 | | - |
490 | | - |
491 | | - |
492 | | - |
493 | | - |
494 | | - |
495 | | - |
496 | | - |
497 | | - |
498 | | - |
499 | | - |
500 | | - |
501 | QList<QGraphicsItem *> QGraphicsSceneIndex::items(const QPainterPath &path, Qt::ItemSelectionMode mode, | - |
502 | Qt::SortOrder order, const QTransform &deviceTransform) const | - |
503 | { | - |
504 | Q_D(const QGraphicsSceneIndex); | - |
505 | QList<QGraphicsItem *> itemList; | - |
506 | QRectF exposeRect = path.controlPointRect(); | - |
507 | _q_adjustRect(&exposeRect); | - |
508 | d->items_helper(exposeRect, &QtPrivate::intersect_path, &itemList, deviceTransform, mode, order, &path); | - |
509 | return itemList; never executed: return itemList; | 0 |
510 | } | - |
511 | | - |
512 | | - |
513 | | - |
514 | | - |
515 | | - |
516 | QList<QGraphicsItem *> QGraphicsSceneIndex::estimateItems(const QPointF &point, Qt::SortOrder order) const | - |
517 | { | - |
518 | return estimateItems(QRectF(point, QSize(1, 1)), order); never executed: return estimateItems(QRectF(point, QSize(1, 1)), order); | 0 |
519 | } | - |
520 | | - |
521 | QList<QGraphicsItem *> QGraphicsSceneIndex::estimateTopLevelItems(const QRectF &rect, Qt::SortOrder order) const | - |
522 | { | - |
523 | Q_D(const QGraphicsSceneIndex); | - |
524 | Q_UNUSED(rect); | - |
525 | QGraphicsScenePrivate *scened = d->scene->d_func(); | - |
526 | scened->ensureSortedTopLevelItems(); | - |
527 | if (order == Qt::DescendingOrder) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
528 | QList<QGraphicsItem *> sorted; | - |
529 | const int numTopLevelItems = scened->topLevelItems.size(); | - |
530 | sorted.reserve(numTopLevelItems); | - |
531 | for (int i = numTopLevelItems - 1; i >= 0; --i)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
532 | sorted << scened->topLevelItems.at(i); never executed: sorted << scened->topLevelItems.at(i); | 0 |
533 | return sorted; never executed: return sorted; | 0 |
534 | } | - |
535 | return scened->topLevelItems; never executed: return scened->topLevelItems; | 0 |
536 | } | - |
537 | | - |
538 | | - |
539 | | - |
540 | | - |
541 | | - |
542 | | - |
543 | | - |
544 | | - |
545 | | - |
546 | | - |
547 | | - |
548 | | - |
549 | | - |
550 | | - |
551 | | - |
552 | void QGraphicsSceneIndex::updateSceneRect(const QRectF &rect) | - |
553 | { | - |
554 | Q_UNUSED(rect); | - |
555 | } never executed: end of block | 0 |
556 | | - |
557 | | - |
558 | | - |
559 | | - |
560 | void QGraphicsSceneIndex::clear() | - |
561 | { | - |
562 | const QList<QGraphicsItem *> allItems = items(); | - |
563 | for (int i = 0 ; i < allItems.size(); ++i)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
564 | removeItem(allItems.at(i)); never executed: removeItem(allItems.at(i)); | 0 |
565 | } never executed: end of block | 0 |
566 | | - |
567 | | - |
568 | | - |
569 | | - |
570 | | - |
571 | | - |
572 | | - |
573 | | - |
574 | | - |
575 | | - |
576 | | - |
577 | | - |
578 | | - |
579 | | - |
580 | | - |
581 | | - |
582 | | - |
583 | | - |
584 | | - |
585 | | - |
586 | | - |
587 | | - |
588 | | - |
589 | | - |
590 | | - |
591 | | - |
592 | void QGraphicsSceneIndex::deleteItem(QGraphicsItem *item) | - |
593 | { | - |
594 | removeItem(item); | - |
595 | } never executed: end of block | 0 |
596 | | - |
597 | | - |
598 | | - |
599 | | - |
600 | | - |
601 | | - |
602 | | - |
603 | | - |
604 | | - |
605 | | - |
606 | | - |
607 | | - |
608 | | - |
609 | | - |
610 | void QGraphicsSceneIndex::itemChange(const QGraphicsItem *item, QGraphicsItem::GraphicsItemChange change, const void *const value) | - |
611 | { | - |
612 | Q_UNUSED(item); | - |
613 | Q_UNUSED(change); | - |
614 | Q_UNUSED(value); | - |
615 | } never executed: end of block | 0 |
616 | | - |
617 | | - |
618 | | - |
619 | | - |
620 | | - |
621 | | - |
622 | void QGraphicsSceneIndex::prepareBoundingRectChange(const QGraphicsItem *item) | - |
623 | { | - |
624 | Q_UNUSED(item); | - |
625 | } never executed: end of block | 0 |
626 | | - |
627 | QT_END_NAMESPACE | - |
628 | | - |
629 | #include "moc_qgraphicssceneindex_p.cpp" | - |
630 | | - |
631 | #endif // QT_NO_GRAPHICSVIEW | - |
| | |