qgraphicsitem.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/widgets/graphicsview/qgraphicsitem.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10static inline void _q_adjustRect(QRect *rect)-
11{-
12 ((!(rect)) ? qt_assert("rect",__FILE__,775) : qt_noop());-
13 if (!rect->width()
!rect->width()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
14 rect->adjust(0, 0, 1, 0);
never executed: rect->adjust(0, 0, 1, 0);
0
15 if (!rect->height()
!rect->height()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
16 rect->adjust(0, 0, 0, 1);
never executed: rect->adjust(0, 0, 0, 1);
0
17}
never executed: end of block
0
18-
19-
20-
21-
22class QGraphicsItemCustomDataStore-
23{-
24public:-
25 QHash<const QGraphicsItem *, QMap<int, QVariant> > data;-
26};-
27namespace { namespace Q_QGS_qt_dataStore { typedef QGraphicsItemCustomDataStore Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized
guard.load() =...c::InitializedDescription
TRUEnever evaluated
FALSEnever evaluated
) guard.store(QtGlobalStatic::Destroyed);
never executed: guard.store(QtGlobalStatic::Destroyed);
}
never executed: end of block
}; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; return
never executed: return &holder.value;
&holder.value;
never executed: return &holder.value;
} } } static QGlobalStatic<QGraphicsItemCustomDataStore, Q_QGS_qt_dataStore::innerFunction, Q_QGS_qt_dataStore::guard> qt_dataStore;
0
28-
29-
30-
31-
32-
33-
34-
35static QPainterPath qt_graphicsItem_shapeFromPath(const QPainterPath &path, const QPen &pen)-
36{-
37-
38-
39 const qreal penWidthZero = qreal(0.00000001);-
40-
41 if (path == QPainterPath()
path == QPainterPath()Description
TRUEnever evaluated
FALSEnever evaluated
|| pen == Qt::NoPen
pen == Qt::NoPenDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
42 return
never executed: return path;
path;
never executed: return path;
0
43 QPainterPathStroker ps;-
44 ps.setCapStyle(pen.capStyle());-
45 if (pen.widthF() <= 0.0
pen.widthF() <= 0.0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
46 ps.setWidth(penWidthZero);
never executed: ps.setWidth(penWidthZero);
0
47 else-
48 ps.setWidth(pen.widthF());
never executed: ps.setWidth(pen.widthF());
0
49 ps.setJoinStyle(pen.joinStyle());-
50 ps.setMiterLimit(pen.miterLimit());-
51 QPainterPath p = ps.createStroke(path);-
52 p.addPath(path);-
53 return
never executed: return p;
p;
never executed: return p;
0
54}-
55-
56-
57-
58-
59QGraphicsItemPrivate::QGraphicsItemPrivate()-
60 : z(0),-
61 opacity(1.),-
62 scene(nullptr),-
63 parent(nullptr),-
64 transformData(nullptr),-
65 graphicsEffect(nullptr),-
66 index(-1),-
67 siblingIndex(-1),-
68 itemDepth(-1),-
69 focusProxy(nullptr),-
70 subFocusItem(nullptr),-
71 focusScopeItem(nullptr),-
72 imHints(Qt::ImhNone),-
73 panelModality(QGraphicsItem::NonModal),-
74 acceptedMouseButtons(0x1f),-
75 visible(true),-
76 explicitlyHidden(false),-
77 enabled(true),-
78 explicitlyDisabled(false),-
79 selected(false),-
80 acceptsHover(false),-
81 acceptDrops(false),-
82 isMemberOfGroup(false),-
83 handlesChildEvents(false),-
84 itemDiscovered(false),-
85 hasCursor(false),-
86 ancestorFlags(0),-
87 cacheMode(0),-
88 hasBoundingRegionGranularity(false),-
89 isWidget(false),-
90 dirty(false),-
91 dirtyChildren(false),-
92 localCollisionHack(false),-
93 inSetPosHelper(false),-
94 needSortChildren(false),-
95 allChildrenDirty(false),-
96 fullUpdatePending(false),-
97 flags(0),-
98 paintedViewBoundingRectsNeedRepaint(false),-
99 dirtySceneTransform(true),-
100 geometryChanged(true),-
101 inDestructor(false),-
102 isObject(false),-
103 ignoreVisible(false),-
104 ignoreOpacity(false),-
105 acceptTouchEvents(false),-
106 acceptedTouchBeginEvent(false),-
107 filtersDescendantEvents(false),-
108 sceneTransformTranslateOnly(false),-
109 notifyBoundingRectChanged(false),-
110 notifyInvalidated(false),-
111 mouseSetsFocus(true),-
112 explicitActivate(false),-
113 wantsActive(false),-
114 holesInSiblingIndex(false),-
115 sequentialOrdering(true),-
116 updateDueToGraphicsEffect(false),-
117 scenePosDescendants(false),-
118 pendingPolish(false),-
119 mayHaveChildWithGraphicsEffect(false),-
120 isDeclarativeItem(false),-
121 sendParentChangeNotification(false),-
122 dirtyChildrenBoundingRect(true),-
123 globalStackingOrder(-1),-
124 q_ptr(nullptr)-
125{-
126}
never executed: end of block
0
127-
128-
129-
130-
131QGraphicsItemPrivate::~QGraphicsItemPrivate()-
132{-
133}-
134void QGraphicsItemPrivate::updateAncestorFlag(QGraphicsItem::GraphicsItemFlag childFlag,-
135 AncestorFlag flag, bool enabled, bool root)-
136{-
137 QGraphicsItem * const q = q_func();-
138 if (root
rootDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
139-
140-
141 switch (int(childFlag)) {-
142 case
never executed: case -2:
-2:
never executed: case -2:
0
143 flag = AncestorFiltersChildEvents;-
144 enabled = q->filtersChildEvents();-
145 break;
never executed: break;
0
146 case
never executed: case -1:
-1:
never executed: case -1:
0
147 flag = AncestorHandlesChildEvents;-
148 enabled = q->handlesChildEvents();-
149 break;
never executed: break;
0
150 case
never executed: case QGraphicsItem::ItemClipsChildrenToShape:
QGraphicsItem::ItemClipsChildrenToShape:
never executed: case QGraphicsItem::ItemClipsChildrenToShape:
0
151 flag = AncestorClipsChildren;-
152 enabled = flags & QGraphicsItem::ItemClipsChildrenToShape;-
153 break;
never executed: break;
0
154 case
never executed: case QGraphicsItem::ItemIgnoresTransformations:
QGraphicsItem::ItemIgnoresTransformations:
never executed: case QGraphicsItem::ItemIgnoresTransformations:
0
155 flag = AncestorIgnoresTransformations;-
156 enabled = flags & QGraphicsItem::ItemIgnoresTransformations;-
157 break;
never executed: break;
0
158 case
never executed: case QGraphicsItem::ItemContainsChildrenInShape:
QGraphicsItem::ItemContainsChildrenInShape:
never executed: case QGraphicsItem::ItemContainsChildrenInShape:
0
159 flag = AncestorContainsChildren;-
160 enabled = flags & QGraphicsItem::ItemContainsChildrenInShape;-
161 break;
never executed: break;
0
162 default
never executed: default:
:
never executed: default:
0
163 return;
never executed: return;
0
164 }-
165-
166 if (parent
parentDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
167-
168 if ((
(parent->d_ptr...rFlags & flag)Description
TRUEnever evaluated
FALSEnever evaluated
parent->d_ptr->ancestorFlags & flag)
(parent->d_ptr...rFlags & flag)Description
TRUEnever evaluated
FALSEnever evaluated
0
169 || (
(int(parent->d... == childFlag)Description
TRUEnever evaluated
FALSEnever evaluated
int(parent->d_ptr->flags & childFlag) == childFlag)
(int(parent->d... == childFlag)Description
TRUEnever evaluated
FALSEnever evaluated
0
170 || (int(childFlag) == -1
int(childFlag) == -1Description
TRUEnever evaluated
FALSEnever evaluated
&& parent->d_ptr->handlesChildEvents
parent->d_ptr-...lesChildEventsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
171 || (int(childFlag) == -2
int(childFlag) == -2Description
TRUEnever evaluated
FALSEnever evaluated
&& parent->d_ptr->filtersDescendantEvents
parent->d_ptr-...scendantEventsDescription
TRUEnever evaluated
FALSEnever evaluated
)) {
0
172 enabled = true;-
173 ancestorFlags |= flag;-
174 }
never executed: end of block
else {
0
175 ancestorFlags &= ~flag;-
176 }
never executed: end of block
0
177 } else {-
178-
179-
180 ancestorFlags = 0;-
181 }
never executed: end of block
0
182 } else {-
183-
184 if (((
(ancestorFlags & flag)Description
TRUEnever evaluated
FALSEnever evaluated
ancestorFlags & flag)
(ancestorFlags & flag)Description
TRUEnever evaluated
FALSEnever evaluated
&& enabled
enabledDescription
TRUEnever evaluated
FALSEnever evaluated
) || (!(ancestorFlags & flag)
!(ancestorFlags & flag)Description
TRUEnever evaluated
FALSEnever evaluated
&& !enabled
!enabledDescription
TRUEnever evaluated
FALSEnever evaluated
))
0
185 return;
never executed: return;
0
186-
187-
188 if (enabled
enabledDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
189 ancestorFlags |= flag;
never executed: ancestorFlags |= flag;
0
190 else-
191 ancestorFlags &= ~flag;
never executed: ancestorFlags &= ~flag;
0
192-
193-
194 if ((int(childFlag) != -1
int(childFlag) != -1Description
TRUEnever evaluated
FALSEnever evaluated
&& int(flags & childFlag) == childFlag
int(flags & ch...) == childFlagDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
195 || (int(childFlag) == -1
int(childFlag) == -1Description
TRUEnever evaluated
FALSEnever evaluated
&& handlesChildEvents
handlesChildEventsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
196 || (int(childFlag) == -2
int(childFlag) == -2Description
TRUEnever evaluated
FALSEnever evaluated
&& filtersDescendantEvents
filtersDescendantEventsDescription
TRUEnever evaluated
FALSEnever evaluated
))
0
197 return;
never executed: return;
0
198 }
never executed: end of block
0
199-
200 for (int i = 0; i < children.size()
i < children.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
201 children.at(i)->d_ptr->updateAncestorFlag(childFlag, flag, enabled, false);
never executed: children.at(i)->d_ptr->updateAncestorFlag(childFlag, flag, enabled, false);
0
202}
never executed: end of block
0
203-
204void QGraphicsItemPrivate::updateAncestorFlags()-
205{-
206 int flags = 0;-
207 if (parent
parentDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
208-
209 QGraphicsItemPrivate *pd = parent->d_ptr.data();-
210 flags = pd->ancestorFlags;-
211-
212-
213 if (pd->filtersDescendantEvents
pd->filtersDescendantEventsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
214 flags |= AncestorFiltersChildEvents;
never executed: flags |= AncestorFiltersChildEvents;
0
215 if (pd->handlesChildEvents
pd->handlesChildEventsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
216 flags |= AncestorHandlesChildEvents;
never executed: flags |= AncestorHandlesChildEvents;
0
217 if (pd->flags & QGraphicsItem::ItemClipsChildrenToShape
pd->flags & QG...hildrenToShapeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
218 flags |= AncestorClipsChildren;
never executed: flags |= AncestorClipsChildren;
0
219 if (pd->flags & QGraphicsItem::ItemIgnoresTransformations
pd->flags & QG...ransformationsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
220 flags |= AncestorIgnoresTransformations;
never executed: flags |= AncestorIgnoresTransformations;
0
221 if (pd->flags & QGraphicsItem::ItemContainsChildrenInShape
pd->flags & QG...hildrenInShapeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
222 flags |= AncestorContainsChildren;
never executed: flags |= AncestorContainsChildren;
0
223 }
never executed: end of block
0
224-
225 if (ancestorFlags == flags
ancestorFlags == flagsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
226 return;
never executed: return;
0
227 ancestorFlags = flags;-
228-
229-
230 for (int i = 0; i < children.size()
i < children.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
231 children.at(i)->d_ptr->updateAncestorFlags();
never executed: children.at(i)->d_ptr->updateAncestorFlags();
0
232}
never executed: end of block
0
233-
234-
235-
236-
237-
238-
239void QGraphicsItemPrivate::setIsMemberOfGroup(bool enabled)-
240{-
241 QGraphicsItem * const q = q_func();-
242 isMemberOfGroup = enabled;-
243 if (!qgraphicsitem_cast<QGraphicsItemGroup *>(q)
!qgraphicsitem...temGroup *>(q)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
244 for (QForeachContainer<typename QtPrivate::remove_reference<decltype(children)>::type> _container_((children)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QGraphicsItem *child = *_container_.i; _container_.control; _container_.control = 0)-
245 child->d_func()->setIsMemberOfGroup(enabled);
never executed: child->d_func()->setIsMemberOfGroup(enabled);
0
246 }
never executed: end of block
0
247}
never executed: end of block
0
248-
249-
250-
251-
252-
253-
254void QGraphicsItemPrivate::remapItemPos(QEvent *event, QGraphicsItem *item)-
255{-
256 QGraphicsItem * const q = q_func();-
257 switch (event->type()) {-
258 case
never executed: case QEvent::GraphicsSceneMouseMove:
QEvent::GraphicsSceneMouseMove:
never executed: case QEvent::GraphicsSceneMouseMove:
0
259 case
never executed: case QEvent::GraphicsSceneMousePress:
QEvent::GraphicsSceneMousePress:
never executed: case QEvent::GraphicsSceneMousePress:
0
260 case
never executed: case QEvent::GraphicsSceneMouseRelease:
QEvent::GraphicsSceneMouseRelease:
never executed: case QEvent::GraphicsSceneMouseRelease:
0
261 case
never executed: case QEvent::GraphicsSceneMouseDoubleClick:
QEvent::GraphicsSceneMouseDoubleClick:
never executed: case QEvent::GraphicsSceneMouseDoubleClick:
{
0
262 QGraphicsSceneMouseEvent *mouseEvent = static_cast<QGraphicsSceneMouseEvent *>(event);-
263 mouseEvent->setPos(item->mapFromItem(q, mouseEvent->pos()));-
264 mouseEvent->setLastPos(item->mapFromItem(q, mouseEvent->pos()));-
265 for (int i = 0x1; i <= 0x10
i <= 0x10Description
TRUEnever evaluated
FALSEnever evaluated
; i <<= 1) {
0
266 if (mouseEvent->buttons() & i
mouseEvent->buttons() & iDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
267 Qt::MouseButton button = Qt::MouseButton(i);-
268 mouseEvent->setButtonDownPos(button, item->mapFromItem(q, mouseEvent->buttonDownPos(button)));-
269 }
never executed: end of block
0
270 }
never executed: end of block
0
271 break;
never executed: break;
0
272 }-
273 case
never executed: case QEvent::GraphicsSceneWheel:
QEvent::GraphicsSceneWheel:
never executed: case QEvent::GraphicsSceneWheel:
{
0
274 QGraphicsSceneWheelEvent *wheelEvent = static_cast<QGraphicsSceneWheelEvent *>(event);-
275 wheelEvent->setPos(item->mapFromItem(q, wheelEvent->pos()));-
276 break;
never executed: break;
0
277 }-
278 case
never executed: case QEvent::GraphicsSceneContextMenu:
QEvent::GraphicsSceneContextMenu:
never executed: case QEvent::GraphicsSceneContextMenu:
{
0
279 QGraphicsSceneContextMenuEvent *contextEvent = static_cast<QGraphicsSceneContextMenuEvent *>(event);-
280 contextEvent->setPos(item->mapFromItem(q, contextEvent->pos()));-
281 break;
never executed: break;
0
282 }-
283 case
never executed: case QEvent::GraphicsSceneHoverMove:
QEvent::GraphicsSceneHoverMove:
never executed: case QEvent::GraphicsSceneHoverMove:
{
0
284 QGraphicsSceneHoverEvent *hoverEvent = static_cast<QGraphicsSceneHoverEvent *>(event);-
285 hoverEvent->setPos(item->mapFromItem(q, hoverEvent->pos()));-
286 break;
never executed: break;
0
287 }-
288 default
never executed: default:
:
never executed: default:
0
289 break;
never executed: break;
0
290 }-
291}-
292QPointF QGraphicsItemPrivate::genericMapFromScene(const QPointF &pos,-
293 const QWidget *viewport) const-
294{-
295 const QGraphicsItem * const q = q_func();-
296 if (!itemIsUntransformable()
!itemIsUntransformable()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
297 return
never executed: return q->mapFromScene(pos);
q->mapFromScene(pos);
never executed: return q->mapFromScene(pos);
0
298 QGraphicsView *view = 0;-
299 if (viewport
viewportDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
300 view = qobject_cast<QGraphicsView *>(viewport->parentWidget());
never executed: view = qobject_cast<QGraphicsView *>(viewport->parentWidget());
0
301 if (!view
!viewDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
302 return
never executed: return q->mapFromScene(pos);
q->mapFromScene(pos);
never executed: return q->mapFromScene(pos);
0
303-
304 return
never executed: return q->deviceTransform(view->viewportTransform()).inverted().map(view->mapFromScene(pos));
q->deviceTransform(view->viewportTransform()).inverted().map(view->mapFromScene(pos));
never executed: return q->deviceTransform(view->viewportTransform()).inverted().map(view->mapFromScene(pos));
0
305}-
306void QGraphicsItemPrivate::combineTransformToParent(QTransform *x, const QTransform *viewTransform) const-
307{-
308-
309 if (viewTransform
viewTransformDescription
TRUEnever evaluated
FALSEnever evaluated
&& itemIsUntransformable()
itemIsUntransformable()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
310 *x = q_ptr->deviceTransform(*viewTransform);-
311 }
never executed: end of block
else {
0
312 if (transformData
transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
313 *
never executed: *x *= transformData->computedFullTransform();
x *= transformData->computedFullTransform();
never executed: *x *= transformData->computedFullTransform();
0
314 if (!pos.isNull()
!pos.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
315 *
never executed: *x *= QTransform::fromTranslate(pos.x(), pos.y());
x *= QTransform::fromTranslate(pos.x(), pos.y());
never executed: *x *= QTransform::fromTranslate(pos.x(), pos.y());
0
316 }
never executed: end of block
0
317}-
318void QGraphicsItemPrivate::combineTransformFromParent(QTransform *x, const QTransform *viewTransform) const-
319{-
320-
321 if (viewTransform
viewTransformDescription
TRUEnever evaluated
FALSEnever evaluated
&& itemIsUntransformable()
itemIsUntransformable()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
322 *x = q_ptr->deviceTransform(*viewTransform);-
323 }
never executed: end of block
else {
0
324 x->translate(pos.x(), pos.y());-
325 if (transformData
transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
326 *
never executed: *x = transformData->computedFullTransform(x);
x = transformData->computedFullTransform(x);
never executed: *x = transformData->computedFullTransform(x);
0
327 }
never executed: end of block
0
328}-
329-
330void QGraphicsItemPrivate::updateSceneTransformFromParent()-
331{-
332 if (parent
parentDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
333 ((!(!parent->d_ptr->dirtySceneTransform)) ? qt_assert("!parent->d_ptr->dirtySceneTransform",__FILE__,1131) : qt_noop());-
334 if (parent->d_ptr->sceneTransformTranslateOnly
parent->d_ptr-...mTranslateOnlyDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
335 sceneTransform = QTransform::fromTranslate(parent->d_ptr->sceneTransform.dx() + pos.x(),-
336 parent->d_ptr->sceneTransform.dy() + pos.y());-
337 }
never executed: end of block
else {
0
338 sceneTransform = parent->d_ptr->sceneTransform;-
339 sceneTransform.translate(pos.x(), pos.y());-
340 }
never executed: end of block
0
341 if (transformData
transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
342 sceneTransform = transformData->computedFullTransform(&sceneTransform);-
343 sceneTransformTranslateOnly = (sceneTransform.type() <= QTransform::TxTranslate);-
344 }
never executed: end of block
else {
0
345 sceneTransformTranslateOnly = parent->d_ptr->sceneTransformTranslateOnly;-
346 }
never executed: end of block
0
347 } else if (!transformData
!transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
348 sceneTransform = QTransform::fromTranslate(pos.x(), pos.y());-
349 sceneTransformTranslateOnly = 1;-
350 }
never executed: end of block
else if (transformData->onlyTransform
transformData->onlyTransformDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
351 sceneTransform = transformData->transform;-
352 if (!pos.isNull()
!pos.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
353 sceneTransform *= QTransform::fromTranslate(pos.x(), pos.y());
never executed: sceneTransform *= QTransform::fromTranslate(pos.x(), pos.y());
0
354 sceneTransformTranslateOnly = (sceneTransform.type() <= QTransform::TxTranslate);-
355 }
never executed: end of block
else if (pos.isNull()
pos.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
356 sceneTransform = transformData->computedFullTransform();-
357 sceneTransformTranslateOnly = (sceneTransform.type() <= QTransform::TxTranslate);-
358 }
never executed: end of block
else {
0
359 sceneTransform = QTransform::fromTranslate(pos.x(), pos.y());-
360 sceneTransform = transformData->computedFullTransform(&sceneTransform);-
361 sceneTransformTranslateOnly = (sceneTransform.type() <= QTransform::TxTranslate);-
362 }
never executed: end of block
0
363 dirtySceneTransform = 0;-
364}
never executed: end of block
0
365void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent, const QVariant *newParentVariant,-
366 const QVariant *thisPointerVariant)-
367{-
368 QGraphicsItem * const q = q_func();-
369 if (newParent == parent
newParent == parentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
370 return;
never executed: return;
0
371-
372 if (isWidget
isWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
373 static_cast<
never executed: static_cast<QGraphicsWidgetPrivate *>(this)->fixFocusChainBeforeReparenting((newParent && newParent->isWidget()) ? static_cast<QGraphicsWidget *>(newParent) : 0, scene);
QGraphicsWidgetPrivate *>(this)->fixFocusChainBeforeReparenting((newParent &&
never executed: static_cast<QGraphicsWidgetPrivate *>(this)->fixFocusChainBeforeReparenting((newParent && newParent->isWidget()) ? static_cast<QGraphicsWidget *>(newParent) : 0, scene);
0
374 newParent->isWidget()) ? static_cast<QGraphicsWidget *>(newParent) : 0,
never executed: static_cast<QGraphicsWidgetPrivate *>(this)->fixFocusChainBeforeReparenting((newParent && newParent->isWidget()) ? static_cast<QGraphicsWidget *>(newParent) : 0, scene);
0
375 scene);
never executed: static_cast<QGraphicsWidgetPrivate *>(this)->fixFocusChainBeforeReparenting((newParent && newParent->isWidget()) ? static_cast<QGraphicsWidget *>(newParent) : 0, scene);
0
376 if (scene
sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
377-
378 if (scene->d_func()->indexMethod != QGraphicsScene::NoIndex
scene->d_func(...Scene::NoIndexDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
379 scene->d_func()->index->itemChange(q, QGraphicsItem::ItemParentChange, newParent);
never executed: scene->d_func()->index->itemChange(q, QGraphicsItem::ItemParentChange, newParent);
0
380-
381-
382 if (scenePosDescendants
scenePosDescendantsDescription
TRUEnever evaluated
FALSEnever evaluated
|| (
(flags & QGrap...sitionChanges)Description
TRUEnever evaluated
FALSEnever evaluated
flags & QGraphicsItem::ItemSendsScenePositionChanges)
(flags & QGrap...sitionChanges)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
383 scene->d_func()->setScenePosItemEnabled(q, false);
never executed: scene->d_func()->setScenePosItemEnabled(q, false);
0
384 }
never executed: end of block
0
385-
386 if (subFocusItem
subFocusItemDescription
TRUEnever evaluated
FALSEnever evaluated
&& parent
parentDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
387-
388 subFocusItem->d_ptr->clearSubFocus(parent);-
389 }
never executed: end of block
0
390-
391-
392-
393-
394 if (!inDestructor
!inDestructorDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
395 q_ptr->prepareGeometryChange();
never executed: q_ptr->prepareGeometryChange();
0
396-
397 if (parent
parentDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
398-
399 parent->d_ptr->removeChild(q);-
400 if (thisPointerVariant
thisPointerVariantDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
401 parent->itemChange(QGraphicsItem::ItemChildRemovedChange, *thisPointerVariant);
never executed: parent->itemChange(QGraphicsItem::ItemChildRemovedChange, *thisPointerVariant);
0
402 }
never executed: end of block
0
403-
404-
405-
406 if (scene
sceneDescription
TRUEnever evaluated
FALSEnever evaluated
&& !inDestructor
!inDestructorDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
407 if (parent
parentDescription
TRUEnever evaluated
FALSEnever evaluated
&& !newParent
!newParentDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
408 scene->d_func()->registerTopLevelItem(q);-
409 }
never executed: end of block
else if (!parent
!parentDescription
TRUEnever evaluated
FALSEnever evaluated
&& newParent
newParentDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
410 scene->d_func()->unregisterTopLevelItem(q);-
411 }
never executed: end of block
0
412 }
never executed: end of block
0
413-
414-
415-
416 QGraphicsItem *p = parent;-
417 QGraphicsItem *parentFocusScopeItem = 0;-
418 while (p
pDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
419 if (p->d_ptr->flags & QGraphicsItem::ItemIsFocusScope
p->d_ptr->flag...emIsFocusScopeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
420-
421-
422 QGraphicsItem *fsi = p->d_ptr->focusScopeItem;-
423 if (q_ptr == fsi
q_ptr == fsiDescription
TRUEnever evaluated
FALSEnever evaluated
|| q_ptr->isAncestorOf(fsi)
q_ptr->isAncestorOf(fsi)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
424 parentFocusScopeItem = fsi;-
425 p->d_ptr->focusScopeItem = 0;-
426 fsi->d_ptr->focusScopeItemChange(false);-
427 }
never executed: end of block
0
428 break;
never executed: break;
0
429 }-
430 p = p->d_ptr->parent;-
431 }
never executed: end of block
0
432-
433-
434 if (newParent
newParentDescription
TRUEnever evaluated
FALSEnever evaluated
&& (graphicsEffect
graphicsEffectDescription
TRUEnever evaluated
FALSEnever evaluated
|| mayHaveChildWithGraphicsEffect
mayHaveChildWithGraphicsEffectDescription
TRUEnever evaluated
FALSEnever evaluated
))
0
435 newParent->d_ptr->updateChildWithGraphicsEffectFlagRecursively();
never executed: newParent->d_ptr->updateChildWithGraphicsEffectFlagRecursively();
0
436-
437-
438 QGraphicsItem *newFocusScopeItem = subFocusItem
subFocusItemDescription
TRUEnever evaluated
FALSEnever evaluated
? subFocusItem : parentFocusScopeItem;
0
439 if (newFocusScopeItem
newFocusScopeItemDescription
TRUEnever evaluated
FALSEnever evaluated
&& newParent
newParentDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
440 QGraphicsItem *p = newParent;-
441 while (p
pDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
442 if (p->d_ptr->flags & QGraphicsItem::ItemIsFocusScope
p->d_ptr->flag...emIsFocusScopeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
443 if (subFocusItem
subFocusItemDescription
TRUEnever evaluated
FALSEnever evaluated
&& subFocusItem != q_ptr
subFocusItem != q_ptrDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
444-
445 QGraphicsItem *ancestorScope = 0;-
446 QGraphicsItem *p2 = subFocusItem->d_ptr->parent;-
447 while (p2
p2Description
TRUEnever evaluated
FALSEnever evaluated
&& p2 != p
p2 != pDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
448 if (p2->d_ptr->flags & QGraphicsItem::ItemIsFocusScope
p2->d_ptr->fla...emIsFocusScopeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
449 ancestorScope = p2;
never executed: ancestorScope = p2;
0
450 if (p2->d_ptr->flags & QGraphicsItem::ItemIsPanel
p2->d_ptr->fla...m::ItemIsPanelDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
451 break;
never executed: break;
0
452 if (p2 == q_ptr
p2 == q_ptrDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
453 break;
never executed: break;
0
454 p2 = p2->d_ptr->parent;-
455 }
never executed: end of block
0
456 if (ancestorScope
ancestorScopeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
457 newFocusScopeItem = ancestorScope;
never executed: newFocusScopeItem = ancestorScope;
0
458 }
never executed: end of block
0
459-
460 p->d_ptr->focusScopeItem = newFocusScopeItem;-
461 newFocusScopeItem->d_ptr->focusScopeItemChange(true);-
462-
463-
464-
465 if (subFocusItem
subFocusItemDescription
TRUEnever evaluated
FALSEnever evaluated
&& !p->focusItem()
!p->focusItem()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
466 subFocusItem->d_ptr->clearSubFocus();
never executed: subFocusItem->d_ptr->clearSubFocus();
0
467 break;
never executed: break;
0
468 }-
469 p = p->d_ptr->parent;-
470 }
never executed: end of block
0
471 }
never executed: end of block
0
472-
473-
474 invalidateDepthRecursively();-
475-
476 if ((
(parent = newParent)Description
TRUEnever evaluated
FALSEnever evaluated
parent = newParent)
(parent = newParent)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
477 if (parent->d_func()->scene
parent->d_func()->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
&& parent->d_func()->scene != scene
parent->d_func...scene != sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
478-
479 parent->d_func()->scene->addItem(q);-
480 }
never executed: end of block
else if (!parent->d_func()->scene
!parent->d_func()->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
&& scene
sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
481-
482 scene->removeItem(q);-
483 }
never executed: end of block
0
484-
485 parent->d_ptr->addChild(q);-
486 if (thisPointerVariant
thisPointerVariantDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
487 parent->itemChange(QGraphicsItem::ItemChildAddedChange, *thisPointerVariant);
never executed: parent->itemChange(QGraphicsItem::ItemChildAddedChange, *thisPointerVariant);
0
488 if (scene
sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
489-
490 if (scenePosDescendants
scenePosDescendantsDescription
TRUEnever evaluated
FALSEnever evaluated
|| (
(flags & QGrap...sitionChanges)Description
TRUEnever evaluated
FALSEnever evaluated
flags & QGraphicsItem::ItemSendsScenePositionChanges)
(flags & QGrap...sitionChanges)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
491 scene->d_func()->setScenePosItemEnabled(q, true);
never executed: scene->d_func()->setScenePosItemEnabled(q, true);
0
492 }
never executed: end of block
0
493-
494-
495 markParentDirty( true);-
496-
497-
498 updateAncestorFlags();-
499-
500-
501 if (parent->d_ptr->visible != visible
parent->d_ptr-...ble != visibleDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
502 if (!parent->d_ptr->visible
!parent->d_ptr->visibleDescription
TRUEnever evaluated
FALSEnever evaluated
|| !explicitlyHidden
!explicitlyHiddenDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
503 setVisibleHelper(parent->d_ptr->visible, false, false);
never executed: setVisibleHelper(parent->d_ptr->visible, false, false);
0
504 }
never executed: end of block
0
505 if (parent->isEnabled() != enabled
parent->isEnabled() != enabledDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
506 if (!parent->d_ptr->enabled
!parent->d_ptr->enabledDescription
TRUEnever evaluated
FALSEnever evaluated
|| !explicitlyDisabled
!explicitlyDisabledDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
507 setEnabledHelper(parent->d_ptr->enabled, false, false);
never executed: setEnabledHelper(parent->d_ptr->enabled, false, false);
0
508 }
never executed: end of block
0
509-
510-
511 if (visible
visibleDescription
TRUEnever evaluated
FALSEnever evaluated
&& parent->isActive()
parent->isActive()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
512 q->setActive(true);
never executed: q->setActive(true);
0
513 }
never executed: end of block
else {
0
514-
515 updateAncestorFlags();-
516-
517 if (!inDestructor
!inDestructorDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
518-
519 if (!visible
!visibleDescription
TRUEnever evaluated
FALSEnever evaluated
&& !explicitlyHidden
!explicitlyHiddenDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
520 setVisibleHelper(true, false);
never executed: setVisibleHelper(true, false);
0
521 if (!enabled
!enabledDescription
TRUEnever evaluated
FALSEnever evaluated
&& !explicitlyDisabled
!explicitlyDisabledDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
522 setEnabledHelper(true, false);
never executed: setEnabledHelper(true, false);
0
523 }
never executed: end of block
0
524 }
never executed: end of block
0
525-
526 dirtySceneTransform = 1;-
527 if (!inDestructor
!inDestructorDescription
TRUEnever evaluated
FALSEnever evaluated
&& (transformData
transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
|| (newParent
newParentDescription
TRUEnever evaluated
FALSEnever evaluated
&& newParent->d_ptr->transformData
newParent->d_p...>transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
)))
0
528 transformChanged();
never executed: transformChanged();
0
529-
530-
531 if (subFocusItem
subFocusItemDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
532 subFocusItem->d_ptr->setSubFocus(newParent);-
533 if (parent
parentDescription
TRUEnever evaluated
FALSEnever evaluated
&& parent->isActive()
parent->isActive()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
534 subFocusItem->setFocus();
never executed: subFocusItem->setFocus();
0
535 }
never executed: end of block
0
536-
537-
538 if (newParentVariant
newParentVariantDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
539 q->itemChange(QGraphicsItem::ItemParentHasChanged, *newParentVariant);
never executed: q->itemChange(QGraphicsItem::ItemParentHasChanged, *newParentVariant);
0
540-
541 if (isObject
isObjectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
542 static_cast<
never executed: static_cast<QGraphicsObject *>(q)->parentChanged();
QGraphicsObject *>(q)->parentChanged();
never executed: static_cast<QGraphicsObject *>(q)->parentChanged();
0
543}
never executed: end of block
0
544-
545-
546-
547-
548-
549-
550void QGraphicsItemPrivate::childrenBoundingRectHelper(QTransform *x, QRectF *rect, QGraphicsItem *topMostEffectItem)-
551{-
552 QGraphicsItem * const q = q_func();-
553-
554 QRectF childrenRect;-
555 QRectF *result = rect;-
556 rect = &childrenRect;-
557 const bool setTopMostEffectItem = !topMostEffectItem;-
558-
559 for (int i = 0; i < children.size()
i < children.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
560 QGraphicsItem *child = children.at(i);-
561 QGraphicsItemPrivate *childd = child->d_ptr.data();-
562 if (setTopMostEffectItem
setTopMostEffectItemDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
563 topMostEffectItem = child;
never executed: topMostEffectItem = child;
0
564 bool hasPos = !childd->pos.isNull();-
565 if (hasPos
hasPosDescription
TRUEnever evaluated
FALSEnever evaluated
|| childd->transformData
childd->transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
566-
567 QTransform matrix = childd->transformToParent();-
568 if (x
xDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
569 matrix *= *x;
never executed: matrix *= *x;
0
570 *rect |= matrix.mapRect(child->d_ptr->effectiveBoundingRect(topMostEffectItem));-
571 if (!childd->children.isEmpty()
!childd->children.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
572 childd->childrenBoundingRectHelper(&matrix, rect, topMostEffectItem);
never executed: childd->childrenBoundingRectHelper(&matrix, rect, topMostEffectItem);
0
573 }
never executed: end of block
else {
0
574 if (x
xDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
575 *
never executed: *rect |= x->mapRect(child->d_ptr->effectiveBoundingRect(topMostEffectItem));
rect |= x->mapRect(child->d_ptr->effectiveBoundingRect(topMostEffectItem));
never executed: *rect |= x->mapRect(child->d_ptr->effectiveBoundingRect(topMostEffectItem));
0
576 else-
577 *
never executed: *rect |= child->d_ptr->effectiveBoundingRect(topMostEffectItem);
rect |= child->d_ptr->effectiveBoundingRect(topMostEffectItem);
never executed: *rect |= child->d_ptr->effectiveBoundingRect(topMostEffectItem);
0
578 if (!childd->children.isEmpty()
!childd->children.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
579 childd->childrenBoundingRectHelper(x, rect, topMostEffectItem);
never executed: childd->childrenBoundingRectHelper(x, rect, topMostEffectItem);
0
580 }
never executed: end of block
0
581 }-
582-
583 if (flags & QGraphicsItem::ItemClipsChildrenToShape
flags & QGraph...hildrenToShapeDescription
TRUEnever evaluated
FALSEnever evaluated
){
0
584 if (x
xDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
585 *
never executed: *rect &= x->mapRect(q->boundingRect());
rect &= x->mapRect(q->boundingRect());
never executed: *rect &= x->mapRect(q->boundingRect());
0
586 else-
587 *
never executed: *rect &= q->boundingRect();
rect &= q->boundingRect();
never executed: *rect &= q->boundingRect();
0
588 }-
589-
590 *result |= *rect;-
591}
never executed: end of block
0
592-
593void QGraphicsItemPrivate::initStyleOption(QStyleOptionGraphicsItem *option, const QTransform &worldTransform,-
594 const QRegion &exposedRegion, bool allItems) const-
595{-
596 ((!(option)) ? qt_assert("option",__FILE__,1402) : qt_noop());-
597 const QGraphicsItem * const q = q_func();-
598-
599-
600 const QRectF brect = q->boundingRect();-
601 option->state = QStyle::State_None;-
602 option->rect = brect.toRect();-
603 option->levelOfDetail = 1;-
604 option->exposedRect = brect;-
605-
606-
607-
608-
609 option->styleObject = q_ptr->toGraphicsObject();-
610 if (!option->styleObject
!option->styleObjectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
611 option->styleObject = scene;
never executed: option->styleObject = scene;
0
612-
613 if (selected
selectedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
614 option->state |= QStyle::State_Selected;
never executed: option->state |= QStyle::State_Selected;
0
615 if (enabled
enabledDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
616 option->state |= QStyle::State_Enabled;
never executed: option->state |= QStyle::State_Enabled;
0
617 if (q->hasFocus()
q->hasFocus()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
618 option->state |= QStyle::State_HasFocus;
never executed: option->state |= QStyle::State_HasFocus;
0
619 if (scene
sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
620 if (scene->d_func()->hoverItems.contains(q_ptr)
scene->d_func(...ontains(q_ptr)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
621 option->state |= QStyle::State_MouseOver;
never executed: option->state |= QStyle::State_MouseOver;
0
622 if (q == scene->mouseGrabberItem()
q == scene->mouseGrabberItem()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
623 option->state |= QStyle::State_Sunken;
never executed: option->state |= QStyle::State_Sunken;
0
624 }
never executed: end of block
0
625-
626 if (!(flags & QGraphicsItem::ItemUsesExtendedStyleOption)
!(flags & QGra...edStyleOption)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
627 return;
never executed: return;
0
628-
629-
630 option->matrix = worldTransform.toAffine();-
631-
632 if (!allItems
!allItemsDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
633-
634 option->exposedRect = QRectF();-
635 const QTransform reverseMap = worldTransform.inverted();-
636 const QVector<QRect> exposedRects(exposedRegion.rects());-
637 for (int i = 0; i < exposedRects.size()
i < exposedRects.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
638 option->exposedRect |= reverseMap.mapRect(QRectF(exposedRects.at(i)));-
639 if (option->exposedRect.contains(brect)
option->expose...ontains(brect)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
640 break;
never executed: break;
0
641 }
never executed: end of block
0
642 option->exposedRect &= brect;-
643 }
never executed: end of block
0
644}
never executed: end of block
0
645-
646-
647-
648-
649-
650-
651void QGraphicsItemCache::purge()-
652{-
653 QPixmapCache::remove(key);-
654 key = QPixmapCache::Key();-
655 const auto &constDeviceData = deviceData;-
656 for (const auto &data : constDeviceData)-
657 QPixmapCache::remove(data.key);
never executed: QPixmapCache::remove(data.key);
0
658 deviceData.clear();-
659 allExposed = true;-
660 exposed.clear();-
661}
never executed: end of block
0
662QGraphicsItem::QGraphicsItem(QGraphicsItem *parent)-
663 : d_ptr(new QGraphicsItemPrivate)-
664{-
665 d_ptr->q_ptr = this;-
666 setParentItem(parent);-
667}
never executed: end of block
0
668-
669-
670-
671-
672QGraphicsItem::QGraphicsItem(QGraphicsItemPrivate &dd, QGraphicsItem *parent)-
673 : d_ptr(&dd)-
674{-
675 d_ptr->q_ptr = this;-
676 setParentItem(parent);-
677}
never executed: end of block
0
678QGraphicsItem::~QGraphicsItem()-
679{-
680 if (d_ptr->isObject
d_ptr->isObjectDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
681 QGraphicsObject *o = static_cast<QGraphicsObject *>(this);-
682 QObjectPrivate *p = QObjectPrivate::get(o);-
683 p->wasDeleted = true;-
684 if (p->declarativeData
p->declarativeDataDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
685 if (static_cast<
static_cast<QA...)->ownedByQml1Description
TRUEnever evaluated
FALSEnever evaluated
QAbstractDeclarativeDataImpl*>(p->declarativeData)->ownedByQml1
static_cast<QA...)->ownedByQml1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
686 if (QAbstractDeclarativeData::destroyed_qml1
QAbstractDecla...destroyed_qml1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
687 QAbstractDeclarativeData::destroyed_qml1(p->declarativeData, o);
never executed: QAbstractDeclarativeData::destroyed_qml1(p->declarativeData, o);
0
688 }
never executed: end of block
else {
0
689 if (QAbstractDeclarativeData::destroyed
QAbstractDecla...ata::destroyedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
690 QAbstractDeclarativeData::destroyed(p->declarativeData, o);
never executed: QAbstractDeclarativeData::destroyed(p->declarativeData, o);
0
691 }
never executed: end of block
0
692 p->declarativeData = 0;-
693 }
never executed: end of block
0
694 }
never executed: end of block
0
695-
696 d_ptr->inDestructor = 1;-
697 d_ptr->removeExtraItemCache();-
698-
699-
700 if (d_ptr->isObject
d_ptr->isObjectDescription
TRUEnever evaluated
FALSEnever evaluated
&& !d_ptr->gestureContext.isEmpty()
!d_ptr->gestur...text.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
701 QGraphicsObject *o = static_cast<QGraphicsObject *>(this);-
702 if (QGestureManager *manager = QGestureManager::instance()
QGestureManage...er::instance()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
703 const auto types = d_ptr->gestureContext.keys();-
704 for (Qt::GestureType type : types)-
705 manager->cleanupCachedGestures(o, type);
never executed: manager->cleanupCachedGestures(o, type);
0
706 }
never executed: end of block
0
707 }
never executed: end of block
0
708-
709-
710 clearFocus();-
711 setFocusProxy(0);-
712-
713-
714 QGraphicsItem *p = d_ptr->parent;-
715 while (p
pDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
716 if (p->flags() & ItemIsFocusScope
p->flags() & ItemIsFocusScopeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
717 if (p->d_ptr->focusScopeItem == this
p->d_ptr->focu...peItem == thisDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
718 p->d_ptr->focusScopeItem = 0;
never executed: p->d_ptr->focusScopeItem = 0;
0
719 break;
never executed: break;
0
720 }-
721 p = p->d_ptr->parent;-
722 }
never executed: end of block
0
723-
724 if (!d_ptr->children.isEmpty()
!d_ptr->children.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
725 while (!d_ptr->children.isEmpty()
!d_ptr->children.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
726 delete d_ptr->children.first();
never executed: delete d_ptr->children.first();
0
727 ((!(d_ptr->children.isEmpty())) ? qt_assert("d_ptr->children.isEmpty()",__FILE__,1552) : qt_noop());-
728 }
never executed: end of block
0
729-
730 if (d_ptr->scene
d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
731 d_ptr->scene->d_func()->removeItemHelper(this);-
732 }
never executed: end of block
else {
0
733 d_ptr->resetFocusProxy();-
734 setParentItem(0);-
735 }
never executed: end of block
0
736-
737-
738 delete d_ptr->graphicsEffect;-
739-
740 if (d_ptr->transformData
d_ptr->transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
741 for(int i = 0; i < d_ptr->transformData->graphicsTransforms.size()
i < d_ptr->tra...nsforms.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
742 QGraphicsTransform *t = d_ptr->transformData->graphicsTransforms.at(i);-
743 static_cast<QGraphicsTransformPrivate *>(t->d_ptr.data())->item = 0;-
744 delete t;-
745 }
never executed: end of block
0
746 }
never executed: end of block
0
747 delete d_ptr->transformData;-
748-
749 if (QGraphicsItemCustomDataStore *dataStore = qt_dataStore()
QGraphicsItemC...qt_dataStore()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
750 dataStore->data.remove(this);
never executed: dataStore->data.remove(this);
0
751}
never executed: end of block
0
752-
753-
754-
755-
756-
757-
758-
759QGraphicsScene *QGraphicsItem::scene() const-
760{-
761 return
never executed: return d_ptr->scene;
d_ptr->scene;
never executed: return d_ptr->scene;
0
762}-
763-
764-
765-
766-
767-
768-
769-
770QGraphicsItemGroup *QGraphicsItem::group() const-
771{-
772 if (!d_ptr->isMemberOfGroup
!d_ptr->isMemberOfGroupDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
773 return
never executed: return 0;
0;
never executed: return 0;
0
774 QGraphicsItem *parent = const_cast<QGraphicsItem *>(this);-
775 while ((
(parent = pare...d_ptr->parent)Description
TRUEnever evaluated
FALSEnever evaluated
parent = parent->d_ptr->parent)
(parent = pare...d_ptr->parent)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
776 if (QGraphicsItemGroup *group = qgraphicsitem_cast<QGraphicsItemGroup *>(parent)
QGraphicsItemG...oup *>(parent)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
777 return
never executed: return group;
group;
never executed: return group;
0
778 }
never executed: end of block
0
779-
780-
781 return
never executed: return 0;
0;
never executed: return 0;
0
782}-
783void QGraphicsItem::setGroup(QGraphicsItemGroup *group)-
784{-
785 if (!group
!groupDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
786 if (QGraphicsItemGroup *group = this->group()
QGraphicsItemG... this->group()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
787 group->removeFromGroup(this);
never executed: group->removeFromGroup(this);
0
788 }
never executed: end of block
else {
0
789 group->addToGroup(this);-
790 }
never executed: end of block
0
791}-
792-
793-
794-
795-
796-
797-
798-
799QGraphicsItem *QGraphicsItem::parentItem() const-
800{-
801 return
never executed: return d_ptr->parent;
d_ptr->parent;
never executed: return d_ptr->parent;
0
802}-
803QGraphicsItem *QGraphicsItem::topLevelItem() const-
804{-
805 QGraphicsItem *parent = const_cast<QGraphicsItem *>(this);-
806 while (QGraphicsItem *grandPa = parent->parentItem()
QGraphicsItem ...->parentItem()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
807 parent = grandPa;
never executed: parent = grandPa;
0
808 return
never executed: return parent;
parent;
never executed: return parent;
0
809}-
810QGraphicsObject *QGraphicsItem::parentObject() const-
811{-
812 QGraphicsItem *p = d_ptr->parent;-
813 return
never executed: return (p && p->d_ptr->isObject) ? static_cast<QGraphicsObject *>(p) : 0;
(p && p->d_ptr->isObject) ? static_cast<QGraphicsObject *>(p) : 0;
never executed: return (p && p->d_ptr->isObject) ? static_cast<QGraphicsObject *>(p) : 0;
0
814}-
815QGraphicsWidget *QGraphicsItem::parentWidget() const-
816{-
817 QGraphicsItem *p = parentItem();-
818 while (p
pDescription
TRUEnever evaluated
FALSEnever evaluated
&& !p->isWidget()
!p->isWidget()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
819 p = p->parentItem();
never executed: p = p->parentItem();
0
820 return
never executed: return (p && p->isWidget()) ? static_cast<QGraphicsWidget *>(p) : 0;
(p && p->isWidget()) ? static_cast<QGraphicsWidget *>(p) : 0;
never executed: return (p && p->isWidget()) ? static_cast<QGraphicsWidget *>(p) : 0;
0
821}-
822QGraphicsWidget *QGraphicsItem::topLevelWidget() const-
823{-
824 if (const
const QGraphic...parentWidget()Description
TRUEnever evaluated
FALSEnever evaluated
QGraphicsWidget *p = parentWidget()
const QGraphic...parentWidget()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
825 return
never executed: return p->topLevelWidget();
p->topLevelWidget();
never executed: return p->topLevelWidget();
0
826 return
never executed: return isWidget() ? static_cast<QGraphicsWidget *>(const_cast<QGraphicsItem *>(this)) : 0;
isWidget() ? static_cast<QGraphicsWidget *>(const_cast<QGraphicsItem *>(this)) : 0;
never executed: return isWidget() ? static_cast<QGraphicsWidget *>(const_cast<QGraphicsItem *>(this)) : 0;
0
827}-
828QGraphicsWidget *QGraphicsItem::window() const-
829{-
830 QGraphicsItem *p = panel();-
831 if (p
pDescription
TRUEnever evaluated
FALSEnever evaluated
&& p->isWindow()
p->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
832 return
never executed: return static_cast<QGraphicsWidget *>(p);
static_cast<QGraphicsWidget *>(p);
never executed: return static_cast<QGraphicsWidget *>(p);
0
833 return
never executed: return 0;
0;
never executed: return 0;
0
834}-
835QGraphicsItem *QGraphicsItem::panel() const-
836{-
837 if (d_ptr->flags & ItemIsPanel
d_ptr->flags & ItemIsPanelDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
838 return
never executed: return const_cast<QGraphicsItem *>(this);
const_cast<QGraphicsItem *>(this);
never executed: return const_cast<QGraphicsItem *>(this);
0
839 return
never executed: return d_ptr->parent ? d_ptr->parent->panel() : 0;
d_ptr->parent ? d_ptr->parent->panel() : 0;
never executed: return d_ptr->parent ? d_ptr->parent->panel() : 0;
0
840}-
841-
842-
843-
844-
845-
846-
847-
848QGraphicsObject *QGraphicsItem::toGraphicsObject()-
849{-
850 return
never executed: return d_ptr->isObject ? static_cast<QGraphicsObject *>(this) : 0;
d_ptr->isObject ? static_cast<QGraphicsObject *>(this) : 0;
never executed: return d_ptr->isObject ? static_cast<QGraphicsObject *>(this) : 0;
0
851}-
852-
853-
854-
855-
856-
857-
858-
859const QGraphicsObject *QGraphicsItem::toGraphicsObject() const-
860{-
861 return
never executed: return d_ptr->isObject ? static_cast<const QGraphicsObject *>(this) : 0;
d_ptr->isObject ? static_cast<const QGraphicsObject *>(this) : 0;
never executed: return d_ptr->isObject ? static_cast<const QGraphicsObject *>(this) : 0;
0
862}-
863void QGraphicsItem::setParentItem(QGraphicsItem *newParent)-
864{-
865 if (newParent == this
newParent == thisDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
866 QMessageLogger(__FILE__, 1769, __PRETTY_FUNCTION__).warning("QGraphicsItem::setParentItem: cannot assign %p as a parent of itself", this);-
867 return;
never executed: return;
0
868 }-
869 if (newParent == d_ptr->parent
newParent == d_ptr->parentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
870 return;
never executed: return;
0
871-
872 const QVariant newParentVariant(itemChange(QGraphicsItem::ItemParentChange,-
873 QVariant::fromValue<QGraphicsItem *>(newParent)));-
874 newParent = qvariant_cast<QGraphicsItem *>(newParentVariant);-
875 if (newParent == d_ptr->parent
newParent == d_ptr->parentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
876 return;
never executed: return;
0
877-
878 const QVariant thisPointerVariant(QVariant::fromValue<QGraphicsItem *>(this));-
879 d_ptr->setParentItemHelper(newParent, &newParentVariant, &thisPointerVariant);-
880}
never executed: end of block
0
881QList<QGraphicsItem *> QGraphicsItem::childItems() const-
882{-
883 const_cast<QGraphicsItem *>(this)->d_ptr->ensureSortedChildren();-
884 return
never executed: return d_ptr->children;
d_ptr->children;
never executed: return d_ptr->children;
0
885}-
886-
887-
888-
889-
890-
891-
892bool QGraphicsItem::isWidget() const-
893{-
894 return
never executed: return d_ptr->isWidget;
d_ptr->isWidget;
never executed: return d_ptr->isWidget;
0
895}-
896bool QGraphicsItem::isWindow() const-
897{-
898 return
never executed: return d_ptr->isWidget && (static_cast<const QGraphicsWidget *>(this)->windowType() & Qt::Window);
d_ptr->isWidget && (static_cast<const QGraphicsWidget *>(this)->windowType() & Qt::Window);
never executed: return d_ptr->isWidget && (static_cast<const QGraphicsWidget *>(this)->windowType() & Qt::Window);
0
899}-
900-
901-
902-
903-
904-
905-
906-
907bool QGraphicsItem::isPanel() const-
908{-
909 return
never executed: return d_ptr->flags & ItemIsPanel;
d_ptr->flags & ItemIsPanel;
never executed: return d_ptr->flags & ItemIsPanel;
0
910}-
911QGraphicsItem::GraphicsItemFlags QGraphicsItem::flags() const-
912{-
913 return
never executed: return GraphicsItemFlags(d_ptr->flags);
GraphicsItemFlags(d_ptr->flags);
never executed: return GraphicsItemFlags(d_ptr->flags);
0
914}-
915-
916-
917-
918-
919-
920-
921-
922void QGraphicsItem::setFlag(GraphicsItemFlag flag, bool enabled)-
923{-
924 if (enabled
enabledDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
925 setFlags(GraphicsItemFlags(d_ptr->flags) | flag);
never executed: setFlags(GraphicsItemFlags(d_ptr->flags) | flag);
0
926 else-
927 setFlags(GraphicsItemFlags(d_ptr->flags) & ~flag);
never executed: setFlags(GraphicsItemFlags(d_ptr->flags) & ~flag);
0
928}-
929void QGraphicsItem::setFlags(GraphicsItemFlags flags)-
930{-
931-
932 if (quint32(d_ptr->flags) == quint32(flags)
quint32(d_ptr-...quint32(flags)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
933 return;
never executed: return;
0
934 flags = GraphicsItemFlags(itemChange(ItemFlagsChange, quint32(flags)).toUInt());-
935 if (quint32(d_ptr->flags) == quint32(flags)
quint32(d_ptr-...quint32(flags)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
936 return;
never executed: return;
0
937 if (d_ptr->scene
d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
&& d_ptr->scene->d_func()->indexMethod != QGraphicsScene::NoIndex
d_ptr->scene->...Scene::NoIndexDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
938 d_ptr->scene->d_func()->index->itemChange(this, ItemFlagsChange, &flags);
never executed: d_ptr->scene->d_func()->index->itemChange(this, ItemFlagsChange, &flags);
0
939-
940-
941 const quint32 geomChangeFlagsMask = (ItemClipsChildrenToShape | ItemClipsToShape | ItemIgnoresTransformations | ItemIsSelectable);-
942 bool fullUpdate = (quint32(flags) & geomChangeFlagsMask) != (d_ptr->flags & geomChangeFlagsMask);-
943 if (fullUpdate
fullUpdateDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
944 d_ptr->updatePaintedViewBoundingRects( true);
never executed: d_ptr->updatePaintedViewBoundingRects( true);
0
945-
946-
947 GraphicsItemFlags oldFlags = GraphicsItemFlags(d_ptr->flags);-
948-
949-
950 d_ptr->flags = flags;-
951-
952 if (!(d_ptr->flags & ItemIsFocusable)
!(d_ptr->flags...emIsFocusable)Description
TRUEnever evaluated
FALSEnever evaluated
&& hasFocus()
hasFocus()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
953-
954-
955 clearFocus();-
956 }
never executed: end of block
0
957-
958 if (!(d_ptr->flags & ItemIsSelectable)
!(d_ptr->flags...mIsSelectable)Description
TRUEnever evaluated
FALSEnever evaluated
&& isSelected()
isSelected()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
959-
960-
961 setSelected(false);-
962 }
never executed: end of block
0
963-
964 if ((
(flags & ItemC...ildrenToShape)Description
TRUEnever evaluated
FALSEnever evaluated
flags & ItemClipsChildrenToShape) != (oldFlags & ItemClipsChildrenToShape)
(flags & ItemC...ildrenToShape)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
965-
966-
967 d_ptr->updateAncestorFlag(ItemClipsChildrenToShape);-
968-
969-
970 d_ptr->dirtyChildrenBoundingRect = 1;-
971 d_ptr->markParentDirty(true);-
972 }
never executed: end of block
0
973-
974 if ((
(flags & ItemC...ildrenInShape)Description
TRUEnever evaluated
FALSEnever evaluated
flags & ItemContainsChildrenInShape) != (oldFlags & ItemContainsChildrenInShape)
(flags & ItemC...ildrenInShape)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
975-
976 d_ptr->updateAncestorFlag(ItemContainsChildrenInShape);-
977 }
never executed: end of block
0
978-
979 if ((
(flags & ItemI...ansformations)Description
TRUEnever evaluated
FALSEnever evaluated
flags & ItemIgnoresTransformations) != (oldFlags & ItemIgnoresTransformations)
(flags & ItemI...ansformations)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
980-
981-
982 d_ptr->updateAncestorFlag(ItemIgnoresTransformations);-
983 }
never executed: end of block
0
984-
985 if ((
(flags & ItemN...sBehindParent)Description
TRUEnever evaluated
FALSEnever evaluated
flags & ItemNegativeZStacksBehindParent) != (oldFlags & ItemNegativeZStacksBehindParent)
(flags & ItemN...sBehindParent)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
986-
987-
988-
989-
990-
991 if (d_ptr->z < qreal(0.0)
d_ptr->z < qreal(0.0)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
992 flags |= ItemStacksBehindParent;
never executed: flags |= ItemStacksBehindParent;
0
993 else-
994 flags &= ~ItemStacksBehindParent;
never executed: flags &= ~ItemStacksBehindParent;
0
995 d_ptr->flags = flags;-
996 }
never executed: end of block
0
997-
998 if ((
(flags & ItemS...sBehindParent)Description
TRUEnever evaluated
FALSEnever evaluated
flags & ItemStacksBehindParent) != (oldFlags & ItemStacksBehindParent)
(flags & ItemS...sBehindParent)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
999-
1000-
1001-
1002-
1003 if (d_ptr->parent
d_ptr->parentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1004 d_ptr->parent->d_ptr->needSortChildren = 1;
never executed: d_ptr->parent->d_ptr->needSortChildren = 1;
0
1005 else if (d_ptr->scene
d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1006 d_ptr->scene->d_func()->needSortTopLevelItems = 1;
never executed: d_ptr->scene->d_func()->needSortTopLevelItems = 1;
0
1007 }
never executed: end of block
0
1008-
1009 if ((
(flags & ItemA...tsInputMethod)Description
TRUEnever evaluated
FALSEnever evaluated
flags & ItemAcceptsInputMethod) != (oldFlags & ItemAcceptsInputMethod)
(flags & ItemA...tsInputMethod)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1010-
1011 if (d_ptr->scene
d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1012 d_ptr->scene->d_func()->updateInputMethodSensitivityInViews();
never executed: d_ptr->scene->d_func()->updateInputMethodSensitivityInViews();
0
1013 }
never executed: end of block
0
1014-
1015 if ((
(flags & ItemI...& ItemIsPanel)Description
TRUEnever evaluated
FALSEnever evaluated
flags & ItemIsPanel) != (oldFlags & ItemIsPanel)
(flags & ItemI...& ItemIsPanel)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1016 bool becomesPanel = (flags & ItemIsPanel);-
1017 if ((
(d_ptr->panelM...y != NonModal)Description
TRUEnever evaluated
FALSEnever evaluated
d_ptr->panelModality != NonModal)
(d_ptr->panelM...y != NonModal)Description
TRUEnever evaluated
FALSEnever evaluated
&& d_ptr->scene
d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1018-
1019 if (becomesPanel
becomesPanelDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1020 d_ptr->scene->d_func()->enterModal(this);
never executed: d_ptr->scene->d_func()->enterModal(this);
0
1021 else-
1022 d_ptr->scene->d_func()->leaveModal(this);
never executed: d_ptr->scene->d_func()->leaveModal(this);
0
1023 }-
1024 if (d_ptr->isWidget
d_ptr->isWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
&& (becomesPanel
becomesPanelDescription
TRUEnever evaluated
FALSEnever evaluated
|| parentWidget()
parentWidget()Description
TRUEnever evaluated
FALSEnever evaluated
)) {
0
1025 QGraphicsWidget *w = static_cast<QGraphicsWidget *>(this);-
1026 QGraphicsWidget *focusFirst = w;-
1027 QGraphicsWidget *focusLast = w;-
1028 for (;;) {-
1029 QGraphicsWidget *test = focusLast->d_func()->focusNext;-
1030 if (!w->isAncestorOf(test)
!w->isAncestorOf(test)Description
TRUEnever evaluated
FALSEnever evaluated
|| test == w
test == wDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1031 break;
never executed: break;
0
1032 focusLast = test;-
1033 }
never executed: end of block
0
1034-
1035 if (becomesPanel
becomesPanelDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1036-
1037 QGraphicsWidget *beforeMe = w->d_func()->focusPrev;-
1038 QGraphicsWidget *afterMe = focusLast->d_func()->focusNext;-
1039 beforeMe->d_func()->focusNext = afterMe;-
1040 afterMe->d_func()->focusPrev = beforeMe;-
1041 focusFirst->d_func()->focusPrev = focusLast;-
1042 focusLast->d_func()->focusNext = focusFirst;-
1043 if (!isAncestorOf(focusFirst->d_func()->focusNext)
!isAncestorOf(...()->focusNext)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1044 focusFirst->d_func()->focusNext = w;
never executed: focusFirst->d_func()->focusNext = w;
0
1045 }
never executed: end of block
else if (QGraphicsWidget *pw = parentWidget()
QGraphicsWidge...parentWidget()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1046-
1047 QGraphicsWidget *beforeMe = pw;-
1048 QGraphicsWidget *afterMe = pw->d_func()->focusNext;-
1049 beforeMe->d_func()->focusNext = w;-
1050 afterMe->d_func()->focusPrev = focusLast;-
1051 w->d_func()->focusPrev = beforeMe;-
1052 focusLast->d_func()->focusNext = afterMe;-
1053 }
never executed: end of block
0
1054 }
never executed: end of block
0
1055 }
never executed: end of block
0
1056-
1057 if (d_ptr->scene
d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1058 if ((
(flags & ItemS...sitionChanges)Description
TRUEnever evaluated
FALSEnever evaluated
flags & ItemSendsScenePositionChanges) != (oldFlags & ItemSendsScenePositionChanges)
(flags & ItemS...sitionChanges)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1059 if (flags & ItemSendsScenePositionChanges
flags & ItemSe...ositionChangesDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1060 d_ptr->scene->d_func()->registerScenePosItem(this);
never executed: d_ptr->scene->d_func()->registerScenePosItem(this);
0
1061 else-
1062 d_ptr->scene->d_func()->unregisterScenePosItem(this);
never executed: d_ptr->scene->d_func()->unregisterScenePosItem(this);
0
1063 }-
1064 d_ptr->scene->d_func()->markDirty(this, QRectF(), true);-
1065 }
never executed: end of block
0
1066-
1067-
1068 itemChange(ItemFlagsHaveChanged, quint32(flags));-
1069}
never executed: end of block
0
1070QGraphicsItem::CacheMode QGraphicsItem::cacheMode() const-
1071{-
1072 return
never executed: return QGraphicsItem::CacheMode(d_ptr->cacheMode);
QGraphicsItem::CacheMode(d_ptr->cacheMode);
never executed: return QGraphicsItem::CacheMode(d_ptr->cacheMode);
0
1073}-
1074void QGraphicsItem::setCacheMode(CacheMode mode, const QSize &logicalCacheSize)-
1075{-
1076 CacheMode lastMode = CacheMode(d_ptr->cacheMode);-
1077 d_ptr->cacheMode = mode;-
1078 bool noVisualChange = (mode == NoCache
mode == NoCacheDescription
TRUEnever evaluated
FALSEnever evaluated
&& lastMode == NoCache
lastMode == NoCacheDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1079 || (mode == NoCache
mode == NoCacheDescription
TRUEnever evaluated
FALSEnever evaluated
&& lastMode == DeviceCoordinateCache
lastMode == De...oordinateCacheDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1080 || (mode == DeviceCoordinateCache
mode == DeviceCoordinateCacheDescription
TRUEnever evaluated
FALSEnever evaluated
&& lastMode == NoCache
lastMode == NoCacheDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1081 || (mode == DeviceCoordinateCache
mode == DeviceCoordinateCacheDescription
TRUEnever evaluated
FALSEnever evaluated
&& lastMode == DeviceCoordinateCache
lastMode == De...oordinateCacheDescription
TRUEnever evaluated
FALSEnever evaluated
);
0
1082 if (mode == NoCache
mode == NoCacheDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1083 d_ptr->removeExtraItemCache();-
1084 }
never executed: end of block
else {
0
1085 QGraphicsItemCache *cache = d_ptr->extraItemCache();-
1086-
1087-
1088 cache->purge();-
1089-
1090 if (mode == ItemCoordinateCache
mode == ItemCoordinateCacheDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1091 if (lastMode == mode
lastMode == modeDescription
TRUEnever evaluated
FALSEnever evaluated
&& cache->fixedSize == logicalCacheSize
cache->fixedSi...gicalCacheSizeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1092 noVisualChange = true;
never executed: noVisualChange = true;
0
1093 cache->fixedSize = logicalCacheSize;-
1094 }
never executed: end of block
0
1095 }
never executed: end of block
0
1096 if (!noVisualChange
!noVisualChangeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1097 update();
never executed: update();
0
1098}
never executed: end of block
0
1099-
1100-
1101-
1102-
1103-
1104-
1105QGraphicsItem::PanelModality QGraphicsItem::panelModality() const-
1106{-
1107 return
never executed: return d_ptr->panelModality;
d_ptr->panelModality;
never executed: return d_ptr->panelModality;
0
1108}-
1109void QGraphicsItem::setPanelModality(PanelModality panelModality)-
1110{-
1111 if (d_ptr->panelModality == panelModality
d_ptr->panelMo... panelModalityDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1112 return;
never executed: return;
0
1113-
1114 PanelModality previousModality = d_ptr->panelModality;-
1115 bool enterLeaveModal = (isPanel()
isPanel()Description
TRUEnever evaluated
FALSEnever evaluated
&& d_ptr->scene
d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
&& isVisible()
isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
);
0
1116 if (enterLeaveModal
enterLeaveModalDescription
TRUEnever evaluated
FALSEnever evaluated
&& panelModality == NonModal
panelModality == NonModalDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1117 d_ptr->scene->d_func()->leaveModal(this);
never executed: d_ptr->scene->d_func()->leaveModal(this);
0
1118 d_ptr->panelModality = panelModality;-
1119 if (enterLeaveModal
enterLeaveModalDescription
TRUEnever evaluated
FALSEnever evaluated
&& d_ptr->panelModality != NonModal
d_ptr->panelMo...ty != NonModalDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1120 d_ptr->scene->d_func()->enterModal(this, previousModality);
never executed: d_ptr->scene->d_func()->enterModal(this, previousModality);
0
1121}
never executed: end of block
0
1122bool QGraphicsItem::isBlockedByModalPanel(QGraphicsItem **blockingPanel) const-
1123{-
1124 if (!d_ptr->scene
!d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1125 return
never executed: return false;
false;
never executed: return false;
0
1126-
1127-
1128 QGraphicsItem *dummy = 0;-
1129 if (!blockingPanel
!blockingPanelDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1130 blockingPanel = &dummy;
never executed: blockingPanel = &dummy;
0
1131-
1132 const QGraphicsScenePrivate *scene_d = d_ptr->scene->d_func();-
1133 if (scene_d->modalPanels.isEmpty()
scene_d->modalPanels.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1134 return
never executed: return false;
false;
never executed: return false;
0
1135-
1136-
1137 if (!scene_d->popupWidgets.isEmpty()
!scene_d->popu...gets.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
&& scene_d->popupWidgets.first() == this
scene_d->popup...irst() == thisDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1138 return
never executed: return false;
false;
never executed: return false;
0
1139-
1140 for (int i = 0; i < scene_d->modalPanels.count()
i < scene_d->m...Panels.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1141 QGraphicsItem *modalPanel = scene_d->modalPanels.at(i);-
1142 if (modalPanel->panelModality() == QGraphicsItem::SceneModal
modalPanel->pa...em::SceneModalDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1143-
1144 if (modalPanel != this
modalPanel != thisDescription
TRUEnever evaluated
FALSEnever evaluated
&& !modalPanel->isAncestorOf(this)
!modalPanel->i...cestorOf(this)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1145 *blockingPanel = modalPanel;-
1146 return
never executed: return true;
true;
never executed: return true;
0
1147 }-
1148 }
never executed: end of block
else {
0
1149-
1150 if (modalPanel != this
modalPanel != thisDescription
TRUEnever evaluated
FALSEnever evaluated
0
1151 && !modalPanel->isAncestorOf(this)
!modalPanel->i...cestorOf(this)Description
TRUEnever evaluated
FALSEnever evaluated
0
1152 && commonAncestorItem(modalPanel)
commonAncestorItem(modalPanel)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1153 *blockingPanel = modalPanel;-
1154 return
never executed: return true;
true;
never executed: return true;
0
1155 }-
1156 }
never executed: end of block
0
1157 }-
1158 return
never executed: return false;
false;
never executed: return false;
0
1159}-
1160QString QGraphicsItem::toolTip() const-
1161{-
1162 return
never executed: return d_ptr->extra(QGraphicsItemPrivate::ExtraToolTip).toString();
d_ptr->extra(QGraphicsItemPrivate::ExtraToolTip).toString();
never executed: return d_ptr->extra(QGraphicsItemPrivate::ExtraToolTip).toString();
0
1163}-
1164-
1165-
1166-
1167-
1168-
1169-
1170-
1171void QGraphicsItem::setToolTip(const QString &toolTip)-
1172{-
1173 const QVariant toolTipVariant(itemChange(ItemToolTipChange, toolTip));-
1174 d_ptr->setExtra(QGraphicsItemPrivate::ExtraToolTip, toolTipVariant.toString());-
1175 itemChange(ItemToolTipHasChanged, toolTipVariant);-
1176}
never executed: end of block
0
1177QCursor QGraphicsItem::cursor() const-
1178{-
1179 return
never executed: return qvariant_cast<QCursor>(d_ptr->extra(QGraphicsItemPrivate::ExtraCursor));
qvariant_cast<QCursor>(d_ptr->extra(QGraphicsItemPrivate::ExtraCursor));
never executed: return qvariant_cast<QCursor>(d_ptr->extra(QGraphicsItemPrivate::ExtraCursor));
0
1180}-
1181void QGraphicsItem::setCursor(const QCursor &cursor)-
1182{-
1183 const QVariant cursorVariant(itemChange(ItemCursorChange, QVariant::fromValue<QCursor>(cursor)));-
1184 d_ptr->setExtra(QGraphicsItemPrivate::ExtraCursor, qvariant_cast<QCursor>(cursorVariant));-
1185 d_ptr->hasCursor = 1;-
1186 if (d_ptr->scene
d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1187 d_ptr->scene->d_func()->allItemsUseDefaultCursor = false;-
1188 const auto views = d_ptr->scene->views();-
1189 for (QGraphicsView *view : views) {-
1190 view->viewport()->setMouseTracking(true);-
1191-
1192 if (view->underMouse()
view->underMouse()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1193 const auto itemsUnderCursor = view->items(view->mapFromGlobal(QCursor::pos()));-
1194 for (QGraphicsItem *itemUnderCursor : itemsUnderCursor) {-
1195 if (itemUnderCursor->hasCursor()
itemUnderCursor->hasCursor()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1196 QMetaObject::invokeMethod(view, "_q_setViewportCursor",-
1197 QArgument<QCursor >("QCursor", itemUnderCursor->cursor()));-
1198 break;
never executed: break;
0
1199 }-
1200 }
never executed: end of block
0
1201 break;
never executed: break;
0
1202 }-
1203 }
never executed: end of block
0
1204 }
never executed: end of block
0
1205 itemChange(ItemCursorHasChanged, cursorVariant);-
1206}
never executed: end of block
0
1207bool QGraphicsItem::hasCursor() const-
1208{-
1209 return
never executed: return d_ptr->hasCursor;
d_ptr->hasCursor;
never executed: return d_ptr->hasCursor;
0
1210}-
1211-
1212-
1213-
1214-
1215-
1216-
1217void QGraphicsItem::unsetCursor()-
1218{-
1219 if (!d_ptr->hasCursor
!d_ptr->hasCursorDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1220 return;
never executed: return;
0
1221 d_ptr->unsetExtra(QGraphicsItemPrivate::ExtraCursor);-
1222 d_ptr->hasCursor = 0;-
1223 if (d_ptr->scene
d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1224 const auto views = d_ptr->scene->views();-
1225 for (QGraphicsView *view : views) {-
1226 if (view->underMouse()
view->underMouse()Description
TRUEnever evaluated
FALSEnever evaluated
&& view->itemAt(view->mapFromGlobal(QCursor::pos())) == this
view->itemAt(v...os())) == thisDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1227 QMetaObject::invokeMethod(view, "_q_unsetViewportCursor");-
1228 break;
never executed: break;
0
1229 }-
1230 }
never executed: end of block
0
1231 }
never executed: end of block
0
1232}
never executed: end of block
0
1233bool QGraphicsItem::isVisible() const-
1234{-
1235 return
never executed: return d_ptr->visible;
d_ptr->visible;
never executed: return d_ptr->visible;
0
1236}-
1237bool QGraphicsItem::isVisibleTo(const QGraphicsItem *parent) const-
1238{-
1239 const QGraphicsItem *p = this;-
1240 if (d_ptr->explicitlyHidden
d_ptr->explicitlyHiddenDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1241 return
never executed: return false;
false;
never executed: return false;
0
1242 do {-
1243 if (p == parent
p == parentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1244 return
never executed: return true;
true;
never executed: return true;
0
1245 if (p->d_ptr->explicitlyHidden
p->d_ptr->explicitlyHiddenDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1246 return
never executed: return false;
false;
never executed: return false;
0
1247 }
never executed: end of block
while ((
(p = p->d_ptr->parent)Description
TRUEnever evaluated
FALSEnever evaluated
p = p->d_ptr->parent)
(p = p->d_ptr->parent)Description
TRUEnever evaluated
FALSEnever evaluated
);
0
1248 return
never executed: return parent == 0;
parent == 0;
never executed: return parent == 0;
0
1249}-
1250-
1251-
1252-
1253-
1254-
1255-
1256-
1257void QGraphicsItemPrivate::setVisibleHelper(bool newVisible, bool explicitly,-
1258 bool update, bool hiddenByPanel)-
1259{-
1260 QGraphicsItem * const q = q_func();-
1261-
1262-
1263 if (explicitly
explicitlyDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1264 explicitlyHidden = newVisible
newVisibleDescription
TRUEnever evaluated
FALSEnever evaluated
? 0 : 1;
never executed: explicitlyHidden = newVisible ? 0 : 1;
0
1265-
1266-
1267 if (visible == quint32(newVisible)
visible == quint32(newVisible)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1268 return;
never executed: return;
0
1269-
1270-
1271 if (parent
parentDescription
TRUEnever evaluated
FALSEnever evaluated
&& newVisible
newVisibleDescription
TRUEnever evaluated
FALSEnever evaluated
&& !parent->d_ptr->visible
!parent->d_ptr->visibleDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1272 return;
never executed: return;
0
1273-
1274-
1275 const QVariant newVisibleVariant(q_ptr->itemChange(QGraphicsItem::ItemVisibleChange,-
1276 quint32(newVisible)));-
1277 newVisible = newVisibleVariant.toBool();-
1278 if (visible == quint32(newVisible)
visible == quint32(newVisible)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1279 return;
never executed: return;
0
1280 visible = newVisible;-
1281-
1282-
1283 if (update
updateDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1284 QGraphicsItemCache *c = (QGraphicsItemCache *)qvariant_cast<void *>(extra(ExtraCacheData));-
1285 if (c
cDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1286 c->purge();
never executed: c->purge();
0
1287 if (scene
sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1288-
1289 invalidateParentGraphicsEffectsRecursively();-
1290-
1291 scene->d_func()->markDirty(q_ptr, QRectF(), false, true);-
1292 }
never executed: end of block
0
1293 }
never executed: end of block
0
1294-
1295-
1296 bool hasFocus = q_ptr->hasFocus();-
1297 if (!newVisible
!newVisibleDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1298 if (scene
sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1299 if (scene->d_func()->mouseGrabberItems.contains(q)
scene->d_func(...ms.contains(q)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1300 q->ungrabMouse();
never executed: q->ungrabMouse();
0
1301 if (scene->d_func()->keyboardGrabberItems.contains(q)
scene->d_func(...ms.contains(q)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1302 q->ungrabKeyboard();
never executed: q->ungrabKeyboard();
0
1303 if (q->isPanel()
q->isPanel()Description
TRUEnever evaluated
FALSEnever evaluated
&& panelModality != QGraphicsItem::NonModal
panelModality ...Item::NonModalDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1304 scene->d_func()->leaveModal(q_ptr);
never executed: scene->d_func()->leaveModal(q_ptr);
0
1305 }
never executed: end of block
0
1306 if (hasFocus
hasFocusDescription
TRUEnever evaluated
FALSEnever evaluated
&& scene
sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1307-
1308 QGraphicsItem *focusItem = scene->focusItem();-
1309 bool clear = true;-
1310 if (isWidget
isWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
&& !focusItem->isPanel()
!focusItem->isPanel()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1311 do {-
1312 if (focusItem == q_ptr
focusItem == q_ptrDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1313 clear = !static_cast<QGraphicsWidget *>(q_ptr)->focusNextPrevChild(true);-
1314 break;
never executed: break;
0
1315 }-
1316 }
never executed: end of block
while ((
(focusItem = f...arentWidget())Description
TRUEnever evaluated
FALSEnever evaluated
focusItem = focusItem->parentWidget())
(focusItem = f...arentWidget())Description
TRUEnever evaluated
FALSEnever evaluated
&& !focusItem->isPanel()
!focusItem->isPanel()Description
TRUEnever evaluated
FALSEnever evaluated
);
0
1317 }
never executed: end of block
0
1318 if (clear
clearDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1319 clearFocusHelper( false, hiddenByPanel);
never executed: clearFocusHelper( false, hiddenByPanel);
0
1320 }
never executed: end of block
0
1321 if (q_ptr->isSelected()
q_ptr->isSelected()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1322 q_ptr->setSelected(false);
never executed: q_ptr->setSelected(false);
0
1323 }
never executed: end of block
else {
0
1324 geometryChanged = 1;-
1325 paintedViewBoundingRectsNeedRepaint = 1;-
1326 if (scene
sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1327 if (isWidget
isWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1328 QGraphicsWidget *widget = static_cast<QGraphicsWidget *>(q_ptr);-
1329 if (widget->windowType() == Qt::Popup
widget->window...) == Qt::PopupDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1330 scene->d_func()->addPopup(widget);
never executed: scene->d_func()->addPopup(widget);
0
1331 }
never executed: end of block
0
1332 if (q->isPanel()
q->isPanel()Description
TRUEnever evaluated
FALSEnever evaluated
&& panelModality != QGraphicsItem::NonModal
panelModality ...Item::NonModalDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1333 scene->d_func()->enterModal(q_ptr);-
1334 }
never executed: end of block
0
1335 }
never executed: end of block
0
1336 }
never executed: end of block
0
1337-
1338-
1339 const bool updateChildren = update
updateDescription
TRUEnever evaluated
FALSEnever evaluated
&& !((flags & QGraphicsItem::ItemClipsChildrenToShape
flags & QGraph...hildrenToShapeDescription
TRUEnever evaluated
FALSEnever evaluated
0
1340 || flags & QGraphicsItem::ItemContainsChildrenInShape
flags & QGraph...hildrenInShapeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1341 && !(flags & QGraphicsItem::ItemHasNoContents)
!(flags & QGra...HasNoContents)Description
TRUEnever evaluated
FALSEnever evaluated
);
0
1342 for (QForeachContainer<typename QtPrivate::remove_reference<decltype(children)>::type> _container_((children)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QGraphicsItem *child = *_container_.i; _container_.control; _container_.control = 0) {-
1343 if (!newVisible
!newVisibleDescription
TRUEnever evaluated
FALSEnever evaluated
|| !child->d_ptr->explicitlyHidden
!child->d_ptr-...plicitlyHiddenDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1344 child->d_ptr->setVisibleHelper(newVisible, false, updateChildren, hiddenByPanel);
never executed: child->d_ptr->setVisibleHelper(newVisible, false, updateChildren, hiddenByPanel);
0
1345 }
never executed: end of block
0
1346-
1347-
1348 if (scene
sceneDescription
TRUEnever evaluated
FALSEnever evaluated
&& q->isPanel()
q->isPanel()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1349 if (newVisible
newVisibleDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1350 if (parent
parentDescription
TRUEnever evaluated
FALSEnever evaluated
&& parent->isActive()
parent->isActive()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1351 q->setActive(true);
never executed: q->setActive(true);
0
1352 }
never executed: end of block
else {
0
1353 if (q->isActive()
q->isActive()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1354 scene->setActivePanel(parent);
never executed: scene->setActivePanel(parent);
0
1355 }
never executed: end of block
0
1356 }-
1357-
1358-
1359 if (scene
sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1360 if (newVisible
newVisibleDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1361-
1362 QGraphicsItem *p = parent;-
1363 bool done = false;-
1364 while (p
pDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1365 if (p->flags() & QGraphicsItem::ItemIsFocusScope
p->flags() & Q...emIsFocusScopeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1366 QGraphicsItem *fsi = p->d_ptr->focusScopeItem;-
1367 if (q_ptr == fsi
q_ptr == fsiDescription
TRUEnever evaluated
FALSEnever evaluated
|| q_ptr->isAncestorOf(fsi)
q_ptr->isAncestorOf(fsi)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1368 done = true;-
1369 while (fsi->d_ptr->focusScopeItem
fsi->d_ptr->focusScopeItemDescription
TRUEnever evaluated
FALSEnever evaluated
&& fsi->d_ptr->focusScopeItem->isVisible()
fsi->d_ptr->fo...m->isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1370 fsi = fsi->d_ptr->focusScopeItem;
never executed: fsi = fsi->d_ptr->focusScopeItem;
0
1371 fsi->d_ptr->setFocusHelper(Qt::OtherFocusReason, true,-
1372 false);-
1373 }
never executed: end of block
0
1374 break;
never executed: break;
0
1375 }-
1376 p = p->d_ptr->parent;-
1377 }
never executed: end of block
0
1378 if (!done
!doneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1379 QGraphicsItem *fi = subFocusItem;-
1380 if (fi
fiDescription
TRUEnever evaluated
FALSEnever evaluated
&& fi != scene->focusItem()
fi != scene->focusItem()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1381 scene->setFocusItem(fi);-
1382 }
never executed: end of block
else if (flags & QGraphicsItem::ItemIsFocusScope
flags & QGraph...emIsFocusScopeDescription
TRUEnever evaluated
FALSEnever evaluated
&&
0
1383 !scene->focusItem()
!scene->focusItem()Description
TRUEnever evaluated
FALSEnever evaluated
&&
0
1384 q->isAncestorOf(scene->d_func()->lastFocusItem)
q->isAncestorO...lastFocusItem)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1385 q_ptr->setFocus();-
1386 }
never executed: end of block
0
1387 }
never executed: end of block
0
1388 }
never executed: end of block
else {
0
1389-
1390 if (hasFocus
hasFocusDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1391 QGraphicsItem *p = parent;-
1392 while (p
pDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1393 if (p->flags() & QGraphicsItem::ItemIsFocusScope
p->flags() & Q...emIsFocusScopeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1394 if (p->d_ptr->visible
p->d_ptr->visibleDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1395 p->d_ptr->setFocusHelper(Qt::OtherFocusReason, true,-
1396 true);-
1397 }
never executed: end of block
0
1398 break;
never executed: break;
0
1399 }-
1400 p = p->d_ptr->parent;-
1401 }
never executed: end of block
0
1402 }
never executed: end of block
0
1403 }
never executed: end of block
0
1404 }-
1405-
1406-
1407 q_ptr->itemChange(QGraphicsItem::ItemVisibleHasChanged, newVisibleVariant);-
1408-
1409 if (isObject
isObjectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1410 static_cast<
never executed: static_cast<QGraphicsObject *>(q_ptr)->visibleChanged();
QGraphicsObject *>(q_ptr)->visibleChanged();
never executed: static_cast<QGraphicsObject *>(q_ptr)->visibleChanged();
0
1411}
never executed: end of block
0
1412void QGraphicsItem::setVisible(bool visible)-
1413{-
1414 d_ptr->setVisibleHelper(visible,-
1415 true,-
1416 true,-
1417 isPanel());-
1418}
never executed: end of block
0
1419bool QGraphicsItem::isEnabled() const-
1420{-
1421 return
never executed: return d_ptr->enabled;
d_ptr->enabled;
never executed: return d_ptr->enabled;
0
1422}-
1423-
1424-
1425-
1426-
1427-
1428-
1429-
1430void QGraphicsItemPrivate::setEnabledHelper(bool newEnabled, bool explicitly, bool update)-
1431{-
1432-
1433 if (explicitly
explicitlyDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1434 explicitlyDisabled = newEnabled
newEnabledDescription
TRUEnever evaluated
FALSEnever evaluated
? 0 : 1;
never executed: explicitlyDisabled = newEnabled ? 0 : 1;
0
1435-
1436-
1437 if (enabled == quint32(newEnabled)
enabled == quint32(newEnabled)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1438 return;
never executed: return;
0
1439-
1440-
1441 if (!newEnabled
!newEnabledDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1442 if (scene
sceneDescription
TRUEnever evaluated
FALSEnever evaluated
&& scene->mouseGrabberItem() == q_ptr
scene->mouseGr...tem() == q_ptrDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1443 q_ptr->ungrabMouse();
never executed: q_ptr->ungrabMouse();
0
1444 if (q_ptr->hasFocus()
q_ptr->hasFocus()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1445-
1446-
1447 QGraphicsItem *focusItem = scene->focusItem();-
1448 bool clear = true;-
1449 if (isWidget
isWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
&& !focusItem->isPanel()
!focusItem->isPanel()Description
TRUEnever evaluated
FALSEnever evaluated
&& q_ptr->isAncestorOf(focusItem)
q_ptr->isAncestorOf(focusItem)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1450 do {-
1451 if (focusItem == q_ptr
focusItem == q_ptrDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1452 clear = !static_cast<QGraphicsWidget *>(q_ptr)->focusNextPrevChild(true);-
1453 break;
never executed: break;
0
1454 }-
1455 }
never executed: end of block
while ((
(focusItem = f...arentWidget())Description
TRUEnever evaluated
FALSEnever evaluated
focusItem = focusItem->parentWidget())
(focusItem = f...arentWidget())Description
TRUEnever evaluated
FALSEnever evaluated
&& !focusItem->isPanel()
!focusItem->isPanel()Description
TRUEnever evaluated
FALSEnever evaluated
);
0
1456 }
never executed: end of block
0
1457 if (clear
clearDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1458 q_ptr->clearFocus();
never executed: q_ptr->clearFocus();
0
1459 }
never executed: end of block
0
1460 if (q_ptr->isSelected()
q_ptr->isSelected()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1461 q_ptr->setSelected(false);
never executed: q_ptr->setSelected(false);
0
1462 }
never executed: end of block
0
1463-
1464-
1465 const QVariant newEnabledVariant(q_ptr->itemChange(QGraphicsItem::ItemEnabledChange,-
1466 quint32(newEnabled)));-
1467 enabled = newEnabledVariant.toBool();-
1468-
1469-
1470 if (update
updateDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1471 q_ptr->update();
never executed: q_ptr->update();
0
1472-
1473 for (QForeachContainer<typename QtPrivate::remove_reference<decltype(children)>::type> _container_((children)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QGraphicsItem *child = *_container_.i; _container_.control; _container_.control = 0) {-
1474 if (!newEnabled
!newEnabledDescription
TRUEnever evaluated
FALSEnever evaluated
|| !child->d_ptr->explicitlyDisabled
!child->d_ptr-...icitlyDisabledDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1475 child->d_ptr->setEnabledHelper(newEnabled, false);
never executed: child->d_ptr->setEnabledHelper(newEnabled, false);
0
1476 }
never executed: end of block
0
1477-
1478-
1479 q_ptr->itemChange(QGraphicsItem::ItemEnabledHasChanged, newEnabledVariant);-
1480-
1481 if (isObject
isObjectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1482 static_cast<
never executed: static_cast<QGraphicsObject *>(q_ptr)->enabledChanged();
QGraphicsObject *>(q_ptr)->enabledChanged();
never executed: static_cast<QGraphicsObject *>(q_ptr)->enabledChanged();
0
1483}
never executed: end of block
0
1484void QGraphicsItem::setEnabled(bool enabled)-
1485{-
1486 d_ptr->setEnabledHelper(enabled, true);-
1487}
never executed: end of block
0
1488bool QGraphicsItem::isSelected() const-
1489{-
1490 if (QGraphicsItemGroup *group = this->group()
QGraphicsItemG... this->group()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1491 return
never executed: return group->isSelected();
group->isSelected();
never executed: return group->isSelected();
0
1492 return
never executed: return d_ptr->selected;
d_ptr->selected;
never executed: return d_ptr->selected;
0
1493}-
1494void QGraphicsItem::setSelected(bool selected)-
1495{-
1496 if (QGraphicsItemGroup *group = this->group()
QGraphicsItemG... this->group()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1497 group->setSelected(selected);-
1498 return;
never executed: return;
0
1499 }-
1500-
1501 if (!(d_ptr->flags & ItemIsSelectable)
!(d_ptr->flags...mIsSelectable)Description
TRUEnever evaluated
FALSEnever evaluated
|| !d_ptr->enabled
!d_ptr->enabledDescription
TRUEnever evaluated
FALSEnever evaluated
|| !d_ptr->visible
!d_ptr->visibleDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1502 selected = false;
never executed: selected = false;
0
1503 if (d_ptr->selected == selected
d_ptr->selected == selectedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1504 return;
never executed: return;
0
1505 const QVariant newSelectedVariant(itemChange(ItemSelectedChange, quint32(selected)));-
1506 bool newSelected = newSelectedVariant.toBool();-
1507 if (d_ptr->selected == newSelected
d_ptr->selected == newSelectedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1508 return;
never executed: return;
0
1509 d_ptr->selected = newSelected;-
1510-
1511 update();-
1512 if (d_ptr->scene
d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1513 QGraphicsScenePrivate *sceneD = d_ptr->scene->d_func();-
1514 if (selected
selectedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1515 sceneD->selectedItems << this;-
1516 }
never executed: end of block
else {
0
1517-
1518-
1519 }
never executed: end of block
0
1520 if (!sceneD->selectionChanging
!sceneD->selectionChangingDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1521 d_ptr->scene->selectionChanged();
never executed: d_ptr->scene->selectionChanged();
0
1522 }
never executed: end of block
0
1523-
1524-
1525 itemChange(QGraphicsItem::ItemSelectedHasChanged, newSelectedVariant);-
1526}
never executed: end of block
0
1527qreal QGraphicsItem::opacity() const-
1528{-
1529 return
never executed: return d_ptr->opacity;
d_ptr->opacity;
never executed: return d_ptr->opacity;
0
1530}-
1531qreal QGraphicsItem::effectiveOpacity() const-
1532{-
1533 return
never executed: return d_ptr->effectiveOpacity();
d_ptr->effectiveOpacity();
never executed: return d_ptr->effectiveOpacity();
0
1534}-
1535void QGraphicsItem::setOpacity(qreal opacity)-
1536{-
1537-
1538 const QVariant newOpacityVariant(itemChange(ItemOpacityChange, opacity));-
1539-
1540-
1541 qreal newOpacity = qBound(qreal(0), newOpacityVariant.toReal(), qreal(1));-
1542-
1543-
1544 if (newOpacity == d_ptr->opacity
newOpacity == d_ptr->opacityDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1545 return;
never executed: return;
0
1546-
1547 bool wasFullyTransparent = d_ptr->isOpacityNull();-
1548 d_ptr->opacity = newOpacity;-
1549-
1550-
1551 itemChange(ItemOpacityHasChanged, newOpacityVariant);-
1552-
1553-
1554 if (d_ptr->scene
d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1555-
1556 d_ptr->invalidateParentGraphicsEffectsRecursively();-
1557 if (!(d_ptr->flags & ItemDoesntPropagateOpacityToChildren)
!(d_ptr->flags...ityToChildren)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1558 d_ptr->invalidateChildGraphicsEffectsRecursively(QGraphicsItemPrivate::OpacityChanged);
never executed: d_ptr->invalidateChildGraphicsEffectsRecursively(QGraphicsItemPrivate::OpacityChanged);
0
1559-
1560 d_ptr->scene->d_func()->markDirty(this, QRectF(),-
1561 true,-
1562 false,-
1563 d_ptr->isOpacityNull());-
1564 if (wasFullyTransparent
wasFullyTransparentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1565 d_ptr->paintedViewBoundingRectsNeedRepaint = 1;
never executed: d_ptr->paintedViewBoundingRectsNeedRepaint = 1;
0
1566 }
never executed: end of block
0
1567-
1568 if (d_ptr->isObject
d_ptr->isObjectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1569 static_cast<
never executed: static_cast<QGraphicsObject *>(this)->opacityChanged();
QGraphicsObject *>(this)->opacityChanged();
never executed: static_cast<QGraphicsObject *>(this)->opacityChanged();
0
1570}
never executed: end of block
0
1571-
1572-
1573-
1574-
1575-
1576-
1577-
1578QGraphicsEffect *QGraphicsItem::graphicsEffect() const-
1579{-
1580 return
never executed: return d_ptr->graphicsEffect;
d_ptr->graphicsEffect;
never executed: return d_ptr->graphicsEffect;
0
1581}-
1582void QGraphicsItem::setGraphicsEffect(QGraphicsEffect *effect)-
1583{-
1584 if (d_ptr->graphicsEffect == effect
d_ptr->graphic...fect == effectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1585 return;
never executed: return;
0
1586-
1587 if (d_ptr->graphicsEffect
d_ptr->graphicsEffectDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1588 delete d_ptr->graphicsEffect;-
1589 d_ptr->graphicsEffect = 0;-
1590 }
never executed: end of block
else if (d_ptr->parent
d_ptr->parentDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1591 d_ptr->parent->d_ptr->updateChildWithGraphicsEffectFlagRecursively();-
1592 }
never executed: end of block
0
1593-
1594 if (effect
effectDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1595-
1596 QGraphicsEffectSourcePrivate *sourced = new QGraphicsItemEffectSourcePrivate(this);-
1597 QGraphicsEffectSource *source = new QGraphicsEffectSource(*sourced);-
1598 d_ptr->graphicsEffect = effect;-
1599 effect->d_func()->setGraphicsEffectSource(source);-
1600 prepareGeometryChange();-
1601 }
never executed: end of block
0
1602}
never executed: end of block
0
1603-
1604-
1605void QGraphicsItemPrivate::updateChildWithGraphicsEffectFlagRecursively()-
1606{-
1607-
1608 QGraphicsItemPrivate *itemPrivate = this;-
1609 do {-
1610-
1611 if (itemPrivate->mayHaveChildWithGraphicsEffect
itemPrivate->m...GraphicsEffectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1612 return;
never executed: return;
0
1613 itemPrivate->mayHaveChildWithGraphicsEffect = 1;-
1614 }
never executed: end of block
while ((
(itemPrivate =...tr.data() : 0)Description
TRUEnever evaluated
FALSEnever evaluated
itemPrivate = itemPrivate->parent
itemPrivate->parentDescription
TRUEnever evaluated
FALSEnever evaluated
? itemPrivate->parent->d_ptr.data() : 0)
(itemPrivate =...tr.data() : 0)Description
TRUEnever evaluated
FALSEnever evaluated
);
0
1615-
1616}
never executed: end of block
0
1617QRectF QGraphicsItemPrivate::effectiveBoundingRect(const QRectF &rect) const-
1618{-
1619-
1620 const QGraphicsItem * const q = q_func();-
1621 QGraphicsEffect *effect = graphicsEffect;-
1622 if (scene
sceneDescription
TRUEnever evaluated
FALSEnever evaluated
&& effect
effectDescription
TRUEnever evaluated
FALSEnever evaluated
&& effect->isEnabled()
effect->isEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1623 if (scene->d_func()->views.isEmpty()
scene->d_func(...iews.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1624 return
never executed: return effect->boundingRectFor(rect);
effect->boundingRectFor(rect);
never executed: return effect->boundingRectFor(rect);
0
1625 QRectF sceneRect = q->mapRectToScene(rect);-
1626 QRectF sceneEffectRect;-
1627 const auto views = scene->views();-
1628 for (QGraphicsView *view : views) {-
1629 QRectF deviceRect = view->d_func()->mapRectFromScene(sceneRect);-
1630 QRect deviceEffectRect = effect->boundingRectFor(deviceRect).toAlignedRect();-
1631 sceneEffectRect |= view->d_func()->mapRectToScene(deviceEffectRect);-
1632 }
never executed: end of block
0
1633 return
never executed: return q->mapRectFromScene(sceneEffectRect);
q->mapRectFromScene(sceneEffectRect);
never executed: return q->mapRectFromScene(sceneEffectRect);
0
1634 }-
1635-
1636 return
never executed: return rect;
rect;
never executed: return rect;
0
1637}-
1638QRectF QGraphicsItemPrivate::effectiveBoundingRect(QGraphicsItem *topMostEffectItem) const-
1639{-
1640-
1641 const QGraphicsItem * const q = q_func();-
1642 QRectF brect = effectiveBoundingRect(q_ptr->boundingRect());-
1643 if (ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren
ancestorFlags ...rClipsChildrenDescription
TRUEnever evaluated
FALSEnever evaluated
0
1644 || ancestorFlags & QGraphicsItemPrivate::AncestorContainsChildren
ancestorFlags ...ntainsChildrenDescription
TRUEnever evaluated
FALSEnever evaluated
0
1645 || topMostEffectItem == q
topMostEffectItem == qDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1646 return
never executed: return brect;
brect;
never executed: return brect;
0
1647-
1648 const QGraphicsItem *effectParent = parent;-
1649 while (effectParent
effectParentDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1650 QGraphicsEffect *effect = effectParent->d_ptr->graphicsEffect;-
1651 if (scene
sceneDescription
TRUEnever evaluated
FALSEnever evaluated
&& effect
effectDescription
TRUEnever evaluated
FALSEnever evaluated
&& effect->isEnabled()
effect->isEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1652 const QRectF brectInParentSpace = q->mapRectToItem(effectParent, brect);-
1653 const QRectF effectRectInParentSpace = effectParent->d_ptr->effectiveBoundingRect(brectInParentSpace);-
1654 brect = effectParent->mapRectToItem(q, effectRectInParentSpace);-
1655 }
never executed: end of block
0
1656 if (effectParent->d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren
effectParent->...rClipsChildrenDescription
TRUEnever evaluated
FALSEnever evaluated
0
1657 || effectParent->d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorContainsChildren
effectParent->...ntainsChildrenDescription
TRUEnever evaluated
FALSEnever evaluated
0
1658 || topMostEffectItem == effectParent
topMostEffectI...= effectParentDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1659 return
never executed: return brect;
brect;
never executed: return brect;
0
1660 }-
1661 effectParent = effectParent->d_ptr->parent;-
1662 }
never executed: end of block
0
1663-
1664 return
never executed: return brect;
brect;
never executed: return brect;
0
1665-
1666-
1667-
1668-
1669}-
1670QRectF QGraphicsItemPrivate::sceneEffectiveBoundingRect() const-
1671{-
1672-
1673-
1674 QPointF offset;-
1675 const QGraphicsItem *parentItem = q_ptr;-
1676 const QGraphicsItemPrivate *itemd;-
1677 do {-
1678 itemd = parentItem->d_ptr.data();-
1679 if (itemd->transformData
itemd->transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1680 break;
never executed: break;
0
1681 offset += itemd->pos;-
1682 }
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
1683-
1684 QRectF br = effectiveBoundingRect();-
1685 br.translate(offset);-
1686 return
never executed: return !parentItem ? br : parentItem->sceneTransform().mapRect(br);
!parentItem ? br : parentItem->sceneTransform().mapRect(br);
never executed: return !parentItem ? br : parentItem->sceneTransform().mapRect(br);
0
1687}-
1688bool QGraphicsItem::acceptDrops() const-
1689{-
1690 return
never executed: return d_ptr->acceptDrops;
d_ptr->acceptDrops;
never executed: return d_ptr->acceptDrops;
0
1691}-
1692void QGraphicsItem::setAcceptDrops(bool on)-
1693{-
1694 d_ptr->acceptDrops = on;-
1695}
never executed: end of block
0
1696Qt::MouseButtons QGraphicsItem::acceptedMouseButtons() const-
1697{-
1698 return
never executed: return Qt::MouseButtons(d_ptr->acceptedMouseButtons);
Qt::MouseButtons(d_ptr->acceptedMouseButtons);
never executed: return Qt::MouseButtons(d_ptr->acceptedMouseButtons);
0
1699}-
1700void QGraphicsItem::setAcceptedMouseButtons(Qt::MouseButtons buttons)-
1701{-
1702 if (Qt::MouseButtons(d_ptr->acceptedMouseButtons) != buttons
Qt::MouseButto...ns) != buttonsDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1703 if (buttons == 0
buttons == 0Description
TRUEnever evaluated
FALSEnever evaluated
&& d_ptr->scene
d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
&& d_ptr->scene->mouseGrabberItem() == this
d_ptr->scene->...Item() == thisDescription
TRUEnever evaluated
FALSEnever evaluated
0
1704 && d_ptr->scene->d_func()->lastMouseGrabberItemHasImplicitMouseGrab
d_ptr->scene->...licitMouseGrabDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1705 ungrabMouse();-
1706 }
never executed: end of block
0
1707 d_ptr->acceptedMouseButtons = quint32(buttons);-
1708 }
never executed: end of block
0
1709}
never executed: end of block
0
1710bool QGraphicsItem::acceptHoverEvents() const-
1711{-
1712 return
never executed: return d_ptr->acceptsHover;
d_ptr->acceptsHover;
never executed: return d_ptr->acceptsHover;
0
1713}-
1714void QGraphicsItem::setAcceptHoverEvents(bool enabled)-
1715{-
1716 if (d_ptr->acceptsHover == quint32(enabled)
d_ptr->accepts...int32(enabled)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1717 return;
never executed: return;
0
1718 d_ptr->acceptsHover = quint32(enabled);-
1719 if (d_ptr->acceptsHover
d_ptr->acceptsHoverDescription
TRUEnever evaluated
FALSEnever evaluated
&& d_ptr->scene
d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
&& d_ptr->scene->d_func()->allItemsIgnoreHoverEvents
d_ptr->scene->...oreHoverEventsDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1720 d_ptr->scene->d_func()->allItemsIgnoreHoverEvents = false;-
1721 d_ptr->scene->d_func()->enableMouseTrackingOnViews();-
1722 }
never executed: end of block
0
1723}
never executed: end of block
0
1724bool QGraphicsItem::acceptTouchEvents() const-
1725{-
1726 return
never executed: return d_ptr->acceptTouchEvents;
d_ptr->acceptTouchEvents;
never executed: return d_ptr->acceptTouchEvents;
0
1727}-
1728void QGraphicsItem::setAcceptTouchEvents(bool enabled)-
1729{-
1730 if (d_ptr->acceptTouchEvents == quint32(enabled)
d_ptr->acceptT...int32(enabled)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1731 return;
never executed: return;
0
1732 d_ptr->acceptTouchEvents = quint32(enabled);-
1733 if (d_ptr->acceptTouchEvents
d_ptr->acceptTouchEventsDescription
TRUEnever evaluated
FALSEnever evaluated
&& d_ptr->scene
d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
&& d_ptr->scene->d_func()->allItemsIgnoreTouchEvents
d_ptr->scene->...oreTouchEventsDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1734 d_ptr->scene->d_func()->allItemsIgnoreTouchEvents = false;-
1735 d_ptr->scene->d_func()->enableTouchEventsOnViews();-
1736 }
never executed: end of block
0
1737}
never executed: end of block
0
1738bool QGraphicsItem::filtersChildEvents() const-
1739{-
1740 return
never executed: return d_ptr->filtersDescendantEvents;
d_ptr->filtersDescendantEvents;
never executed: return d_ptr->filtersDescendantEvents;
0
1741}-
1742void QGraphicsItem::setFiltersChildEvents(bool enabled)-
1743{-
1744 if (d_ptr->filtersDescendantEvents == enabled
d_ptr->filters...nts == enabledDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1745 return;
never executed: return;
0
1746-
1747 d_ptr->filtersDescendantEvents = enabled;-
1748 d_ptr->updateAncestorFlag(QGraphicsItem::GraphicsItemFlag(-2));-
1749}
never executed: end of block
0
1750bool QGraphicsItem::handlesChildEvents() const-
1751{-
1752 return
never executed: return d_ptr->handlesChildEvents;
d_ptr->handlesChildEvents;
never executed: return d_ptr->handlesChildEvents;
0
1753}-
1754void QGraphicsItem::setHandlesChildEvents(bool enabled)-
1755{-
1756 if (d_ptr->handlesChildEvents == enabled
d_ptr->handles...nts == enabledDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1757 return;
never executed: return;
0
1758-
1759 d_ptr->handlesChildEvents = enabled;-
1760 d_ptr->updateAncestorFlag(QGraphicsItem::GraphicsItemFlag(-1));-
1761}
never executed: end of block
0
1762bool QGraphicsItem::isActive() const-
1763{-
1764 if (!d_ptr->scene
!d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
|| !d_ptr->scene->isActive()
!d_ptr->scene->isActive()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1765 return
never executed: return false;
false;
never executed: return false;
0
1766 return
never executed: return panel() == d_ptr->scene->activePanel();
panel() == d_ptr->scene->activePanel();
never executed: return panel() == d_ptr->scene->activePanel();
0
1767}-
1768void QGraphicsItem::setActive(bool active)-
1769{-
1770 d_ptr->explicitActivate = 1;-
1771 d_ptr->wantsActive = active;-
1772 if (d_ptr->scene
d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1773 if (active
activeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1774-
1775 d_ptr->scene->setActivePanel(this);-
1776 }
never executed: end of block
else {
0
1777 QGraphicsItem *activePanel = d_ptr->scene->activePanel();-
1778 QGraphicsItem *thisPanel = panel();-
1779 if (!activePanel
!activePanelDescription
TRUEnever evaluated
FALSEnever evaluated
|| activePanel == thisPanel
activePanel == thisPanelDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1780-
1781-
1782 QGraphicsItem *nextToActivate = 0;-
1783 if (d_ptr->parent
d_ptr->parentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1784 nextToActivate = d_ptr->parent->panel();
never executed: nextToActivate = d_ptr->parent->panel();
0
1785 if (!nextToActivate
!nextToActivateDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1786 nextToActivate = d_ptr->scene->d_func()->lastActivePanel;
never executed: nextToActivate = d_ptr->scene->d_func()->lastActivePanel;
0
1787 if (nextToActivate == this
nextToActivate == thisDescription
TRUEnever evaluated
FALSEnever evaluated
|| isAncestorOf(nextToActivate)
isAncestorOf(nextToActivate)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1788 nextToActivate = 0;
never executed: nextToActivate = 0;
0
1789 d_ptr->scene->setActivePanel(nextToActivate);-
1790 }
never executed: end of block
0
1791 }
never executed: end of block
0
1792 }-
1793}
never executed: end of block
0
1794-
1795-
1796-
1797-
1798-
1799-
1800-
1801bool QGraphicsItem::hasFocus() const-
1802{-
1803 if (!d_ptr->scene
!d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
|| !d_ptr->scene->isActive()
!d_ptr->scene->isActive()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1804 return
never executed: return false;
false;
never executed: return false;
0
1805-
1806 if (d_ptr->focusProxy
d_ptr->focusProxyDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1807 return
never executed: return d_ptr->focusProxy->hasFocus();
d_ptr->focusProxy->hasFocus();
never executed: return d_ptr->focusProxy->hasFocus();
0
1808-
1809 if (d_ptr->scene->d_func()->focusItem != this
d_ptr->scene->...usItem != thisDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1810 return
never executed: return false;
false;
never executed: return false;
0
1811-
1812 return
never executed: return panel() == d_ptr->scene->d_func()->activePanel;
panel() == d_ptr->scene->d_func()->activePanel;
never executed: return panel() == d_ptr->scene->d_func()->activePanel;
0
1813}-
1814void QGraphicsItem::setFocus(Qt::FocusReason focusReason)-
1815{-
1816 d_ptr->setFocusHelper(focusReason, true, false);-
1817}
never executed: end of block
0
1818-
1819-
1820-
1821-
1822void QGraphicsItemPrivate::setFocusHelper(Qt::FocusReason focusReason, bool climb, bool focusFromHide)-
1823{-
1824-
1825 if (!q_ptr->isEnabled()
!q_ptr->isEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
|| !(flags & QGraphicsItem::ItemIsFocusable)
!(flags & QGra...emIsFocusable)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1826 return;
never executed: return;
0
1827-
1828-
1829 QGraphicsItem *f = q_ptr;-
1830 while (f->d_ptr->focusProxy
f->d_ptr->focusProxyDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1831 f = f->d_ptr->focusProxy;
never executed: f = f->d_ptr->focusProxy;
0
1832-
1833-
1834 if (scene
sceneDescription
TRUEnever evaluated
FALSEnever evaluated
&& scene->focusItem() == f
scene->focusItem() == fDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1835 return;
never executed: return;
0
1836-
1837-
1838 QGraphicsItem *p = parent;-
1839 while (p
pDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1840 if (p->flags() & QGraphicsItem::ItemIsFocusScope
p->flags() & Q...emIsFocusScopeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1841 QGraphicsItem *oldFocusScopeItem = p->d_ptr->focusScopeItem;-
1842 p->d_ptr->focusScopeItem = q_ptr;-
1843 if (oldFocusScopeItem
oldFocusScopeItemDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1844 oldFocusScopeItem->d_ptr->focusScopeItemChange(false);
never executed: oldFocusScopeItem->d_ptr->focusScopeItemChange(false);
0
1845 focusScopeItemChange(true);-
1846 if (!p->focusItem()
!p->focusItem()Description
TRUEnever evaluated
FALSEnever evaluated
&& !focusFromHide
!focusFromHideDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1847-
1848-
1849-
1850-
1851 return;
never executed: return;
0
1852 }-
1853 break;
never executed: break;
0
1854 }-
1855 p = p->d_ptr->parent;-
1856 }
never executed: end of block
0
1857-
1858 if (climb
climbDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1859 while (f->d_ptr->focusScopeItem
f->d_ptr->focusScopeItemDescription
TRUEnever evaluated
FALSEnever evaluated
&& f->d_ptr->focusScopeItem->isVisible()
f->d_ptr->focu...m->isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1860 f = f->d_ptr->focusScopeItem;
never executed: f = f->d_ptr->focusScopeItem;
0
1861 }
never executed: end of block
0
1862-
1863-
1864 QGraphicsItem *commonAncestor = 0;-
1865 if (scene
sceneDescription
TRUEnever evaluated
FALSEnever evaluated
&& scene->focusItem()
scene->focusItem()Description
TRUEnever evaluated
FALSEnever evaluated
&& scene->focusItem()->panel() == q_ptr->panel()
scene->focusIt...q_ptr->panel()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1866 commonAncestor = scene->focusItem()->commonAncestorItem(f);-
1867 scene->focusItem()->d_ptr->clearSubFocus(scene->focusItem(), commonAncestor);-
1868 }
never executed: end of block
0
1869-
1870 f->d_ptr->setSubFocus(f, commonAncestor);-
1871-
1872-
1873 if (scene
sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1874 QGraphicsItem *p = q_ptr->panel();-
1875 if ((!p
!pDescription
TRUEnever evaluated
FALSEnever evaluated
&& scene->isActive()
scene->isActive()Description
TRUEnever evaluated
FALSEnever evaluated
) || (p
pDescription
TRUEnever evaluated
FALSEnever evaluated
&& p->isActive()
p->isActive()Description
TRUEnever evaluated
FALSEnever evaluated
)) {
0
1876-
1877 scene->d_func()->setFocusItemHelper(f, focusReason);-
1878 }
never executed: end of block
0
1879 }
never executed: end of block
0
1880}
never executed: end of block
0
1881void QGraphicsItem::clearFocus()-
1882{-
1883 d_ptr->clearFocusHelper( true,-
1884 false);-
1885}
never executed: end of block
0
1886-
1887-
1888-
1889-
1890void QGraphicsItemPrivate::clearFocusHelper(bool giveFocusToParent, bool hiddenByParentPanel)-
1891{-
1892 QGraphicsItem *subFocusItem = q_ptr;-
1893 if (flags & QGraphicsItem::ItemIsFocusScope
flags & QGraph...emIsFocusScopeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1894 while (subFocusItem->d_ptr->focusScopeItem
subFocusItem->...focusScopeItemDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1895 subFocusItem = subFocusItem->d_ptr->focusScopeItem;
never executed: subFocusItem = subFocusItem->d_ptr->focusScopeItem;
0
1896 }
never executed: end of block
0
1897-
1898 if (giveFocusToParent
giveFocusToParentDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1899-
1900 if (!inDestructor
!inDestructorDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1901 QGraphicsItem *p = parent;-
1902 while (p
pDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1903 if (p->flags() & QGraphicsItem::ItemIsFocusScope
p->flags() & Q...emIsFocusScopeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1904 if (p->d_ptr->focusScopeItem == q_ptr
p->d_ptr->focu...eItem == q_ptrDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1905 p->d_ptr->focusScopeItem = 0;-
1906 if (!subFocusItem->hasFocus()
!subFocusItem->hasFocus()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1907 focusScopeItemChange(false);
never executed: focusScopeItemChange(false);
0
1908 }
never executed: end of block
0
1909 if (subFocusItem->hasFocus()
subFocusItem->hasFocus()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1910 p->d_ptr->setFocusHelper(Qt::OtherFocusReason, false,
never executed: p->d_ptr->setFocusHelper(Qt::OtherFocusReason, false, false);
0
1911 false);
never executed: p->d_ptr->setFocusHelper(Qt::OtherFocusReason, false, false);
0
1912 return;
never executed: return;
0
1913 }-
1914 p = p->d_ptr->parent;-
1915 }
never executed: end of block
0
1916 }
never executed: end of block
0
1917 }
never executed: end of block
0
1918-
1919 if (subFocusItem->hasFocus()
subFocusItem->hasFocus()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1920-
1921 if (!hiddenByParentPanel
!hiddenByParentPanelDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1922 clearSubFocus(q_ptr);
never executed: clearSubFocus(q_ptr);
0
1923-
1924-
1925 scene->setFocusItem(0);-
1926 }
never executed: end of block
0
1927}
never executed: end of block
0
1928QGraphicsItem *QGraphicsItem::focusProxy() const-
1929{-
1930 return
never executed: return d_ptr->focusProxy;
d_ptr->focusProxy;
never executed: return d_ptr->focusProxy;
0
1931}-
1932void QGraphicsItem::setFocusProxy(QGraphicsItem *item)-
1933{-
1934 if (item == d_ptr->focusProxy
item == d_ptr->focusProxyDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1935 return;
never executed: return;
0
1936 if (item == this
item == thisDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1937 QMessageLogger(__FILE__, 3539, __PRETTY_FUNCTION__).warning("QGraphicsItem::setFocusProxy: cannot assign self as focus proxy");-
1938 return;
never executed: return;
0
1939 }-
1940 if (item
itemDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1941 if (item->d_ptr->scene != d_ptr->scene
item->d_ptr->s...= d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1942 QMessageLogger(__FILE__, 3544, __PRETTY_FUNCTION__).warning("QGraphicsItem::setFocusProxy: focus proxy must be in same scene");-
1943 return;
never executed: return;
0
1944 }-
1945 for (QGraphicsItem *f = item->focusProxy(); f != 0
f != 0Description
TRUEnever evaluated
FALSEnever evaluated
; f = f->focusProxy()) {
0
1946 if (f == this
f == thisDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1947 QMessageLogger(__FILE__, 3549, __PRETTY_FUNCTION__).warning("QGraphicsItem::setFocusProxy: %p is already in the focus proxy chain", item);-
1948 return;
never executed: return;
0
1949 }-
1950 }
never executed: end of block
0
1951 }
never executed: end of block
0
1952-
1953 QGraphicsItem *lastFocusProxy = d_ptr->focusProxy;-
1954 if (lastFocusProxy
lastFocusProxyDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1955 lastFocusProxy->d_ptr->focusProxyRefs.removeOne(&d_ptr->focusProxy);
never executed: lastFocusProxy->d_ptr->focusProxyRefs.removeOne(&d_ptr->focusProxy);
0
1956 d_ptr->focusProxy = item;-
1957 if (item
itemDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1958 item->d_ptr->focusProxyRefs << &d_ptr->focusProxy;
never executed: item->d_ptr->focusProxyRefs << &d_ptr->focusProxy;
0
1959}
never executed: end of block
0
1960QGraphicsItem *QGraphicsItem::focusItem() const-
1961{-
1962 return
never executed: return d_ptr->subFocusItem;
d_ptr->subFocusItem;
never executed: return d_ptr->subFocusItem;
0
1963}-
1964-
1965-
1966-
1967-
1968-
1969-
1970QGraphicsItem *QGraphicsItem::focusScopeItem() const-
1971{-
1972 return
never executed: return d_ptr->focusScopeItem;
d_ptr->focusScopeItem;
never executed: return d_ptr->focusScopeItem;
0
1973}-
1974void QGraphicsItem::grabMouse()-
1975{-
1976 if (!d_ptr->scene
!d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1977 QMessageLogger(__FILE__, 3624, __PRETTY_FUNCTION__).warning("QGraphicsItem::grabMouse: cannot grab mouse without scene");-
1978 return;
never executed: return;
0
1979 }-
1980 if (!d_ptr->visible
!d_ptr->visibleDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1981 QMessageLogger(__FILE__, 3628, __PRETTY_FUNCTION__).warning("QGraphicsItem::grabMouse: cannot grab mouse while invisible");-
1982 return;
never executed: return;
0
1983 }-
1984 d_ptr->scene->d_func()->grabMouse(this);-
1985}
never executed: end of block
0
1986-
1987-
1988-
1989-
1990-
1991-
1992-
1993void QGraphicsItem::ungrabMouse()-
1994{-
1995 if (!d_ptr->scene
!d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1996 QMessageLogger(__FILE__, 3643, __PRETTY_FUNCTION__).warning("QGraphicsItem::ungrabMouse: cannot ungrab mouse without scene");-
1997 return;
never executed: return;
0
1998 }-
1999 d_ptr->scene->d_func()->ungrabMouse(this);-
2000}
never executed: end of block
0
2001void QGraphicsItem::grabKeyboard()-
2002{-
2003 if (!d_ptr->scene
!d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2004 QMessageLogger(__FILE__, 3686, __PRETTY_FUNCTION__).warning("QGraphicsItem::grabKeyboard: cannot grab keyboard without scene");-
2005 return;
never executed: return;
0
2006 }-
2007 if (!d_ptr->visible
!d_ptr->visibleDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2008 QMessageLogger(__FILE__, 3690, __PRETTY_FUNCTION__).warning("QGraphicsItem::grabKeyboard: cannot grab keyboard while invisible");-
2009 return;
never executed: return;
0
2010 }-
2011 d_ptr->scene->d_func()->grabKeyboard(this);-
2012}
never executed: end of block
0
2013-
2014-
2015-
2016-
2017-
2018-
2019-
2020void QGraphicsItem::ungrabKeyboard()-
2021{-
2022 if (!d_ptr->scene
!d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2023 QMessageLogger(__FILE__, 3705, __PRETTY_FUNCTION__).warning("QGraphicsItem::ungrabKeyboard: cannot ungrab keyboard without scene");-
2024 return;
never executed: return;
0
2025 }-
2026 d_ptr->scene->d_func()->ungrabKeyboard(this);-
2027}
never executed: end of block
0
2028QPointF QGraphicsItem::pos() const-
2029{-
2030 return
never executed: return d_ptr->pos;
d_ptr->pos;
never executed: return d_ptr->pos;
0
2031}-
2032void QGraphicsItem::setX(qreal x)-
2033{-
2034 if (d_ptr->inDestructor
d_ptr->inDestructorDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2035 return;
never executed: return;
0
2036-
2037 if (qIsNaN(x)
qIsNaN(x)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2038 return;
never executed: return;
0
2039-
2040 setPos(QPointF(x, d_ptr->pos.y()));-
2041}
never executed: end of block
0
2042void QGraphicsItem::setY(qreal y)-
2043{-
2044 if (d_ptr->inDestructor
d_ptr->inDestructorDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2045 return;
never executed: return;
0
2046-
2047 if (qIsNaN(y)
qIsNaN(y)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2048 return;
never executed: return;
0
2049-
2050 setPos(QPointF(d_ptr->pos.x(), y));-
2051}
never executed: end of block
0
2052-
2053-
2054-
2055-
2056-
2057-
2058-
2059QPointF QGraphicsItem::scenePos() const-
2060{-
2061 return
never executed: return mapToScene(0, 0);
mapToScene(0, 0);
never executed: return mapToScene(0, 0);
0
2062}-
2063-
2064-
2065-
2066-
2067-
2068-
2069void QGraphicsItemPrivate::setPosHelper(const QPointF &pos)-
2070{-
2071 QGraphicsItem * const q = q_func();-
2072 inSetPosHelper = 1;-
2073 if (scene
sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2074 q->prepareGeometryChange();
never executed: q->prepareGeometryChange();
0
2075 QPointF oldPos = this->pos;-
2076 this->pos = pos;-
2077 dirtySceneTransform = 1;-
2078 inSetPosHelper = 0;-
2079 if (isObject
isObjectDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2080 if (pos.x() != oldPos.x()
pos.x() != oldPos.x()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2081 static_cast<
never executed: static_cast<QGraphicsObject *>(q_ptr)->xChanged();
QGraphicsObject *>(q_ptr)->xChanged();
never executed: static_cast<QGraphicsObject *>(q_ptr)->xChanged();
0
2082 if (pos.y() != oldPos.y()
pos.y() != oldPos.y()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2083 static_cast<
never executed: static_cast<QGraphicsObject *>(q_ptr)->yChanged();
QGraphicsObject *>(q_ptr)->yChanged();
never executed: static_cast<QGraphicsObject *>(q_ptr)->yChanged();
0
2084 }
never executed: end of block
0
2085}
never executed: end of block
0
2086-
2087-
2088-
2089-
2090-
2091-
2092void QGraphicsItemPrivate::setTransformHelper(const QTransform &transform)-
2093{-
2094 q_ptr->prepareGeometryChange();-
2095 transformData->transform = transform;-
2096 dirtySceneTransform = 1;-
2097 transformChanged();-
2098}
never executed: end of block
0
2099void QGraphicsItem::setPos(const QPointF &pos)-
2100{-
2101 if (d_ptr->pos == pos
d_ptr->pos == posDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2102 return;
never executed: return;
0
2103-
2104 if (d_ptr->inDestructor
d_ptr->inDestructorDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2105 return;
never executed: return;
0
2106-
2107-
2108 if (!(d_ptr->flags & (ItemSendsGeometryChanges | ItemSendsScenePositionChanges))
!(d_ptr->flags...itionChanges))Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2109 d_ptr->setPosHelper(pos);-
2110 if (d_ptr->isWidget
d_ptr->isWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2111 static_cast<
never executed: static_cast<QGraphicsWidget *>(this)->d_func()->setGeometryFromSetPos();
QGraphicsWidget *>(this)->d_func()->setGeometryFromSetPos();
never executed: static_cast<QGraphicsWidget *>(this)->d_func()->setGeometryFromSetPos();
0
2112 if (d_ptr->scenePosDescendants
d_ptr->scenePosDescendantsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2113 d_ptr->sendScenePosChange();
never executed: d_ptr->sendScenePosChange();
0
2114 return;
never executed: return;
0
2115 }-
2116-
2117-
2118 const QVariant newPosVariant(itemChange(ItemPositionChange, QVariant::fromValue<QPointF>(pos)));-
2119 QPointF newPos = newPosVariant.toPointF();-
2120 if (newPos == d_ptr->pos
newPos == d_ptr->posDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2121 return;
never executed: return;
0
2122-
2123-
2124 d_ptr->setPosHelper(newPos);-
2125-
2126-
2127 itemChange(QGraphicsItem::ItemPositionHasChanged, newPosVariant);-
2128 d_ptr->sendScenePosChange();-
2129}
never executed: end of block
0
2130void QGraphicsItem::ensureVisible(const QRectF &rect, int xmargin, int ymargin)-
2131{-
2132 if (d_ptr->scene
d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2133 QRectF sceneRect;-
2134 if (!rect.isNull()
!rect.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2135 sceneRect = sceneTransform().mapRect(rect);
never executed: sceneRect = sceneTransform().mapRect(rect);
0
2136 else-
2137 sceneRect = sceneBoundingRect();
never executed: sceneRect = sceneBoundingRect();
0
2138 for (QForeachContainer<typename QtPrivate::remove_reference<decltype(d_ptr->scene->d_func()->views)>::type> _container_((d_ptr->scene->d_func()->views)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QGraphicsView *view = *_container_.i; _container_.control; _container_.control = 0)-
2139 view->ensureVisible(sceneRect, xmargin, ymargin);
never executed: view->ensureVisible(sceneRect, xmargin, ymargin);
0
2140 }
never executed: end of block
0
2141}
never executed: end of block
0
2142QMatrix QGraphicsItem::matrix() const-
2143{-
2144 return
never executed: return transform().toAffine();
transform().toAffine();
never executed: return transform().toAffine();
0
2145}-
2146QTransform QGraphicsItem::transform() const-
2147{-
2148 if (!d_ptr->transformData
!d_ptr->transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2149 return
never executed: return QTransform();
QTransform();
never executed: return QTransform();
0
2150 return
never executed: return d_ptr->transformData->transform;
d_ptr->transformData->transform;
never executed: return d_ptr->transformData->transform;
0
2151}-
2152qreal QGraphicsItem::rotation() const-
2153{-
2154 if (!d_ptr->transformData
!d_ptr->transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2155 return
never executed: return 0;
0;
never executed: return 0;
0
2156 return
never executed: return d_ptr->transformData->rotation;
d_ptr->transformData->rotation;
never executed: return d_ptr->transformData->rotation;
0
2157}-
2158void QGraphicsItem::setRotation(qreal angle)-
2159{-
2160 prepareGeometryChange();-
2161 qreal newRotation = angle;-
2162-
2163 if (d_ptr->flags & ItemSendsGeometryChanges
d_ptr->flags &...eometryChangesDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2164-
2165 const QVariant newRotationVariant(itemChange(ItemRotationChange, angle));-
2166 newRotation = newRotationVariant.toReal();-
2167 }
never executed: end of block
0
2168-
2169 if (!d_ptr->transformData
!d_ptr->transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2170 d_ptr->transformData = new QGraphicsItemPrivate::TransformData;
never executed: d_ptr->transformData = new QGraphicsItemPrivate::TransformData;
0
2171-
2172 if (d_ptr->transformData->rotation == newRotation
d_ptr->transfo...== newRotationDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2173 return;
never executed: return;
0
2174-
2175 d_ptr->transformData->rotation = newRotation;-
2176 d_ptr->transformData->onlyTransform = false;-
2177 d_ptr->dirtySceneTransform = 1;-
2178-
2179-
2180 if (d_ptr->flags & ItemSendsGeometryChanges
d_ptr->flags &...eometryChangesDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2181 itemChange(ItemRotationHasChanged, newRotation);
never executed: itemChange(ItemRotationHasChanged, newRotation);
0
2182-
2183 if (d_ptr->isObject
d_ptr->isObjectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2184 static_cast<
never executed: static_cast<QGraphicsObject *>(this)->rotationChanged();
QGraphicsObject *>(this)->rotationChanged();
never executed: static_cast<QGraphicsObject *>(this)->rotationChanged();
0
2185-
2186 d_ptr->transformChanged();-
2187}
never executed: end of block
0
2188qreal QGraphicsItem::scale() const-
2189{-
2190 if (!d_ptr->transformData
!d_ptr->transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2191 return
never executed: return 1.;
1.;
never executed: return 1.;
0
2192 return
never executed: return d_ptr->transformData->scale;
d_ptr->transformData->scale;
never executed: return d_ptr->transformData->scale;
0
2193}-
2194void QGraphicsItem::setScale(qreal factor)-
2195{-
2196 prepareGeometryChange();-
2197 qreal newScale = factor;-
2198-
2199 if (d_ptr->flags & ItemSendsGeometryChanges
d_ptr->flags &...eometryChangesDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2200-
2201 const QVariant newScaleVariant(itemChange(ItemScaleChange, factor));-
2202 newScale = newScaleVariant.toReal();-
2203 }
never executed: end of block
0
2204-
2205 if (!d_ptr->transformData
!d_ptr->transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2206 d_ptr->transformData = new QGraphicsItemPrivate::TransformData;
never executed: d_ptr->transformData = new QGraphicsItemPrivate::TransformData;
0
2207-
2208 if (d_ptr->transformData->scale == newScale
d_ptr->transfo...le == newScaleDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2209 return;
never executed: return;
0
2210-
2211 d_ptr->transformData->scale = newScale;-
2212 d_ptr->transformData->onlyTransform = false;-
2213 d_ptr->dirtySceneTransform = 1;-
2214-
2215-
2216 if (d_ptr->flags & ItemSendsGeometryChanges
d_ptr->flags &...eometryChangesDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2217 itemChange(ItemScaleHasChanged, newScale);
never executed: itemChange(ItemScaleHasChanged, newScale);
0
2218-
2219 if (d_ptr->isObject
d_ptr->isObjectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2220 static_cast<
never executed: static_cast<QGraphicsObject *>(this)->scaleChanged();
QGraphicsObject *>(this)->scaleChanged();
never executed: static_cast<QGraphicsObject *>(this)->scaleChanged();
0
2221-
2222 d_ptr->transformChanged();-
2223}
never executed: end of block
0
2224QList<QGraphicsTransform *> QGraphicsItem::transformations() const-
2225{-
2226 if (!d_ptr->transformData
!d_ptr->transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2227 return
never executed: return QList<QGraphicsTransform *>();
QList<QGraphicsTransform *>();
never executed: return QList<QGraphicsTransform *>();
0
2228 return
never executed: return d_ptr->transformData->graphicsTransforms;
d_ptr->transformData->graphicsTransforms;
never executed: return d_ptr->transformData->graphicsTransforms;
0
2229}-
2230void QGraphicsItem::setTransformations(const QList<QGraphicsTransform *> &transformations)-
2231{-
2232 prepareGeometryChange();-
2233 if (!d_ptr->transformData
!d_ptr->transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2234 d_ptr->transformData = new QGraphicsItemPrivate::TransformData;
never executed: d_ptr->transformData = new QGraphicsItemPrivate::TransformData;
0
2235 d_ptr->transformData->graphicsTransforms = transformations;-
2236 for (int i = 0; i < transformations.size()
i < transformations.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
2237 transformations.at(i)->d_func()->setItem(this);
never executed: transformations.at(i)->d_func()->setItem(this);
0
2238 d_ptr->transformData->onlyTransform = false;-
2239 d_ptr->dirtySceneTransform = 1;-
2240 d_ptr->transformChanged();-
2241}
never executed: end of block
0
2242-
2243-
2244-
2245-
2246void QGraphicsItemPrivate::prependGraphicsTransform(QGraphicsTransform *t)-
2247{-
2248 if (!transformData
!transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2249 transformData = new QGraphicsItemPrivate::TransformData;
never executed: transformData = new QGraphicsItemPrivate::TransformData;
0
2250 if (!transformData->graphicsTransforms.contains(t)
!transformData...ms.contains(t)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2251 transformData->graphicsTransforms.prepend(t);
never executed: transformData->graphicsTransforms.prepend(t);
0
2252-
2253 QGraphicsItem * const q = q_func();-
2254 t->d_func()->setItem(q);-
2255 transformData->onlyTransform = false;-
2256 dirtySceneTransform = 1;-
2257 transformChanged();-
2258}
never executed: end of block
0
2259-
2260-
2261-
2262-
2263void QGraphicsItemPrivate::appendGraphicsTransform(QGraphicsTransform *t)-
2264{-
2265 if (!transformData
!transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2266 transformData = new QGraphicsItemPrivate::TransformData;
never executed: transformData = new QGraphicsItemPrivate::TransformData;
0
2267 if (!transformData->graphicsTransforms.contains(t)
!transformData...ms.contains(t)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2268 transformData->graphicsTransforms.append(t);
never executed: transformData->graphicsTransforms.append(t);
0
2269-
2270 QGraphicsItem * const q = q_func();-
2271 t->d_func()->setItem(q);-
2272 transformData->onlyTransform = false;-
2273 dirtySceneTransform = 1;-
2274 transformChanged();-
2275}
never executed: end of block
0
2276QPointF QGraphicsItem::transformOriginPoint() const-
2277{-
2278 if (!d_ptr->transformData
!d_ptr->transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2279 return
never executed: return QPointF(0,0);
QPointF(0,0);
never executed: return QPointF(0,0);
0
2280 return
never executed: return QPointF(d_ptr->transformData->xOrigin, d_ptr->transformData->yOrigin);
QPointF(d_ptr->transformData->xOrigin, d_ptr->transformData->yOrigin);
never executed: return QPointF(d_ptr->transformData->xOrigin, d_ptr->transformData->yOrigin);
0
2281}-
2282void QGraphicsItem::setTransformOriginPoint(const QPointF &origin)-
2283{-
2284 prepareGeometryChange();-
2285 QPointF newOrigin = origin;-
2286-
2287 if (d_ptr->flags & ItemSendsGeometryChanges
d_ptr->flags &...eometryChangesDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2288-
2289 const QVariant newOriginVariant(itemChange(ItemTransformOriginPointChange,-
2290 QVariant::fromValue<QPointF>(origin)));-
2291 newOrigin = newOriginVariant.toPointF();-
2292 }
never executed: end of block
0
2293-
2294 if (!d_ptr->transformData
!d_ptr->transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2295 d_ptr->transformData = new QGraphicsItemPrivate::TransformData;
never executed: d_ptr->transformData = new QGraphicsItemPrivate::TransformData;
0
2296-
2297 if (d_ptr->transformData->xOrigin == newOrigin.x()
d_ptr->transfo... newOrigin.x()Description
TRUEnever evaluated
FALSEnever evaluated
0
2298 && d_ptr->transformData->yOrigin == newOrigin.y()
d_ptr->transfo... newOrigin.y()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2299 return;
never executed: return;
0
2300 }-
2301-
2302 d_ptr->transformData->xOrigin = newOrigin.x();-
2303 d_ptr->transformData->yOrigin = newOrigin.y();-
2304 d_ptr->transformData->onlyTransform = false;-
2305 d_ptr->dirtySceneTransform = 1;-
2306-
2307-
2308 if (d_ptr->flags & ItemSendsGeometryChanges
d_ptr->flags &...eometryChangesDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2309 itemChange(ItemTransformOriginPointHasChanged, QVariant::fromValue<QPointF>(newOrigin));
never executed: itemChange(ItemTransformOriginPointHasChanged, QVariant::fromValue<QPointF>(newOrigin));
0
2310}
never executed: end of block
0
2311QMatrix QGraphicsItem::sceneMatrix() const-
2312{-
2313 d_ptr->ensureSceneTransform();-
2314 return
never executed: return d_ptr->sceneTransform.toAffine();
d_ptr->sceneTransform.toAffine();
never executed: return d_ptr->sceneTransform.toAffine();
0
2315}-
2316QTransform QGraphicsItem::sceneTransform() const-
2317{-
2318 d_ptr->ensureSceneTransform();-
2319 return
never executed: return d_ptr->sceneTransform;
d_ptr->sceneTransform;
never executed: return d_ptr->sceneTransform;
0
2320}-
2321QTransform QGraphicsItem::deviceTransform(const QTransform &viewportTransform) const-
2322{-
2323-
2324 if (!d_ptr->itemIsUntransformable()
!d_ptr->itemIs...ransformable()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2325 d_ptr->ensureSceneTransform();-
2326 return
never executed: return d_ptr->sceneTransform * viewportTransform;
d_ptr->sceneTransform * viewportTransform;
never executed: return d_ptr->sceneTransform * viewportTransform;
0
2327 }-
2328-
2329-
2330 const QGraphicsItem *untransformedAncestor = this;-
2331 QList<const QGraphicsItem *> parents;-
2332 while (untransformedAncestor
untransformedAncestorDescription
TRUEnever evaluated
FALSEnever evaluated
&& ((
((untransforme...nsformations))Description
TRUEnever evaluated
FALSEnever evaluated
untransformedAncestor->d_ptr->ancestorFlags
((untransforme...nsformations))Description
TRUEnever evaluated
FALSEnever evaluated
0
2333 & QGraphicsItemPrivate::AncestorIgnoresTransformations))
((untransforme...nsformations))Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2334 parents.prepend(untransformedAncestor);-
2335 untransformedAncestor = untransformedAncestor->parentItem();-
2336 }
never executed: end of block
0
2337-
2338 if (!untransformedAncestor
!untransformedAncestorDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2339-
2340 ((!(untransformedAncestor)) ? qt_assert_x("QGraphicsItem::deviceTransform", "Invalid object structure!",-
2341 __FILE__-
2342 ,-
2343 4328-
2344 ) : qt_noop())-
2345 ;-
2346 return
never executed: return QTransform();
QTransform();
never executed: return QTransform();
0
2347 }-
2348-
2349-
2350-
2351-
2352 QGraphicsItem *parentOfUntransformedAncestor = untransformedAncestor->parentItem();-
2353 QTransform inheritedMatrix;-
2354 if (parentOfUntransformedAncestor
parentOfUntransformedAncestorDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2355 inheritedMatrix = parentOfUntransformedAncestor->sceneTransform();
never executed: inheritedMatrix = parentOfUntransformedAncestor->sceneTransform();
0
2356 QPointF mappedPoint = (inheritedMatrix * viewportTransform).map(untransformedAncestor->pos());-
2357-
2358-
2359 QTransform matrix = QTransform::fromTranslate(mappedPoint.x(), mappedPoint.y());-
2360 if (untransformedAncestor->d_ptr->transformData
untransformedA...>transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2361 matrix = untransformedAncestor->d_ptr->transformData->computedFullTransform(&matrix);
never executed: matrix = untransformedAncestor->d_ptr->transformData->computedFullTransform(&matrix);
0
2362-
2363-
2364 for (int i = 0; i < parents.size()
i < parents.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
2365 const QGraphicsItem *parent = parents.at(i);-
2366 parent->d_ptr->combineTransformFromParent(&matrix);-
2367 }
never executed: end of block
0
2368-
2369 return
never executed: return matrix;
matrix;
never executed: return matrix;
0
2370}-
2371QTransform QGraphicsItem::itemTransform(const QGraphicsItem *other, bool *ok) const-
2372{-
2373-
2374 if (other == 0
other == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2375 QMessageLogger(__FILE__, 4376, __PRETTY_FUNCTION__).warning("QGraphicsItem::itemTransform: null pointer passed");-
2376 return
never executed: return QTransform();
QTransform();
never executed: return QTransform();
0
2377 }-
2378 if (other == this
other == thisDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2379 if (ok
okDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2380 *
never executed: *ok = true;
ok = true;
never executed: *ok = true;
0
2381 return
never executed: return QTransform();
QTransform();
never executed: return QTransform();
0
2382 }-
2383-
2384 QGraphicsItem *parent = d_ptr->parent;-
2385 const QGraphicsItem *otherParent = other->d_ptr->parent;-
2386-
2387-
2388 if (parent == other
parent == otherDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2389 if (ok
okDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2390 *
never executed: *ok = true;
ok = true;
never executed: *ok = true;
0
2391 QTransform x;-
2392 d_ptr->combineTransformFromParent(&x);-
2393 return
never executed: return x;
x;
never executed: return x;
0
2394 }-
2395-
2396-
2397 if (otherParent == this
otherParent == thisDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2398 const QPointF &otherPos = other->d_ptr->pos;-
2399 if (other->d_ptr->transformData
other->d_ptr->transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2400 QTransform otherToParent;-
2401 other->d_ptr->combineTransformFromParent(&otherToParent);-
2402 return
never executed: return otherToParent.inverted(ok);
otherToParent.inverted(ok);
never executed: return otherToParent.inverted(ok);
0
2403 }-
2404 if (ok
okDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2405 *
never executed: *ok = true;
ok = true;
never executed: *ok = true;
0
2406 return
never executed: return QTransform::fromTranslate(-otherPos.x(), -otherPos.y());
QTransform::fromTranslate(-otherPos.x(), -otherPos.y());
never executed: return QTransform::fromTranslate(-otherPos.x(), -otherPos.y());
0
2407 }-
2408-
2409-
2410 if (parent == otherParent
parent == otherParentDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2411-
2412 const QPointF &itemPos = d_ptr->pos;-
2413 const QPointF &otherPos = other->d_ptr->pos;-
2414 if (!d_ptr->transformData
!d_ptr->transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
&& !other->d_ptr->transformData
!other->d_ptr->transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2415 QPointF delta = itemPos - otherPos;-
2416 if (ok
okDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2417 *
never executed: *ok = true;
ok = true;
never executed: *ok = true;
0
2418 return
never executed: return QTransform::fromTranslate(delta.x(), delta.y());
QTransform::fromTranslate(delta.x(), delta.y());
never executed: return QTransform::fromTranslate(delta.x(), delta.y());
0
2419 }-
2420-
2421 QTransform itemToParent;-
2422 d_ptr->combineTransformFromParent(&itemToParent);-
2423 QTransform otherToParent;-
2424 other->d_ptr->combineTransformFromParent(&otherToParent);-
2425 return
never executed: return itemToParent * otherToParent.inverted(ok);
itemToParent * otherToParent.inverted(ok);
never executed: return itemToParent * otherToParent.inverted(ok);
0
2426 }-
2427-
2428-
2429-
2430 const QGraphicsItem *commonAncestor = commonAncestorItem(other);-
2431 if (!commonAncestor
!commonAncestorDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2432 d_ptr->ensureSceneTransform();-
2433 other->d_ptr->ensureSceneTransform();-
2434 return
never executed: return d_ptr->sceneTransform * other->d_ptr->sceneTransform.inverted(ok);
d_ptr->sceneTransform * other->d_ptr->sceneTransform.inverted(ok);
never executed: return d_ptr->sceneTransform * other->d_ptr->sceneTransform.inverted(ok);
0
2435 }-
2436-
2437-
2438-
2439 bool cousins = other != commonAncestor
other != commonAncestorDescription
TRUEnever evaluated
FALSEnever evaluated
&& this != commonAncestor
this != commonAncestorDescription
TRUEnever evaluated
FALSEnever evaluated
;
0
2440 if (cousins
cousinsDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2441 bool good = false;-
2442 QTransform thisToScene = itemTransform(commonAncestor, &good);-
2443 QTransform otherToScene(Qt::Uninitialized);-
2444 if (good
goodDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2445 otherToScene = other->itemTransform(commonAncestor, &good);
never executed: otherToScene = other->itemTransform(commonAncestor, &good);
0
2446 if (!good
!goodDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2447 if (ok
okDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2448 *
never executed: *ok = false;
ok = false;
never executed: *ok = false;
0
2449 return
never executed: return QTransform();
QTransform();
never executed: return QTransform();
0
2450 }-
2451 return
never executed: return thisToScene * otherToScene.inverted(ok);
thisToScene * otherToScene.inverted(ok);
never executed: return thisToScene * otherToScene.inverted(ok);
0
2452 }-
2453-
2454-
2455 bool parentOfOther = isAncestorOf(other);-
2456 const QGraphicsItem *child = parentOfOther
parentOfOtherDescription
TRUEnever evaluated
FALSEnever evaluated
? other : this;
0
2457 const QGraphicsItem *root = parentOfOther
parentOfOtherDescription
TRUEnever evaluated
FALSEnever evaluated
? this : other;
0
2458-
2459 QTransform x;-
2460 const QGraphicsItem *p = child;-
2461 do {-
2462 p->d_ptr.data()->combineTransformToParent(&x);-
2463 }
never executed: end of block
while ((
(p = p->d_ptr->parent)Description
TRUEnever evaluated
FALSEnever evaluated
p = p->d_ptr->parent)
(p = p->d_ptr->parent)Description
TRUEnever evaluated
FALSEnever evaluated
&& p != root
p != rootDescription
TRUEnever evaluated
FALSEnever evaluated
);
0
2464 if (parentOfOther
parentOfOtherDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2465 return
never executed: return x.inverted(ok);
x.inverted(ok);
never executed: return x.inverted(ok);
0
2466 if (ok
okDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2467 *
never executed: *ok = true;
ok = true;
never executed: *ok = true;
0
2468 return
never executed: return x;
x;
never executed: return x;
0
2469}-
2470void QGraphicsItem::setMatrix(const QMatrix &matrix, bool combine)-
2471{-
2472 if (!d_ptr->transformData
!d_ptr->transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2473 d_ptr->transformData = new QGraphicsItemPrivate::TransformData;
never executed: d_ptr->transformData = new QGraphicsItemPrivate::TransformData;
0
2474-
2475 QTransform newTransform(combine ? QTransform(matrix) * d_ptr->transformData->transform : QTransform(matrix));-
2476 if (d_ptr->transformData->transform == newTransform
d_ptr->transfo...= newTransformDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2477 return;
never executed: return;
0
2478-
2479-
2480 if (!(d_ptr->flags & ItemSendsGeometryChanges)
!(d_ptr->flags...ometryChanges)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2481 d_ptr->setTransformHelper(newTransform);-
2482 return;
never executed: return;
0
2483 }-
2484-
2485-
2486 const QVariant newMatrixVariant = QVariant::fromValue<QMatrix>(newTransform.toAffine());-
2487 newTransform = QTransform(qvariant_cast<QMatrix>(itemChange(ItemMatrixChange, newMatrixVariant)));-
2488 if (d_ptr->transformData->transform == newTransform
d_ptr->transfo...= newTransformDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2489 return;
never executed: return;
0
2490-
2491-
2492 d_ptr->setTransformHelper(newTransform);-
2493-
2494-
2495 itemChange(ItemTransformHasChanged, QVariant::fromValue<QTransform>(newTransform));-
2496}
never executed: end of block
0
2497void QGraphicsItem::setTransform(const QTransform &matrix, bool combine)-
2498{-
2499 if (!d_ptr->transformData
!d_ptr->transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2500 d_ptr->transformData = new QGraphicsItemPrivate::TransformData;
never executed: d_ptr->transformData = new QGraphicsItemPrivate::TransformData;
0
2501-
2502 QTransform newTransform(combine ? matrix * d_ptr->transformData->transform : matrix);-
2503 if (d_ptr->transformData->transform == newTransform
d_ptr->transfo...= newTransformDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2504 return;
never executed: return;
0
2505-
2506-
2507 if (!(d_ptr->flags & (ItemSendsGeometryChanges | ItemSendsScenePositionChanges))
!(d_ptr->flags...itionChanges))Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2508 d_ptr->setTransformHelper(newTransform);-
2509 if (d_ptr->scenePosDescendants
d_ptr->scenePosDescendantsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2510 d_ptr->sendScenePosChange();
never executed: d_ptr->sendScenePosChange();
0
2511 return;
never executed: return;
0
2512 }-
2513-
2514-
2515 const QVariant newTransformVariant(itemChange(ItemTransformChange,-
2516 QVariant::fromValue<QTransform>(newTransform)));-
2517 newTransform = qvariant_cast<QTransform>(newTransformVariant);-
2518 if (d_ptr->transformData->transform == newTransform
d_ptr->transfo...= newTransformDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2519 return;
never executed: return;
0
2520-
2521-
2522 d_ptr->setTransformHelper(newTransform);-
2523-
2524-
2525 itemChange(ItemTransformHasChanged, newTransformVariant);-
2526 d_ptr->sendScenePosChange();-
2527}
never executed: end of block
0
2528-
2529-
2530-
2531-
2532-
2533-
2534void QGraphicsItem::resetMatrix()-
2535{-
2536 resetTransform();-
2537}
never executed: end of block
0
2538void QGraphicsItem::resetTransform()-
2539{-
2540 setTransform(QTransform(), false);-
2541}
never executed: end of block
0
2542void QGraphicsItem::advance(int phase)-
2543{-
2544 (void)phase;;-
2545}
never executed: end of block
0
2546qreal QGraphicsItem::zValue() const-
2547{-
2548 return
never executed: return d_ptr->z;
d_ptr->z;
never executed: return d_ptr->z;
0
2549}-
2550void QGraphicsItem::setZValue(qreal z)-
2551{-
2552 const QVariant newZVariant(itemChange(ItemZValueChange, z));-
2553 qreal newZ = newZVariant.toReal();-
2554 if (newZ == d_ptr->z
newZ == d_ptr->zDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2555 return;
never executed: return;
0
2556-
2557 if (d_ptr->scene
d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
&& d_ptr->scene->d_func()->indexMethod != QGraphicsScene::NoIndex
d_ptr->scene->...Scene::NoIndexDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2558-
2559 d_ptr->scene->d_func()->index->itemChange(this, ItemZValueChange, &newZ);-
2560 }
never executed: end of block
0
2561-
2562 d_ptr->z = newZ;-
2563 if (d_ptr->parent
d_ptr->parentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2564 d_ptr->parent->d_ptr->needSortChildren = 1;
never executed: d_ptr->parent->d_ptr->needSortChildren = 1;
0
2565 else if (d_ptr->scene
d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2566 d_ptr->scene->d_func()->needSortTopLevelItems = 1;
never executed: d_ptr->scene->d_func()->needSortTopLevelItems = 1;
0
2567-
2568 if (d_ptr->scene
d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2569 d_ptr->scene->d_func()->markDirty(this, QRectF(), true);
never executed: d_ptr->scene->d_func()->markDirty(this, QRectF(), true);
0
2570-
2571 itemChange(ItemZValueHasChanged, newZVariant);-
2572-
2573 if (d_ptr->flags & ItemNegativeZStacksBehindParent
d_ptr->flags &...ksBehindParentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2574 setFlag(QGraphicsItem::ItemStacksBehindParent, z < qreal(0.0));
never executed: setFlag(QGraphicsItem::ItemStacksBehindParent, z < qreal(0.0));
0
2575-
2576 if (d_ptr->isObject
d_ptr->isObjectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2577 static_cast<
never executed: static_cast<QGraphicsObject *>(this)->zChanged();
QGraphicsObject *>(this)->zChanged();
never executed: static_cast<QGraphicsObject *>(this)->zChanged();
0
2578}
never executed: end of block
0
2579void QGraphicsItemPrivate::ensureSequentialSiblingIndex()-
2580{-
2581 if (!sequentialOrdering
!sequentialOrderingDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2582 std::sort(children.begin(), children.end(), insertionOrder);-
2583 sequentialOrdering = 1;-
2584 needSortChildren = 1;-
2585 }
never executed: end of block
0
2586 if (holesInSiblingIndex
holesInSiblingIndexDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2587 holesInSiblingIndex = 0;-
2588 for (int i = 0; i < children.size()
i < children.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
2589 children[i]->d_ptr->siblingIndex = i;
never executed: children[i]->d_ptr->siblingIndex = i;
0
2590 }
never executed: end of block
0
2591}
never executed: end of block
0
2592-
2593-
2594-
2595-
2596inline void QGraphicsItemPrivate::sendScenePosChange()-
2597{-
2598 QGraphicsItem * const q = q_func();-
2599 if (scene
sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2600 if (flags & QGraphicsItem::ItemSendsScenePositionChanges
flags & QGraph...ositionChangesDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2601 q->itemChange(QGraphicsItem::ItemScenePositionHasChanged, q->scenePos());
never executed: q->itemChange(QGraphicsItem::ItemScenePositionHasChanged, q->scenePos());
0
2602 if (scenePosDescendants
scenePosDescendantsDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2603 for (QForeachContainer<typename QtPrivate::remove_reference<decltype(scene->d_func()->scenePosItems)>::type> _container_((scene->d_func()->scenePosItems)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QGraphicsItem *item = *_container_.i; _container_.control; _container_.control = 0) {-
2604 if (q->isAncestorOf(item)
q->isAncestorOf(item)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2605 item->itemChange(QGraphicsItem::ItemScenePositionHasChanged, item->scenePos());
never executed: item->itemChange(QGraphicsItem::ItemScenePositionHasChanged, item->scenePos());
0
2606 }
never executed: end of block
0
2607 }
never executed: end of block
0
2608 }
never executed: end of block
0
2609}
never executed: end of block
0
2610void QGraphicsItem::stackBefore(const QGraphicsItem *sibling)-
2611{-
2612 if (sibling == this
sibling == thisDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2613 return;
never executed: return;
0
2614 if (!sibling
!siblingDescription
TRUEnever evaluated
FALSEnever evaluated
|| d_ptr->parent != sibling->parentItem()
d_ptr->parent ...->parentItem()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2615 QMessageLogger(__FILE__, 4811, __PRETTY_FUNCTION__).warning("QGraphicsItem::stackUnder: cannot stack under %p, which must be a sibling", sibling);-
2616 return;
never executed: return;
0
2617 }-
2618 QList<QGraphicsItem *> *siblings = d_ptr->parent
d_ptr->parentDescription
TRUEnever evaluated
FALSEnever evaluated
0
2619 ? &d_ptr->parent->d_ptr->children-
2620 : (d_ptr->scene
d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
? &d_ptr->scene->d_func()->topLevelItems : 0);
0
2621 if (!siblings
!siblingsDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2622 QMessageLogger(__FILE__, 4818, __PRETTY_FUNCTION__).warning("QGraphicsItem::stackUnder: cannot stack under %p, which must be a sibling", sibling);-
2623 return;
never executed: return;
0
2624 }-
2625-
2626-
2627-
2628 if (d_ptr->parent
d_ptr->parentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2629 d_ptr->parent->d_ptr->ensureSequentialSiblingIndex();
never executed: d_ptr->parent->d_ptr->ensureSequentialSiblingIndex();
0
2630 else-
2631 d_ptr->scene->d_func()->ensureSequentialTopLevelSiblingIndexes();
never executed: d_ptr->scene->d_func()->ensureSequentialTopLevelSiblingIndexes();
0
2632-
2633-
2634 int siblingIndex = sibling->d_ptr->siblingIndex;-
2635 int myIndex = d_ptr->siblingIndex;-
2636 if (myIndex >= siblingIndex
myIndex >= siblingIndexDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2637 siblings->move(myIndex, siblingIndex);-
2638-
2639 for (int i = 0; i < siblings->size()
i < siblings->size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
2640 int &index = siblings->at(i)->d_ptr->siblingIndex;-
2641 if (i != siblingIndex
i != siblingIndexDescription
TRUEnever evaluated
FALSEnever evaluated
&& index >= siblingIndex
index >= siblingIndexDescription
TRUEnever evaluated
FALSEnever evaluated
&& index <= myIndex
index <= myIndexDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2642 ++
never executed: ++index;
index;
never executed: ++index;
0
2643 }
never executed: end of block
0
2644 d_ptr->siblingIndex = siblingIndex;-
2645 for (int i = 0; i < siblings->size()
i < siblings->size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
2646 int &index = siblings->at(i)->d_ptr->siblingIndex;-
2647 if (i != siblingIndex
i != siblingIndexDescription
TRUEnever evaluated
FALSEnever evaluated
&& index >= siblingIndex
index >= siblingIndexDescription
TRUEnever evaluated
FALSEnever evaluated
&& index <= myIndex
index <= myIndexDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2648 siblings->at(i)->d_ptr->siblingOrderChange();
never executed: siblings->at(i)->d_ptr->siblingOrderChange();
0
2649 }
never executed: end of block
0
2650 d_ptr->siblingOrderChange();-
2651 }
never executed: end of block
0
2652}
never executed: end of block
0
2653QRectF QGraphicsItem::childrenBoundingRect() const-
2654{-
2655 if (!d_ptr->dirtyChildrenBoundingRect
!d_ptr->dirtyC...enBoundingRectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2656 return
never executed: return d_ptr->childrenBoundingRect;
d_ptr->childrenBoundingRect;
never executed: return d_ptr->childrenBoundingRect;
0
2657-
2658 d_ptr->childrenBoundingRect = QRectF();-
2659 d_ptr->childrenBoundingRectHelper(0, &d_ptr->childrenBoundingRect, 0);-
2660 d_ptr->dirtyChildrenBoundingRect = 0;-
2661 return
never executed: return d_ptr->childrenBoundingRect;
d_ptr->childrenBoundingRect;
never executed: return d_ptr->childrenBoundingRect;
0
2662}-
2663QRectF QGraphicsItem::sceneBoundingRect() const-
2664{-
2665-
2666-
2667 QPointF offset;-
2668 const QGraphicsItem *parentItem = this;-
2669 const QGraphicsItemPrivate *itemd;-
2670 do {-
2671 itemd = parentItem->d_ptr.data();-
2672 if (itemd->transformData
itemd->transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2673 break;
never executed: break;
0
2674 offset += itemd->pos;-
2675 }
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
2676-
2677 QRectF br = boundingRect();-
2678 br.translate(offset);-
2679 if (!parentItem
!parentItemDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2680 return
never executed: return br;
br;
never executed: return br;
0
2681 if (parentItem->d_ptr->hasTranslateOnlySceneTransform()
parentItem->d_...eneTransform()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2682 br.translate(parentItem->d_ptr->sceneTransform.dx(), parentItem->d_ptr->sceneTransform.dy());-
2683 return
never executed: return br;
br;
never executed: return br;
0
2684 }-
2685 return
never executed: return parentItem->d_ptr->sceneTransform.mapRect(br);
parentItem->d_ptr->sceneTransform.mapRect(br);
never executed: return parentItem->d_ptr->sceneTransform.mapRect(br);
0
2686}-
2687QPainterPath QGraphicsItem::shape() const-
2688{-
2689 QPainterPath path;-
2690 path.addRect(boundingRect());-
2691 return
never executed: return path;
path;
never executed: return path;
0
2692}-
2693bool QGraphicsItem::isClipped() const-
2694{-
2695 const QGraphicsItemPrivate * const d = d_func();-
2696 return
never executed: return (d->ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren) || (d->flags & QGraphicsItem::ItemClipsToShape);
(d->ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren)
never executed: return (d->ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren) || (d->flags & QGraphicsItem::ItemClipsToShape);
0
2697 || (d->flags & QGraphicsItem::ItemClipsToShape);
never executed: return (d->ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren) || (d->flags & QGraphicsItem::ItemClipsToShape);
0
2698}-
2699QPainterPath QGraphicsItem::clipPath() const-
2700{-
2701 const QGraphicsItemPrivate * const d = d_func();-
2702 if (!isClipped()
!isClipped()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2703 return
never executed: return QPainterPath();
QPainterPath();
never executed: return QPainterPath();
0
2704-
2705 const QRectF thisBoundingRect(boundingRect());-
2706 if (thisBoundingRect.isEmpty()
thisBoundingRect.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2707 return
never executed: return QPainterPath();
QPainterPath();
never executed: return QPainterPath();
0
2708-
2709 QPainterPath clip;-
2710-
2711 clip.addRect(thisBoundingRect);-
2712-
2713 if (d->ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren
d->ancestorFla...rClipsChildrenDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2714 const QGraphicsItem *parent = this;-
2715 const QGraphicsItem *lastParent = this;-
2716-
2717-
2718 while ((
(parent = pare...d_ptr->parent)Description
TRUEnever evaluated
FALSEnever evaluated
parent = parent->d_ptr->parent)
(parent = pare...d_ptr->parent)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2719 if (parent->d_ptr->flags & ItemClipsChildrenToShape
parent->d_ptr-...hildrenToShapeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2720-
2721 clip = lastParent->itemTransform(parent).map(clip);-
2722 clip = clip.intersected(parent->shape());-
2723 if (clip.isEmpty()
clip.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2724 return
never executed: return clip;
clip;
never executed: return clip;
0
2725 lastParent = parent;-
2726 }
never executed: end of block
0
2727-
2728 if (!(parent->d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren)
!(parent->d_pt...ClipsChildren)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2729 break;
never executed: break;
0
2730 }
never executed: end of block
0
2731-
2732 if (lastParent != this
lastParent != thisDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2733-
2734-
2735 clip = lastParent->itemTransform(this).map(clip);-
2736 }
never executed: end of block
0
2737 }
never executed: end of block
0
2738-
2739 if (d->flags & ItemClipsToShape
d->flags & ItemClipsToShapeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2740 clip = clip.intersected(shape());
never executed: clip = clip.intersected(shape());
0
2741-
2742 return
never executed: return clip;
clip;
never executed: return clip;
0
2743}-
2744bool QGraphicsItem::contains(const QPointF &point) const-
2745{-
2746 return
never executed: return isClipped() ? clipPath().contains(point) : shape().contains(point);
isClipped() ? clipPath().contains(point) : shape().contains(point);
never executed: return isClipped() ? clipPath().contains(point) : shape().contains(point);
0
2747}-
2748bool QGraphicsItem::collidesWithItem(const QGraphicsItem *other, Qt::ItemSelectionMode mode) const-
2749{-
2750 if (other == this
other == thisDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2751 return
never executed: return true;
true;
never executed: return true;
0
2752 if (!other
!otherDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2753 return
never executed: return false;
false;
never executed: return false;
0
2754-
2755-
2756 bool clips = (d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren);-
2757 bool otherClips = (other->d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren);-
2758 if (clips
clipsDescription
TRUEnever evaluated
FALSEnever evaluated
|| otherClips
otherClipsDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2759 const QGraphicsItem *closestClipper = isAncestorOf(other)
isAncestorOf(other)Description
TRUEnever evaluated
FALSEnever evaluated
? this : parentItem();
0
2760 while (closestClipper
closestClipperDescription
TRUEnever evaluated
FALSEnever evaluated
&& !(closestClipper->flags() & ItemClipsChildrenToShape)
!(closestClipp...ildrenToShape)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2761 closestClipper = closestClipper->parentItem();
never executed: closestClipper = closestClipper->parentItem();
0
2762 const QGraphicsItem *otherClosestClipper = other->isAncestorOf(this)
other->isAncestorOf(this)Description
TRUEnever evaluated
FALSEnever evaluated
? other : other->parentItem();
0
2763 while (otherClosestClipper
otherClosestClipperDescription
TRUEnever evaluated
FALSEnever evaluated
&& !(otherClosestClipper->flags() & ItemClipsChildrenToShape)
!(otherClosest...ildrenToShape)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2764 otherClosestClipper = otherClosestClipper->parentItem();
never executed: otherClosestClipper = otherClosestClipper->parentItem();
0
2765 if (closestClipper == otherClosestClipper
closestClipper...ClosestClipperDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2766 d_ptr->localCollisionHack = 1;-
2767 bool res = collidesWithPath(mapFromItem(other, other->shape()), mode);-
2768 d_ptr->localCollisionHack = 0;-
2769 return
never executed: return res;
res;
never executed: return res;
0
2770 }-
2771 }
never executed: end of block
0
2772-
2773 QPainterPath otherShape = other->isClipped()
other->isClipped()Description
TRUEnever evaluated
FALSEnever evaluated
? other->clipPath() : other->shape();
0
2774 return
never executed: return collidesWithPath(mapFromItem(other, otherShape), mode);
collidesWithPath(mapFromItem(other, otherShape), mode);
never executed: return collidesWithPath(mapFromItem(other, otherShape), mode);
0
2775}-
2776bool QGraphicsItem::collidesWithPath(const QPainterPath &path, Qt::ItemSelectionMode mode) const-
2777{-
2778 if (path.isEmpty()
path.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2779-
2780 return
never executed: return false;
false;
never executed: return false;
0
2781 }-
2782-
2783 QRectF rectA(boundingRect());-
2784 _q_adjustRect(&rectA);-
2785 QRectF rectB(path.controlPointRect());-
2786 _q_adjustRect(&rectB);-
2787 if (!rectA.intersects(rectB)
!rectA.intersects(rectB)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2788-
2789-
2790 return
never executed: return false;
false;
never executed: return false;
0
2791 }-
2792-
2793-
2794 QPainterPath thisShape;-
2795 if (mode == Qt::IntersectsItemShape
mode == Qt::In...sectsItemShapeDescription
TRUEnever evaluated
FALSEnever evaluated
|| mode == Qt::ContainsItemShape
mode == Qt::ContainsItemShapeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2796 thisShape = (isClipped()
isClipped()Description
TRUEnever evaluated
FALSEnever evaluated
&& !d_ptr->localCollisionHack
!d_ptr->localCollisionHackDescription
TRUEnever evaluated
FALSEnever evaluated
) ? clipPath() : shape();
never executed: thisShape = (isClipped() && !d_ptr->localCollisionHack) ? clipPath() : shape();
0
2797 else-
2798 thisShape.addRect(rectA);
never executed: thisShape.addRect(rectA);
0
2799-
2800 if (thisShape == QPainterPath()
thisShape == QPainterPath()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2801-
2802 return
never executed: return false;
false;
never executed: return false;
0
2803 }-
2804-
2805-
2806 if (mode == Qt::IntersectsItemShape
mode == Qt::In...sectsItemShapeDescription
TRUEnever evaluated
FALSEnever evaluated
|| mode == Qt::IntersectsItemBoundingRect
mode == Qt::In...emBoundingRectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2807 return
never executed: return path.intersects(thisShape);
path.intersects(thisShape);
never executed: return path.intersects(thisShape);
0
2808 return
never executed: return path.contains(thisShape);
path.contains(thisShape);
never executed: return path.contains(thisShape);
0
2809}-
2810QList<QGraphicsItem *> QGraphicsItem::collidingItems(Qt::ItemSelectionMode mode) const-
2811{-
2812 if (d_ptr->scene
d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2813 return
never executed: return d_ptr->scene->collidingItems(this, mode);
d_ptr->scene->collidingItems(this, mode);
never executed: return d_ptr->scene->collidingItems(this, mode);
0
2814 return
never executed: return QList<QGraphicsItem *>();
QList<QGraphicsItem *>();
never executed: return QList<QGraphicsItem *>();
0
2815}-
2816static bool qt_QGraphicsItem_isObscured(const QGraphicsItem *item,-
2817 const QGraphicsItem *other,-
2818 const QRectF &rect)-
2819{-
2820 return
never executed: return other->mapToItem(item, other->opaqueArea()).contains(rect);
other->mapToItem(item, other->opaqueArea()).contains(rect);
never executed: return other->mapToItem(item, other->opaqueArea()).contains(rect);
0
2821}-
2822bool QGraphicsItem::isObscured(const QRectF &rect) const-
2823{-
2824 const QGraphicsItemPrivate * const d = d_func();-
2825 if (!d->scene
!d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2826 return
never executed: return false;
false;
never executed: return false;
0
2827-
2828 QRectF br = boundingRect();-
2829 QRectF testRect = rect.isNull()
rect.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
? br : rect;
0
2830-
2831 const auto items = d->scene->items(mapToScene(br), Qt::IntersectsItemBoundingRect);-
2832 for (QGraphicsItem *item : items) {-
2833 if (item == this
item == thisDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2834 break;
never executed: break;
0
2835 if (qt_QGraphicsItem_isObscured(this, item, testRect)
qt_QGraphicsIt...tem, testRect)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2836 return
never executed: return true;
true;
never executed: return true;
0
2837 }
never executed: end of block
0
2838 return
never executed: return false;
false;
never executed: return false;
0
2839}-
2840bool QGraphicsItem::isObscuredBy(const QGraphicsItem *item) const-
2841{-
2842 if (!item
!itemDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2843 return
never executed: return false;
false;
never executed: return false;
0
2844 return
never executed: return qt_closestItemFirst(item, this) && qt_QGraphicsItem_isObscured(this, item, boundingRect());
qt_closestItemFirst(item, this)
never executed: return qt_closestItemFirst(item, this) && qt_QGraphicsItem_isObscured(this, item, boundingRect());
0
2845 && qt_QGraphicsItem_isObscured(this, item, boundingRect());
never executed: return qt_closestItemFirst(item, this) && qt_QGraphicsItem_isObscured(this, item, boundingRect());
0
2846}-
2847QPainterPath QGraphicsItem::opaqueArea() const-
2848{-
2849 return
never executed: return QPainterPath();
QPainterPath();
never executed: return QPainterPath();
0
2850}-
2851QRegion QGraphicsItem::boundingRegion(const QTransform &itemToDeviceTransform) const-
2852{-
2853 qreal granularity = boundingRegionGranularity();-
2854 QRect deviceRect = itemToDeviceTransform.mapRect(boundingRect()).toRect();-
2855 _q_adjustRect(&deviceRect);-
2856 if (granularity == 0.0
granularity == 0.0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2857 return
never executed: return QRegion(deviceRect);
QRegion(deviceRect);
never executed: return QRegion(deviceRect);
0
2858-
2859 int pad = 1;-
2860 QSize bitmapSize(qMax(1, int(deviceRect.width() * granularity) + pad * 2),-
2861 qMax(1, int(deviceRect.height() * granularity) + pad * 2));-
2862 QImage mask(bitmapSize, QImage::Format_ARGB32_Premultiplied);-
2863 mask.fill(0);-
2864 QPainter p(&mask);-
2865 p.setRenderHints(QPainter::Antialiasing);-
2866-
2867-
2868-
2869 QPointF viewOrigo = itemToDeviceTransform.map(QPointF(0, 0));-
2870 QPointF offset = viewOrigo - deviceRect.topLeft();-
2871 p.scale(granularity, granularity);-
2872 p.translate(offset);-
2873 p.translate(pad, pad);-
2874 p.setWorldTransform(itemToDeviceTransform, true);-
2875 p.translate(itemToDeviceTransform.inverted().map(QPointF(0, 0)));-
2876-
2877-
2878 QStyleOptionGraphicsItem option;-
2879 const_cast<QGraphicsItem *>(this)->paint(&p, &option, 0);-
2880 p.end();-
2881-
2882-
2883 QTransform unscale = QTransform::fromScale(1 / granularity, 1 / granularity);-
2884 QRegion r;-
2885 QBitmap colorMask = QBitmap::fromImage(mask.createMaskFromColor(0));-
2886 const auto rects = QRegion(colorMask).rects();-
2887 for (const QRect &rect : rects) {-
2888 QRect xrect = unscale.mapRect(rect).translated(deviceRect.topLeft() - QPoint(pad, pad));-
2889 r += xrect.adjusted(-1, -1, 1, 1) & deviceRect;-
2890 }
never executed: end of block
0
2891 return
never executed: return r;
r;
never executed: return r;
0
2892}-
2893qreal QGraphicsItem::boundingRegionGranularity() const-
2894{-
2895 return
never executed: return d_ptr->hasBoundingRegionGranularity ? qvariant_cast<qreal>(d_ptr->extra(QGraphicsItemPrivate::ExtraBoundingRegionGranularity)) : 0;
d_ptr->hasBoundingRegionGranularity
never executed: return d_ptr->hasBoundingRegionGranularity ? qvariant_cast<qreal>(d_ptr->extra(QGraphicsItemPrivate::ExtraBoundingRegionGranularity)) : 0;
0
2896 ? qvariant_cast<qreal>(d_ptr->extra(QGraphicsItemPrivate::ExtraBoundingRegionGranularity))
never executed: return d_ptr->hasBoundingRegionGranularity ? qvariant_cast<qreal>(d_ptr->extra(QGraphicsItemPrivate::ExtraBoundingRegionGranularity)) : 0;
0
2897 : 0;
never executed: return d_ptr->hasBoundingRegionGranularity ? qvariant_cast<qreal>(d_ptr->extra(QGraphicsItemPrivate::ExtraBoundingRegionGranularity)) : 0;
0
2898}-
2899void QGraphicsItem::setBoundingRegionGranularity(qreal granularity)-
2900{-
2901 if (granularity < 0.0
granularity < 0.0Description
TRUEnever evaluated
FALSEnever evaluated
|| granularity > 1.0
granularity > 1.0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2902 QMessageLogger(__FILE__, 5403, __PRETTY_FUNCTION__).warning("QGraphicsItem::setBoundingRegionGranularity: invalid granularity %g", granularity);-
2903 return;
never executed: return;
0
2904 }-
2905 if (granularity == 0.0
granularity == 0.0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2906 d_ptr->unsetExtra(QGraphicsItemPrivate::ExtraBoundingRegionGranularity);-
2907 d_ptr->hasBoundingRegionGranularity = 0;-
2908 return;
never executed: return;
0
2909 }-
2910 d_ptr->hasBoundingRegionGranularity = 1;-
2911 d_ptr->setExtra(QGraphicsItemPrivate::ExtraBoundingRegionGranularity,-
2912 QVariant::fromValue<qreal>(granularity));-
2913}
never executed: end of block
0
2914bool QGraphicsItemPrivate::discardUpdateRequest(bool ignoreVisibleBit, bool ignoreDirtyBit,-
2915 bool ignoreOpacity) const-
2916{-
2917-
2918-
2919 return
never executed: return !scene || (!visible && !ignoreVisibleBit && !this->ignoreVisible) || (!ignoreDirtyBit && fullUpdatePending) || (!ignoreOpacity && !this->ignoreOpacity && childrenCombineOpacity() && isFullyTransparent());
!scene
never executed: return !scene || (!visible && !ignoreVisibleBit && !this->ignoreVisible) || (!ignoreDirtyBit && fullUpdatePending) || (!ignoreOpacity && !this->ignoreOpacity && childrenCombineOpacity() && isFullyTransparent());
0
2920 || (!visible && !ignoreVisibleBit && !this->ignoreVisible)
never executed: return !scene || (!visible && !ignoreVisibleBit && !this->ignoreVisible) || (!ignoreDirtyBit && fullUpdatePending) || (!ignoreOpacity && !this->ignoreOpacity && childrenCombineOpacity() && isFullyTransparent());
0
2921 || (!ignoreDirtyBit && fullUpdatePending)
never executed: return !scene || (!visible && !ignoreVisibleBit && !this->ignoreVisible) || (!ignoreDirtyBit && fullUpdatePending) || (!ignoreOpacity && !this->ignoreOpacity && childrenCombineOpacity() && isFullyTransparent());
0
2922 || (!ignoreOpacity && !this->ignoreOpacity && childrenCombineOpacity() && isFullyTransparent());
never executed: return !scene || (!visible && !ignoreVisibleBit && !this->ignoreVisible) || (!ignoreDirtyBit && fullUpdatePending) || (!ignoreOpacity && !this->ignoreOpacity && childrenCombineOpacity() && isFullyTransparent());
0
2923}-
2924-
2925-
2926-
2927-
2928int QGraphicsItemPrivate::depth() const-
2929{-
2930 if (itemDepth == -1
itemDepth == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2931 const_cast<
never executed: const_cast<QGraphicsItemPrivate *>(this)->resolveDepth();
QGraphicsItemPrivate *>(this)->resolveDepth();
never executed: const_cast<QGraphicsItemPrivate *>(this)->resolveDepth();
0
2932-
2933 return
never executed: return itemDepth;
itemDepth;
never executed: return itemDepth;
0
2934}-
2935-
2936-
2937-
2938-
2939-
2940void QGraphicsItemPrivate::invalidateParentGraphicsEffectsRecursively()-
2941{-
2942 QGraphicsItemPrivate *itemPrivate = this;-
2943 do {-
2944 if (itemPrivate->graphicsEffect
itemPrivate->graphicsEffectDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2945 itemPrivate->notifyInvalidated = 1;-
2946-
2947 if (!itemPrivate->updateDueToGraphicsEffect
!itemPrivate->...GraphicsEffectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2948 static_cast<
never executed: static_cast<QGraphicsItemEffectSourcePrivate *>(itemPrivate->graphicsEffect->d_func()->source->d_func())->invalidateCache();
QGraphicsItemEffectSourcePrivate *>(itemPrivate->graphicsEffect->d_func()->source->d_func())->invalidateCache();
never executed: static_cast<QGraphicsItemEffectSourcePrivate *>(itemPrivate->graphicsEffect->d_func()->source->d_func())->invalidateCache();
0
2949 }
never executed: end of block
0
2950 }
never executed: end of block
while ((
(itemPrivate =...tr.data() : 0)Description
TRUEnever evaluated
FALSEnever evaluated
itemPrivate = itemPrivate->parent
itemPrivate->parentDescription
TRUEnever evaluated
FALSEnever evaluated
? itemPrivate->parent->d_ptr.data() : 0)
(itemPrivate =...tr.data() : 0)Description
TRUEnever evaluated
FALSEnever evaluated
);
0
2951}
never executed: end of block
0
2952-
2953void QGraphicsItemPrivate::invalidateChildGraphicsEffectsRecursively(QGraphicsItemPrivate::InvalidateReason reason)-
2954{-
2955 if (!mayHaveChildWithGraphicsEffect
!mayHaveChildW...GraphicsEffectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2956 return;
never executed: return;
0
2957-
2958 for (int i = 0; i < children.size()
i < children.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
2959 QGraphicsItemPrivate *childPrivate = children.at(i)->d_ptr.data();-
2960 if (reason == OpacityChanged
reason == OpacityChangedDescription
TRUEnever evaluated
FALSEnever evaluated
&& (
(childPrivate-...ParentOpacity)Description
TRUEnever evaluated
FALSEnever evaluated
childPrivate->flags & QGraphicsItem::ItemIgnoresParentOpacity)
(childPrivate-...ParentOpacity)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2961 continue;
never executed: continue;
0
2962 if (childPrivate->graphicsEffect
childPrivate->graphicsEffectDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2963 childPrivate->notifyInvalidated = 1;-
2964 static_cast<QGraphicsItemEffectSourcePrivate *>(childPrivate->graphicsEffect->d_func()->source->d_func())->invalidateCache();-
2965 }
never executed: end of block
0
2966-
2967 childPrivate->invalidateChildGraphicsEffectsRecursively(reason);-
2968 }
never executed: end of block
0
2969}
never executed: end of block
0
2970-
2971-
2972-
2973-
2974-
2975void QGraphicsItemPrivate::invalidateDepthRecursively()-
2976{-
2977 if (itemDepth == -1
itemDepth == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2978 return;
never executed: return;
0
2979-
2980 itemDepth = -1;-
2981 for (int i = 0; i < children.size()
i < children.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
2982 children.at(i)->d_ptr->invalidateDepthRecursively();
never executed: children.at(i)->d_ptr->invalidateDepthRecursively();
0
2983}
never executed: end of block
0
2984-
2985-
2986-
2987-
2988-
2989-
2990void QGraphicsItemPrivate::resolveDepth()-
2991{-
2992 if (!parent
!parentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2993 itemDepth = 0;
never executed: itemDepth = 0;
0
2994 else {-
2995 if (parent->d_ptr->itemDepth == -1
parent->d_ptr->itemDepth == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2996 parent->d_ptr->resolveDepth();
never executed: parent->d_ptr->resolveDepth();
0
2997 itemDepth = parent->d_ptr->itemDepth + 1;-
2998 }
never executed: end of block
0
2999}-
3000-
3001-
3002-
3003-
3004-
3005-
3006-
3007void QGraphicsItemPrivate::addChild(QGraphicsItem *child)-
3008{-
3009-
3010-
3011 ensureSequentialSiblingIndex();-
3012 needSortChildren = 1;-
3013 child->d_ptr->siblingIndex = children.size();-
3014 children.append(child);-
3015 if (isObject
isObjectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3016 static_cast<
never executed: static_cast<QGraphicsObject *>(q_ptr)->childrenChanged();
QGraphicsObject *>(q_ptr)->childrenChanged();
never executed: static_cast<QGraphicsObject *>(q_ptr)->childrenChanged();
0
3017}
never executed: end of block
0
3018-
3019-
3020-
3021-
3022-
3023-
3024-
3025void QGraphicsItemPrivate::removeChild(QGraphicsItem *child)-
3026{-
3027-
3028-
3029 if (!holesInSiblingIndex
!holesInSiblingIndexDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3030 holesInSiblingIndex = child->d_ptr->siblingIndex != children.size() - 1;
never executed: holesInSiblingIndex = child->d_ptr->siblingIndex != children.size() - 1;
0
3031 if (sequentialOrdering
sequentialOrderingDescription
TRUEnever evaluated
FALSEnever evaluated
&& !holesInSiblingIndex
!holesInSiblingIndexDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3032 children.removeAt(child->d_ptr->siblingIndex);
never executed: children.removeAt(child->d_ptr->siblingIndex);
0
3033 else-
3034 children.removeOne(child);
never executed: children.removeOne(child);
0
3035-
3036-
3037-
3038 child->d_ptr->siblingIndex = -1;-
3039 if (isObject
isObjectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3040 static_cast<
never executed: static_cast<QGraphicsObject *>(q_ptr)->childrenChanged();
QGraphicsObject *>(q_ptr)->childrenChanged();
never executed: static_cast<QGraphicsObject *>(q_ptr)->childrenChanged();
0
3041}
never executed: end of block
0
3042-
3043-
3044-
3045-
3046QGraphicsItemCache *QGraphicsItemPrivate::maybeExtraItemCache() const-
3047{-
3048 return
never executed: return (QGraphicsItemCache *)qvariant_cast<void *>(extra(ExtraCacheData));
(QGraphicsItemCache *)qvariant_cast<void *>(extra(ExtraCacheData));
never executed: return (QGraphicsItemCache *)qvariant_cast<void *>(extra(ExtraCacheData));
0
3049}-
3050-
3051-
3052-
3053-
3054QGraphicsItemCache *QGraphicsItemPrivate::extraItemCache() const-
3055{-
3056 QGraphicsItemCache *c = (QGraphicsItemCache *)qvariant_cast<void *>(extra(ExtraCacheData));-
3057 if (!c
!cDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3058 QGraphicsItemPrivate *that = const_cast<QGraphicsItemPrivate *>(this);-
3059 c = new QGraphicsItemCache;-
3060 that->setExtra(ExtraCacheData, QVariant::fromValue<void *>(c));-
3061 }
never executed: end of block
0
3062 return
never executed: return c;
c;
never executed: return c;
0
3063}-
3064-
3065-
3066-
3067-
3068void QGraphicsItemPrivate::removeExtraItemCache()-
3069{-
3070 QGraphicsItemCache *c = (QGraphicsItemCache *)qvariant_cast<void *>(extra(ExtraCacheData));-
3071 if (c
cDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3072 c->purge();-
3073 delete c;-
3074 }
never executed: end of block
0
3075 unsetExtra(ExtraCacheData);-
3076}
never executed: end of block
0
3077-
3078void QGraphicsItemPrivate::updatePaintedViewBoundingRects(bool updateChildren)-
3079{-
3080 if (!scene
!sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3081 return;
never executed: return;
0
3082-
3083 for (int i = 0; i < scene->d_func()->views.size()
i < scene->d_f...->views.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
3084 QGraphicsViewPrivate *viewPrivate = scene->d_func()->views.at(i)->d_func();-
3085 QRect rect = paintedViewBoundingRects.value(viewPrivate->viewport);-
3086 rect.translate(viewPrivate->dirtyScrollOffset);-
3087 viewPrivate->updateRect(rect);-
3088 }
never executed: end of block
0
3089-
3090 if (updateChildren
updateChildrenDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3091 for (int i = 0; i < children.size()
i < children.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
3092 children.at(i)->d_ptr->updatePaintedViewBoundingRects(true);
never executed: children.at(i)->d_ptr->updatePaintedViewBoundingRects(true);
0
3093 }
never executed: end of block
0
3094}
never executed: end of block
0
3095-
3096-
3097-
3098-
3099-
3100-
3101void QGraphicsItemPrivate::ensureSceneTransformRecursive(QGraphicsItem **topMostDirtyItem)-
3102{-
3103 ((!(topMostDirtyItem)) ? qt_assert("topMostDirtyItem",__FILE__,5653) : qt_noop());-
3104-
3105 if (dirtySceneTransform
dirtySceneTransformDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3106 *
never executed: *topMostDirtyItem = q_ptr;
topMostDirtyItem = q_ptr;
never executed: *topMostDirtyItem = q_ptr;
0
3107-
3108 if (parent
parentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3109 parent->d_ptr->ensureSceneTransformRecursive(topMostDirtyItem);
never executed: parent->d_ptr->ensureSceneTransformRecursive(topMostDirtyItem);
0
3110-
3111 if (*
*topMostDirtyItem == q_ptrDescription
TRUEnever evaluated
FALSEnever evaluated
topMostDirtyItem == q_ptr
*topMostDirtyItem == q_ptrDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3112 if (!dirtySceneTransform
!dirtySceneTransformDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3113 return;
never executed: return;
0
3114 *topMostDirtyItem = 0;-
3115 }
never executed: end of block
else if (*
*topMostDirtyItemDescription
TRUEnever evaluated
FALSEnever evaluated
topMostDirtyItem
*topMostDirtyItemDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3116 return;
never executed: return;
0
3117 }-
3118-
3119-
3120-
3121-
3122-
3123 invalidateChildrenSceneTransform();-
3124-
3125-
3126 updateSceneTransformFromParent();-
3127 ((!(!dirtySceneTransform)) ? qt_assert("!dirtySceneTransform",__FILE__,5677) : qt_noop());-
3128}
never executed: end of block
0
3129-
3130-
3131-
3132-
3133void QGraphicsItemPrivate::setSubFocus(QGraphicsItem *rootItem, QGraphicsItem *stopItem)-
3134{-
3135-
3136-
3137 QGraphicsItem *parent = rootItem
rootItemDescription
TRUEnever evaluated
FALSEnever evaluated
? rootItem : q_ptr;
0
3138 if (parent->panel() != q_ptr->panel()
parent->panel(...q_ptr->panel()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3139 return;
never executed: return;
0
3140-
3141 do {-
3142-
3143 if (parent != q_ptr
parent != q_ptrDescription
TRUEnever evaluated
FALSEnever evaluated
&& parent->d_ptr->subFocusItem
parent->d_ptr->subFocusItemDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3144 if (parent->d_ptr->subFocusItem == q_ptr
parent->d_ptr-...sItem == q_ptrDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3145 break;
never executed: break;
0
3146 parent->d_ptr->subFocusItem->d_ptr->clearSubFocus(0, stopItem);-
3147 }
never executed: end of block
0
3148 parent->d_ptr->subFocusItem = q_ptr;-
3149 parent->d_ptr->subFocusItemChange();-
3150 }
never executed: end of block
while (!parent->isPanel()
!parent->isPanel()Description
TRUEnever evaluated
FALSEnever evaluated
&& (
(parent = pare...d_ptr->parent)Description
TRUEnever evaluated
FALSEnever evaluated
parent = parent->d_ptr->parent)
(parent = pare...d_ptr->parent)Description
TRUEnever evaluated
FALSEnever evaluated
&& (visible
visibleDescription
TRUEnever evaluated
FALSEnever evaluated
|| !parent->d_ptr->visible
!parent->d_ptr->visibleDescription
TRUEnever evaluated
FALSEnever evaluated
));
0
3151-
3152 if (scene
sceneDescription
TRUEnever evaluated
FALSEnever evaluated
&& !scene->isActive()
!scene->isActive()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
3153 scene->d_func()->passiveFocusItem = subFocusItem;-
3154 scene->d_func()->lastFocusItem = subFocusItem;-
3155 }
never executed: end of block
0
3156}
never executed: end of block
0
3157-
3158-
3159-
3160-
3161void QGraphicsItemPrivate::clearSubFocus(QGraphicsItem *rootItem, QGraphicsItem *stopItem)-
3162{-
3163-
3164 QGraphicsItem *parent = rootItem
rootItemDescription
TRUEnever evaluated
FALSEnever evaluated
? rootItem : q_ptr;
0
3165 do {-
3166 if (parent->d_ptr->subFocusItem != q_ptr
parent->d_ptr-...sItem != q_ptrDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3167 break;
never executed: break;
0
3168 parent->d_ptr->subFocusItem = 0;-
3169 if (parent != stopItem
parent != stopItemDescription
TRUEnever evaluated
FALSEnever evaluated
&& !parent->isAncestorOf(stopItem)
!parent->isAnc...orOf(stopItem)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3170 parent->d_ptr->subFocusItemChange();
never executed: parent->d_ptr->subFocusItemChange();
0
3171 }
never executed: end of block
while (!parent->isPanel()
!parent->isPanel()Description
TRUEnever evaluated
FALSEnever evaluated
&& (
(parent = pare...d_ptr->parent)Description
TRUEnever evaluated
FALSEnever evaluated
parent = parent->d_ptr->parent)
(parent = pare...d_ptr->parent)Description
TRUEnever evaluated
FALSEnever evaluated
);
0
3172}
never executed: end of block
0
3173-
3174-
3175-
3176-
3177-
3178-
3179-
3180void QGraphicsItemPrivate::resetFocusProxy()-
3181{-
3182 for (int i = 0; i < focusProxyRefs.size()
i < focusProxyRefs.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
3183 *
never executed: *focusProxyRefs.at(i) = 0;
focusProxyRefs.at(i) = 0;
never executed: *focusProxyRefs.at(i) = 0;
0
3184 focusProxyRefs.clear();-
3185}
never executed: end of block
0
3186-
3187-
3188-
3189-
3190-
3191-
3192-
3193void QGraphicsItemPrivate::subFocusItemChange()-
3194{-
3195}-
3196-
3197-
3198-
3199-
3200-
3201-
3202-
3203void QGraphicsItemPrivate::focusScopeItemChange(bool isSubFocusItem)-
3204{-
3205 (void)isSubFocusItem;;-
3206}
never executed: end of block
0
3207-
3208-
3209-
3210-
3211-
3212-
3213-
3214void QGraphicsItemPrivate::siblingOrderChange()-
3215{-
3216}-
3217-
3218-
3219-
3220-
3221-
3222-
3223bool QGraphicsItemPrivate::isProxyWidget() const-
3224{-
3225 return
never executed: return false;
false;
never executed: return false;
0
3226}-
3227void QGraphicsItem::update(const QRectF &rect)-
3228{-
3229 if (rect.isEmpty()
rect.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
&& !rect.isNull()
!rect.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3230 return;
never executed: return;
0
3231-
3232-
3233-
3234 d_ptr->invalidateParentGraphicsEffectsRecursively();-
3235-
3236-
3237 if (CacheMode(d_ptr->cacheMode) != NoCache
CacheMode(d_pt...de) != NoCacheDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3238-
3239 QGraphicsItemCache *cache = d_ptr->extraItemCache();-
3240 if (!cache->allExposed
!cache->allExposedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3241 if (rect.isNull()
rect.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
3242 cache->allExposed = true;-
3243 cache->exposed.clear();-
3244 }
never executed: end of block
else {
0
3245 cache->exposed.append(rect);-
3246 }
never executed: end of block
0
3247 }-
3248-
3249 if (d_ptr->fullUpdatePending
d_ptr->fullUpdatePendingDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3250 return;
never executed: return;
0
3251 }
never executed: end of block
0
3252-
3253 if (d_ptr->scene
d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3254 d_ptr->scene->d_func()->markDirty(this, rect);
never executed: d_ptr->scene->d_func()->markDirty(this, rect);
0
3255}
never executed: end of block
0
3256void QGraphicsItem::scroll(qreal dx, qreal dy, const QRectF &rect)-
3257{-
3258 QGraphicsItemPrivate * const d = d_func();-
3259 if (dx == 0.0
dx == 0.0Description
TRUEnever evaluated
FALSEnever evaluated
&& dy == 0.0
dy == 0.0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3260 return;
never executed: return;
0
3261 if (!d->scene
!d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3262 return;
never executed: return;
0
3263 if (d->cacheMode != QGraphicsItem::ItemCoordinateCache
d->cacheMode !...oordinateCacheDescription
TRUEnever evaluated
FALSEnever evaluated
0
3264 || !qFuzzyIsNull(dx - int(dx))
!qFuzzyIsNull(dx - int(dx))Description
TRUEnever evaluated
FALSEnever evaluated
|| !qFuzzyIsNull(dy - int(dy))
!qFuzzyIsNull(dy - int(dy))Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
3265 update(rect);-
3266 return;
never executed: return;
0
3267 }-
3268-
3269 QGraphicsItemCache *cache = d->extraItemCache();-
3270 if (cache->allExposed
cache->allExposedDescription
TRUEnever evaluated
FALSEnever evaluated
|| cache->fixedSize.isValid()
cache->fixedSize.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
3271-
3272 update(rect);-
3273 return;
never executed: return;
0
3274 }-
3275-
3276-
3277 QPixmap cachedPixmap;-
3278 if (!QPixmapCache::find(cache->key, &cachedPixmap)
!QPixmapCache:...&cachedPixmap)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
3279 update(rect);-
3280 return;
never executed: return;
0
3281 }-
3282-
3283 QRect scrollRect = (rect.isNull()
rect.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
? boundingRect() : rect).toAlignedRect();
0
3284 if (!scrollRect.intersects(cache->boundingRect)
!scrollRect.in...>boundingRect)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3285 return;
never executed: return;
0
3286-
3287-
3288 QPixmapCache::remove(cache->key);-
3289-
3290 QRegion exposed;-
3291 cachedPixmap.scroll(dx, dy, scrollRect.translated(-cache->boundingRect.topLeft()), &exposed);-
3292-
3293-
3294 cache->key = QPixmapCache::insert(cachedPixmap);-
3295-
3296-
3297 for (int i = 0; i < cache->exposed.size()
i < cache->exposed.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
3298 QRectF &e = cache->exposed[i];-
3299 if (!rect.isNull()
!rect.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
&& !e.intersects(rect)
!e.intersects(rect)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3300 continue;
never executed: continue;
0
3301 e.translate(dx, dy);-
3302 }
never executed: end of block
0
3303-
3304-
3305-
3306 exposed.translate(cache->boundingRect.topLeft());-
3307 const QVector<QRect> exposedRects = exposed.rects();-
3308 for (int i = 0; i < exposedRects.size()
i < exposedRects.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
3309 cache->exposed += exposedRects.at(i);
never executed: cache->exposed += exposedRects.at(i);
0
3310-
3311-
3312-
3313 d->scene->d_func()->markDirty(this, rect);-
3314}
never executed: end of block
0
3315QPointF QGraphicsItem::mapToItem(const QGraphicsItem *item, const QPointF &point) const-
3316{-
3317 if (item
itemDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3318 return
never executed: return itemTransform(item).map(point);
itemTransform(item).map(point);
never executed: return itemTransform(item).map(point);
0
3319 return
never executed: return mapToScene(point);
mapToScene(point);
never executed: return mapToScene(point);
0
3320}-
3321QPointF QGraphicsItem::mapToParent(const QPointF &point) const-
3322{-
3323-
3324 if (!d_ptr->transformData
!d_ptr->transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3325 return
never executed: return point + d_ptr->pos;
point + d_ptr->pos;
never executed: return point + d_ptr->pos;
0
3326 return
never executed: return d_ptr->transformToParent().map(point);
d_ptr->transformToParent().map(point);
never executed: return d_ptr->transformToParent().map(point);
0
3327}-
3328QPointF QGraphicsItem::mapToScene(const QPointF &point) const-
3329{-
3330 if (d_ptr->hasTranslateOnlySceneTransform()
d_ptr->hasTran...eneTransform()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3331 return
never executed: return QPointF(point.x() + d_ptr->sceneTransform.dx(), point.y() + d_ptr->sceneTransform.dy());
QPointF(point.x() + d_ptr->sceneTransform.dx(), point.y() + d_ptr->sceneTransform.dy());
never executed: return QPointF(point.x() + d_ptr->sceneTransform.dx(), point.y() + d_ptr->sceneTransform.dy());
0
3332 return
never executed: return d_ptr->sceneTransform.map(point);
d_ptr->sceneTransform.map(point);
never executed: return d_ptr->sceneTransform.map(point);
0
3333}-
3334QPolygonF QGraphicsItem::mapToItem(const QGraphicsItem *item, const QRectF &rect) const-
3335{-
3336 if (item
itemDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3337 return
never executed: return itemTransform(item).map(rect);
itemTransform(item).map(rect);
never executed: return itemTransform(item).map(rect);
0
3338 return
never executed: return mapToScene(rect);
mapToScene(rect);
never executed: return mapToScene(rect);
0
3339}-
3340QPolygonF QGraphicsItem::mapToParent(const QRectF &rect) const-
3341{-
3342-
3343 if (!d_ptr->transformData
!d_ptr->transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3344 return
never executed: return rect.translated(d_ptr->pos);
rect.translated(d_ptr->pos);
never executed: return rect.translated(d_ptr->pos);
0
3345 return
never executed: return d_ptr->transformToParent().map(rect);
d_ptr->transformToParent().map(rect);
never executed: return d_ptr->transformToParent().map(rect);
0
3346}-
3347QPolygonF QGraphicsItem::mapToScene(const QRectF &rect) const-
3348{-
3349 if (d_ptr->hasTranslateOnlySceneTransform()
d_ptr->hasTran...eneTransform()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3350 return
never executed: return rect.translated(d_ptr->sceneTransform.dx(), d_ptr->sceneTransform.dy());
rect.translated(d_ptr->sceneTransform.dx(), d_ptr->sceneTransform.dy());
never executed: return rect.translated(d_ptr->sceneTransform.dx(), d_ptr->sceneTransform.dy());
0
3351 return
never executed: return d_ptr->sceneTransform.map(rect);
d_ptr->sceneTransform.map(rect);
never executed: return d_ptr->sceneTransform.map(rect);
0
3352}-
3353QRectF QGraphicsItem::mapRectToItem(const QGraphicsItem *item, const QRectF &rect) const-
3354{-
3355 if (item
itemDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3356 return
never executed: return itemTransform(item).mapRect(rect);
itemTransform(item).mapRect(rect);
never executed: return itemTransform(item).mapRect(rect);
0
3357 return
never executed: return mapRectToScene(rect);
mapRectToScene(rect);
never executed: return mapRectToScene(rect);
0
3358}-
3359QRectF QGraphicsItem::mapRectToParent(const QRectF &rect) const-
3360{-
3361-
3362 if (!d_ptr->transformData
!d_ptr->transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3363 return
never executed: return rect.translated(d_ptr->pos);
rect.translated(d_ptr->pos);
never executed: return rect.translated(d_ptr->pos);
0
3364 return
never executed: return d_ptr->transformToParent().mapRect(rect);
d_ptr->transformToParent().mapRect(rect);
never executed: return d_ptr->transformToParent().mapRect(rect);
0
3365}-
3366QRectF QGraphicsItem::mapRectToScene(const QRectF &rect) const-
3367{-
3368 if (d_ptr->hasTranslateOnlySceneTransform()
d_ptr->hasTran...eneTransform()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3369 return
never executed: return rect.translated(d_ptr->sceneTransform.dx(), d_ptr->sceneTransform.dy());
rect.translated(d_ptr->sceneTransform.dx(), d_ptr->sceneTransform.dy());
never executed: return rect.translated(d_ptr->sceneTransform.dx(), d_ptr->sceneTransform.dy());
0
3370 return
never executed: return d_ptr->sceneTransform.mapRect(rect);
d_ptr->sceneTransform.mapRect(rect);
never executed: return d_ptr->sceneTransform.mapRect(rect);
0
3371}-
3372QRectF QGraphicsItem::mapRectFromItem(const QGraphicsItem *item, const QRectF &rect) const-
3373{-
3374 if (item
itemDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3375 return
never executed: return item->itemTransform(this).mapRect(rect);
item->itemTransform(this).mapRect(rect);
never executed: return item->itemTransform(this).mapRect(rect);
0
3376 return
never executed: return mapRectFromScene(rect);
mapRectFromScene(rect);
never executed: return mapRectFromScene(rect);
0
3377}-
3378QRectF QGraphicsItem::mapRectFromParent(const QRectF &rect) const-
3379{-
3380-
3381 if (!d_ptr->transformData
!d_ptr->transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3382 return
never executed: return rect.translated(-d_ptr->pos);
rect.translated(-d_ptr->pos);
never executed: return rect.translated(-d_ptr->pos);
0
3383 return
never executed: return d_ptr->transformToParent().inverted().mapRect(rect);
d_ptr->transformToParent().inverted().mapRect(rect);
never executed: return d_ptr->transformToParent().inverted().mapRect(rect);
0
3384}-
3385QRectF QGraphicsItem::mapRectFromScene(const QRectF &rect) const-
3386{-
3387 if (d_ptr->hasTranslateOnlySceneTransform()
d_ptr->hasTran...eneTransform()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3388 return
never executed: return rect.translated(-d_ptr->sceneTransform.dx(), -d_ptr->sceneTransform.dy());
rect.translated(-d_ptr->sceneTransform.dx(), -d_ptr->sceneTransform.dy());
never executed: return rect.translated(-d_ptr->sceneTransform.dx(), -d_ptr->sceneTransform.dy());
0
3389 return
never executed: return d_ptr->sceneTransform.inverted().mapRect(rect);
d_ptr->sceneTransform.inverted().mapRect(rect);
never executed: return d_ptr->sceneTransform.inverted().mapRect(rect);
0
3390}-
3391QPolygonF QGraphicsItem::mapToItem(const QGraphicsItem *item, const QPolygonF &polygon) const-
3392{-
3393 if (item
itemDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3394 return
never executed: return itemTransform(item).map(polygon);
itemTransform(item).map(polygon);
never executed: return itemTransform(item).map(polygon);
0
3395 return
never executed: return mapToScene(polygon);
mapToScene(polygon);
never executed: return mapToScene(polygon);
0
3396}-
3397QPolygonF QGraphicsItem::mapToParent(const QPolygonF &polygon) const-
3398{-
3399-
3400 if (!d_ptr->transformData
!d_ptr->transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3401 return
never executed: return polygon.translated(d_ptr->pos);
polygon.translated(d_ptr->pos);
never executed: return polygon.translated(d_ptr->pos);
0
3402 return
never executed: return d_ptr->transformToParent().map(polygon);
d_ptr->transformToParent().map(polygon);
never executed: return d_ptr->transformToParent().map(polygon);
0
3403}-
3404QPolygonF QGraphicsItem::mapToScene(const QPolygonF &polygon) const-
3405{-
3406 if (d_ptr->hasTranslateOnlySceneTransform()
d_ptr->hasTran...eneTransform()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3407 return
never executed: return polygon.translated(d_ptr->sceneTransform.dx(), d_ptr->sceneTransform.dy());
polygon.translated(d_ptr->sceneTransform.dx(), d_ptr->sceneTransform.dy());
never executed: return polygon.translated(d_ptr->sceneTransform.dx(), d_ptr->sceneTransform.dy());
0
3408 return
never executed: return d_ptr->sceneTransform.map(polygon);
d_ptr->sceneTransform.map(polygon);
never executed: return d_ptr->sceneTransform.map(polygon);
0
3409}-
3410QPainterPath QGraphicsItem::mapToItem(const QGraphicsItem *item, const QPainterPath &path) const-
3411{-
3412 if (item
itemDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3413 return
never executed: return itemTransform(item).map(path);
itemTransform(item).map(path);
never executed: return itemTransform(item).map(path);
0
3414 return
never executed: return mapToScene(path);
mapToScene(path);
never executed: return mapToScene(path);
0
3415}-
3416QPainterPath QGraphicsItem::mapToParent(const QPainterPath &path) const-
3417{-
3418-
3419 if (!d_ptr->transformData
!d_ptr->transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3420 return
never executed: return path.translated(d_ptr->pos);
path.translated(d_ptr->pos);
never executed: return path.translated(d_ptr->pos);
0
3421 return
never executed: return d_ptr->transformToParent().map(path);
d_ptr->transformToParent().map(path);
never executed: return d_ptr->transformToParent().map(path);
0
3422}-
3423QPainterPath QGraphicsItem::mapToScene(const QPainterPath &path) const-
3424{-
3425 if (d_ptr->hasTranslateOnlySceneTransform()
d_ptr->hasTran...eneTransform()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3426 return
never executed: return path.translated(d_ptr->sceneTransform.dx(), d_ptr->sceneTransform.dy());
path.translated(d_ptr->sceneTransform.dx(), d_ptr->sceneTransform.dy());
never executed: return path.translated(d_ptr->sceneTransform.dx(), d_ptr->sceneTransform.dy());
0
3427 return
never executed: return d_ptr->sceneTransform.map(path);
d_ptr->sceneTransform.map(path);
never executed: return d_ptr->sceneTransform.map(path);
0
3428}-
3429QPointF QGraphicsItem::mapFromItem(const QGraphicsItem *item, const QPointF &point) const-
3430{-
3431 if (item
itemDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3432 return
never executed: return item->itemTransform(this).map(point);
item->itemTransform(this).map(point);
never executed: return item->itemTransform(this).map(point);
0
3433 return
never executed: return mapFromScene(point);
mapFromScene(point);
never executed: return mapFromScene(point);
0
3434}-
3435QPointF QGraphicsItem::mapFromParent(const QPointF &point) const-
3436{-
3437-
3438 if (d_ptr->transformData
d_ptr->transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3439 return
never executed: return d_ptr->transformToParent().inverted().map(point);
d_ptr->transformToParent().inverted().map(point);
never executed: return d_ptr->transformToParent().inverted().map(point);
0
3440 return
never executed: return point - d_ptr->pos;
point - d_ptr->pos;
never executed: return point - d_ptr->pos;
0
3441}-
3442QPointF QGraphicsItem::mapFromScene(const QPointF &point) const-
3443{-
3444 if (d_ptr->hasTranslateOnlySceneTransform()
d_ptr->hasTran...eneTransform()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3445 return
never executed: return QPointF(point.x() - d_ptr->sceneTransform.dx(), point.y() - d_ptr->sceneTransform.dy());
QPointF(point.x() - d_ptr->sceneTransform.dx(), point.y() - d_ptr->sceneTransform.dy());
never executed: return QPointF(point.x() - d_ptr->sceneTransform.dx(), point.y() - d_ptr->sceneTransform.dy());
0
3446 return
never executed: return d_ptr->sceneTransform.inverted().map(point);
d_ptr->sceneTransform.inverted().map(point);
never executed: return d_ptr->sceneTransform.inverted().map(point);
0
3447}-
3448QPolygonF QGraphicsItem::mapFromItem(const QGraphicsItem *item, const QRectF &rect) const-
3449{-
3450 if (item
itemDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3451 return
never executed: return item->itemTransform(this).map(rect);
item->itemTransform(this).map(rect);
never executed: return item->itemTransform(this).map(rect);
0
3452 return
never executed: return mapFromScene(rect);
mapFromScene(rect);
never executed: return mapFromScene(rect);
0
3453}-
3454QPolygonF QGraphicsItem::mapFromParent(const QRectF &rect) const-
3455{-
3456-
3457 if (!d_ptr->transformData
!d_ptr->transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3458 return
never executed: return rect.translated(-d_ptr->pos);
rect.translated(-d_ptr->pos);
never executed: return rect.translated(-d_ptr->pos);
0
3459 return
never executed: return d_ptr->transformToParent().inverted().map(rect);
d_ptr->transformToParent().inverted().map(rect);
never executed: return d_ptr->transformToParent().inverted().map(rect);
0
3460}-
3461QPolygonF QGraphicsItem::mapFromScene(const QRectF &rect) const-
3462{-
3463 if (d_ptr->hasTranslateOnlySceneTransform()
d_ptr->hasTran...eneTransform()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3464 return
never executed: return rect.translated(-d_ptr->sceneTransform.dx(), -d_ptr->sceneTransform.dy());
rect.translated(-d_ptr->sceneTransform.dx(), -d_ptr->sceneTransform.dy());
never executed: return rect.translated(-d_ptr->sceneTransform.dx(), -d_ptr->sceneTransform.dy());
0
3465 return
never executed: return d_ptr->sceneTransform.inverted().map(rect);
d_ptr->sceneTransform.inverted().map(rect);
never executed: return d_ptr->sceneTransform.inverted().map(rect);
0
3466}-
3467QPolygonF QGraphicsItem::mapFromItem(const QGraphicsItem *item, const QPolygonF &polygon) const-
3468{-
3469 if (item
itemDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3470 return
never executed: return item->itemTransform(this).map(polygon);
item->itemTransform(this).map(polygon);
never executed: return item->itemTransform(this).map(polygon);
0
3471 return
never executed: return mapFromScene(polygon);
mapFromScene(polygon);
never executed: return mapFromScene(polygon);
0
3472}-
3473QPolygonF QGraphicsItem::mapFromParent(const QPolygonF &polygon) const-
3474{-
3475-
3476 if (!d_ptr->transformData
!d_ptr->transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3477 return
never executed: return polygon.translated(-d_ptr->pos);
polygon.translated(-d_ptr->pos);
never executed: return polygon.translated(-d_ptr->pos);
0
3478 return
never executed: return d_ptr->transformToParent().inverted().map(polygon);
d_ptr->transformToParent().inverted().map(polygon);
never executed: return d_ptr->transformToParent().inverted().map(polygon);
0
3479}-
3480QPolygonF QGraphicsItem::mapFromScene(const QPolygonF &polygon) const-
3481{-
3482 if (d_ptr->hasTranslateOnlySceneTransform()
d_ptr->hasTran...eneTransform()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3483 return
never executed: return polygon.translated(-d_ptr->sceneTransform.dx(), -d_ptr->sceneTransform.dy());
polygon.translated(-d_ptr->sceneTransform.dx(), -d_ptr->sceneTransform.dy());
never executed: return polygon.translated(-d_ptr->sceneTransform.dx(), -d_ptr->sceneTransform.dy());
0
3484 return
never executed: return d_ptr->sceneTransform.inverted().map(polygon);
d_ptr->sceneTransform.inverted().map(polygon);
never executed: return d_ptr->sceneTransform.inverted().map(polygon);
0
3485}-
3486QPainterPath QGraphicsItem::mapFromItem(const QGraphicsItem *item, const QPainterPath &path) const-
3487{-
3488 if (item
itemDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3489 return
never executed: return item->itemTransform(this).map(path);
item->itemTransform(this).map(path);
never executed: return item->itemTransform(this).map(path);
0
3490 return
never executed: return mapFromScene(path);
mapFromScene(path);
never executed: return mapFromScene(path);
0
3491}-
3492QPainterPath QGraphicsItem::mapFromParent(const QPainterPath &path) const-
3493{-
3494-
3495 if (!d_ptr->transformData
!d_ptr->transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3496 return
never executed: return path.translated(-d_ptr->pos);
path.translated(-d_ptr->pos);
never executed: return path.translated(-d_ptr->pos);
0
3497 return
never executed: return d_ptr->transformToParent().inverted().map(path);
d_ptr->transformToParent().inverted().map(path);
never executed: return d_ptr->transformToParent().inverted().map(path);
0
3498}-
3499QPainterPath QGraphicsItem::mapFromScene(const QPainterPath &path) const-
3500{-
3501 if (d_ptr->hasTranslateOnlySceneTransform()
d_ptr->hasTran...eneTransform()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3502 return
never executed: return path.translated(-d_ptr->sceneTransform.dx(), -d_ptr->sceneTransform.dy());
path.translated(-d_ptr->sceneTransform.dx(), -d_ptr->sceneTransform.dy());
never executed: return path.translated(-d_ptr->sceneTransform.dx(), -d_ptr->sceneTransform.dy());
0
3503 return
never executed: return d_ptr->sceneTransform.inverted().map(path);
d_ptr->sceneTransform.inverted().map(path);
never executed: return d_ptr->sceneTransform.inverted().map(path);
0
3504}-
3505-
3506-
3507-
3508-
3509-
3510-
3511-
3512bool QGraphicsItem::isAncestorOf(const QGraphicsItem *child) const-
3513{-
3514 if (!child
!childDescription
TRUEnever evaluated
FALSEnever evaluated
|| child == this
child == thisDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3515 return
never executed: return false;
false;
never executed: return false;
0
3516 if (child->d_ptr->depth() < d_ptr->depth()
child->d_ptr->...d_ptr->depth()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3517 return
never executed: return false;
false;
never executed: return false;
0
3518 const QGraphicsItem *ancestor = child;-
3519 while ((
(ancestor = an...d_ptr->parent)Description
TRUEnever evaluated
FALSEnever evaluated
ancestor = ancestor->d_ptr->parent)
(ancestor = an...d_ptr->parent)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
3520 if (ancestor == this
ancestor == thisDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3521 return
never executed: return true;
true;
never executed: return true;
0
3522 }
never executed: end of block
0
3523 return
never executed: return false;
false;
never executed: return false;
0
3524}-
3525QGraphicsItem *QGraphicsItem::commonAncestorItem(const QGraphicsItem *other) const-
3526{-
3527 if (!other
!otherDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3528 return
never executed: return 0;
0;
never executed: return 0;
0
3529 if (other == this
other == thisDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3530 return
never executed: return const_cast<QGraphicsItem *>(this);
const_cast<QGraphicsItem *>(this);
never executed: return const_cast<QGraphicsItem *>(this);
0
3531 const QGraphicsItem *thisw = this;-
3532 const QGraphicsItem *otherw = other;-
3533 int thisDepth = d_ptr->depth();-
3534 int otherDepth = other->d_ptr->depth();-
3535 while (thisDepth > otherDepth
thisDepth > otherDepthDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3536 thisw = thisw->d_ptr->parent;-
3537 --thisDepth;-
3538 }
never executed: end of block
0
3539 while (otherDepth > thisDepth
otherDepth > thisDepthDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3540 otherw = otherw->d_ptr->parent;-
3541 --otherDepth;-
3542 }
never executed: end of block
0
3543 while (thisw
thiswDescription
TRUEnever evaluated
FALSEnever evaluated
&& thisw != otherw
thisw != otherwDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3544 thisw = thisw->d_ptr->parent;-
3545 otherw = otherw->d_ptr->parent;-
3546 }
never executed: end of block
0
3547 return
never executed: return const_cast<QGraphicsItem *>(thisw);
const_cast<QGraphicsItem *>(thisw);
never executed: return const_cast<QGraphicsItem *>(thisw);
0
3548}-
3549bool QGraphicsItem::isUnderMouse() const-
3550{-
3551 const QGraphicsItemPrivate * const d = d_func();-
3552 if (!d->scene
!d->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3553 return
never executed: return false;
false;
never executed: return false;
0
3554-
3555 QPoint cursorPos = QCursor::pos();-
3556 const auto views = d->scene->views();-
3557 for (QGraphicsView *view : views) {-
3558 if (contains(mapFromScene(view->mapToScene(view->mapFromGlobal(cursorPos))))
contains(mapFr...(cursorPos))))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3559 return
never executed: return true;
true;
never executed: return true;
0
3560 }
never executed: end of block
0
3561 return
never executed: return false;
false;
never executed: return false;
0
3562}-
3563QVariant QGraphicsItem::data(int key) const-
3564{-
3565 QGraphicsItemCustomDataStore *store = qt_dataStore();-
3566 if (!store->data.contains(this)
!store->data.contains(this)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3567 return
never executed: return QVariant();
QVariant();
never executed: return QVariant();
0
3568 return
never executed: return store->data.value(this).value(key);
store->data.value(this).value(key);
never executed: return store->data.value(this).value(key);
0
3569}-
3570void QGraphicsItem::setData(int key, const QVariant &value)-
3571{-
3572 qt_dataStore()->data[this][key] = value;-
3573}
never executed: end of block
0
3574int QGraphicsItem::type() const-
3575{-
3576 return
never executed: return (int)UserType;
(int)UserType;
never executed: return (int)UserType;
0
3577}-
3578void QGraphicsItem::installSceneEventFilter(QGraphicsItem *filterItem)-
3579{-
3580 if (!d_ptr->scene
!d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3581 QMessageLogger(__FILE__, 6717, __PRETTY_FUNCTION__).warning("QGraphicsItem::installSceneEventFilter: event filters can only be installed"-
3582 " on items in a scene.");-
3583 return;
never executed: return;
0
3584 }-
3585 if (d_ptr->scene != filterItem->scene()
d_ptr->scene !...rItem->scene()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
3586 QMessageLogger(__FILE__, 6722, __PRETTY_FUNCTION__).warning("QGraphicsItem::installSceneEventFilter: event filters can only be installed"-
3587 " on items in the same scene.");-
3588 return;
never executed: return;
0
3589 }-
3590 d_ptr->scene->d_func()->installSceneEventFilter(this, filterItem);-
3591}
never executed: end of block
0
3592-
3593-
3594-
3595-
3596-
3597-
3598void QGraphicsItem::removeSceneEventFilter(QGraphicsItem *filterItem)-
3599{-
3600 if (!d_ptr->scene
!d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
|| d_ptr->scene != filterItem->scene()
d_ptr->scene !...rItem->scene()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3601 return;
never executed: return;
0
3602 d_ptr->scene->d_func()->removeSceneEventFilter(this, filterItem);-
3603}
never executed: end of block
0
3604bool QGraphicsItem::sceneEventFilter(QGraphicsItem *watched, QEvent *event)-
3605{-
3606 (void)watched;;-
3607 (void)event;;-
3608 return
never executed: return false;
false;
never executed: return false;
0
3609}-
3610bool QGraphicsItem::sceneEvent(QEvent *event)-
3611{-
3612 if (d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorHandlesChildEvents
d_ptr->ancesto...lesChildEventsDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3613 if (event->type() == QEvent::HoverEnter
event->type() ...nt::HoverEnterDescription
TRUEnever evaluated
FALSEnever evaluated
|| event->type() == QEvent::HoverLeave
event->type() ...nt::HoverLeaveDescription
TRUEnever evaluated
FALSEnever evaluated
0
3614 || event->type() == QEvent::DragEnter
event->type() ...ent::DragEnterDescription
TRUEnever evaluated
FALSEnever evaluated
|| event->type() == QEvent::DragLeave
event->type() ...ent::DragLeaveDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3615-
3616-
3617 return
never executed: return true;
true;
never executed: return true;
0
3618 }-
3619-
3620 QGraphicsItem *handler = this;-
3621 do {-
3622 handler = handler->d_ptr->parent;-
3623 ((!(handler)) ? qt_assert("handler",__FILE__,6791) : qt_noop());-
3624 }
never executed: end of block
while (handler->d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorHandlesChildEvents
handler->d_ptr...lesChildEventsDescription
TRUEnever evaluated
FALSEnever evaluated
);
0
3625-
3626-
3627-
3628 d_ptr->remapItemPos(event, handler);-
3629 handler->sceneEvent(event);-
3630 return
never executed: return true;
true;
never executed: return true;
0
3631 }-
3632-
3633 if (event->type() == QEvent::FocusOut
event->type() ...vent::FocusOutDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3634 focusOutEvent(static_cast<QFocusEvent *>(event));-
3635 return
never executed: return true;
true;
never executed: return true;
0
3636 }-
3637-
3638 if (!d_ptr->visible
!d_ptr->visibleDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3639-
3640 return
never executed: return true;
true;
never executed: return true;
0
3641 }-
3642-
3643 switch (event->type()) {-
3644 case
never executed: case QEvent::FocusIn:
QEvent::FocusIn:
never executed: case QEvent::FocusIn:
0
3645 focusInEvent(static_cast<QFocusEvent *>(event));-
3646 break;
never executed: break;
0
3647 case
never executed: case QEvent::GraphicsSceneContextMenu:
QEvent::GraphicsSceneContextMenu:
never executed: case QEvent::GraphicsSceneContextMenu:
0
3648 contextMenuEvent(static_cast<QGraphicsSceneContextMenuEvent *>(event));-
3649 break;
never executed: break;
0
3650 case
never executed: case QEvent::GraphicsSceneDragEnter:
QEvent::GraphicsSceneDragEnter:
never executed: case QEvent::GraphicsSceneDragEnter:
0
3651 dragEnterEvent(static_cast<QGraphicsSceneDragDropEvent *>(event));-
3652 break;
never executed: break;
0
3653 case
never executed: case QEvent::GraphicsSceneDragMove:
QEvent::GraphicsSceneDragMove:
never executed: case QEvent::GraphicsSceneDragMove:
0
3654 dragMoveEvent(static_cast<QGraphicsSceneDragDropEvent *>(event));-
3655 break;
never executed: break;
0
3656 case
never executed: case QEvent::GraphicsSceneDragLeave:
QEvent::GraphicsSceneDragLeave:
never executed: case QEvent::GraphicsSceneDragLeave:
0
3657 dragLeaveEvent(static_cast<QGraphicsSceneDragDropEvent *>(event));-
3658 break;
never executed: break;
0
3659 case
never executed: case QEvent::GraphicsSceneDrop:
QEvent::GraphicsSceneDrop:
never executed: case QEvent::GraphicsSceneDrop:
0
3660 dropEvent(static_cast<QGraphicsSceneDragDropEvent *>(event));-
3661 break;
never executed: break;
0
3662 case
never executed: case QEvent::GraphicsSceneHoverEnter:
QEvent::GraphicsSceneHoverEnter:
never executed: case QEvent::GraphicsSceneHoverEnter:
0
3663 hoverEnterEvent(static_cast<QGraphicsSceneHoverEvent *>(event));-
3664 break;
never executed: break;
0
3665 case
never executed: case QEvent::GraphicsSceneHoverMove:
QEvent::GraphicsSceneHoverMove:
never executed: case QEvent::GraphicsSceneHoverMove:
0
3666 hoverMoveEvent(static_cast<QGraphicsSceneHoverEvent *>(event));-
3667 break;
never executed: break;
0
3668 case
never executed: case QEvent::GraphicsSceneHoverLeave:
QEvent::GraphicsSceneHoverLeave:
never executed: case QEvent::GraphicsSceneHoverLeave:
0
3669 hoverLeaveEvent(static_cast<QGraphicsSceneHoverEvent *>(event));-
3670 break;
never executed: break;
0
3671 case
never executed: case QEvent::GraphicsSceneMouseMove:
QEvent::GraphicsSceneMouseMove:
never executed: case QEvent::GraphicsSceneMouseMove:
0
3672 mouseMoveEvent(static_cast<QGraphicsSceneMouseEvent *>(event));-
3673 break;
never executed: break;
0
3674 case
never executed: case QEvent::GraphicsSceneMousePress:
QEvent::GraphicsSceneMousePress:
never executed: case QEvent::GraphicsSceneMousePress:
0
3675 mousePressEvent(static_cast<QGraphicsSceneMouseEvent *>(event));-
3676 break;
never executed: break;
0
3677 case
never executed: case QEvent::GraphicsSceneMouseRelease:
QEvent::GraphicsSceneMouseRelease:
never executed: case QEvent::GraphicsSceneMouseRelease:
0
3678 mouseReleaseEvent(static_cast<QGraphicsSceneMouseEvent *>(event));-
3679 break;
never executed: break;
0
3680 case
never executed: case QEvent::GraphicsSceneMouseDoubleClick:
QEvent::GraphicsSceneMouseDoubleClick:
never executed: case QEvent::GraphicsSceneMouseDoubleClick:
0
3681 mouseDoubleClickEvent(static_cast<QGraphicsSceneMouseEvent *>(event));-
3682 break;
never executed: break;
0
3683 case
never executed: case QEvent::GraphicsSceneWheel:
QEvent::GraphicsSceneWheel:
never executed: case QEvent::GraphicsSceneWheel:
0
3684 wheelEvent(static_cast<QGraphicsSceneWheelEvent *>(event));-
3685 break;
never executed: break;
0
3686 case
never executed: case QEvent::KeyPress:
QEvent::KeyPress:
never executed: case QEvent::KeyPress:
{
0
3687 QKeyEvent *k = static_cast<QKeyEvent *>(event);-
3688 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
3689 if (!(k->modifiers() & (Qt::ControlModifier | Qt::AltModifier))
!(k->modifiers...:AltModifier))Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
3690 bool res = false;-
3691 if (k->key() == Qt::Key_Backtab
k->key() == Qt::Key_BacktabDescription
TRUEnever evaluated
FALSEnever evaluated
0
3692 || (k->key() == Qt::Key_Tab
k->key() == Qt::Key_TabDescription
TRUEnever evaluated
FALSEnever evaluated
&& (
(k->modifiers(...ShiftModifier)Description
TRUEnever evaluated
FALSEnever evaluated
k->modifiers() & Qt::ShiftModifier)
(k->modifiers(...ShiftModifier)Description
TRUEnever evaluated
FALSEnever evaluated
)) {
0
3693 if (d_ptr->isWidget
d_ptr->isWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3694 res = static_cast<QGraphicsWidget *>(this)->focusNextPrevChild(false);-
3695 }
never executed: end of block
else if (d_ptr->scene
d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3696 res = d_ptr->scene->focusNextPrevChild(false);-
3697 }
never executed: end of block
0
3698 }
never executed: end of block
else if (k->key() == Qt::Key_Tab
k->key() == Qt::Key_TabDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3699 if (d_ptr->isWidget
d_ptr->isWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3700 res = static_cast<QGraphicsWidget *>(this)->focusNextPrevChild(true);-
3701 }
never executed: end of block
else if (d_ptr->scene
d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3702 res = d_ptr->scene->focusNextPrevChild(true);-
3703 }
never executed: end of block
0
3704 }
never executed: end of block
0
3705 if (!res
!resDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3706 event->ignore();
never executed: event->ignore();
0
3707 return
never executed: return true;
true;
never executed: return true;
0
3708 }-
3709 }
never executed: end of block
0
3710 keyPressEvent(static_cast<QKeyEvent *>(event));-
3711 break;
never executed: break;
0
3712 }-
3713 case
never executed: case QEvent::KeyRelease:
QEvent::KeyRelease:
never executed: case QEvent::KeyRelease:
0
3714 keyReleaseEvent(static_cast<QKeyEvent *>(event));-
3715 break;
never executed: break;
0
3716 case
never executed: case QEvent::InputMethod:
QEvent::InputMethod:
never executed: case QEvent::InputMethod:
0
3717 inputMethodEvent(static_cast<QInputMethodEvent *>(event));-
3718 break;
never executed: break;
0
3719 case
never executed: case QEvent::WindowActivate:
QEvent::WindowActivate:
never executed: case QEvent::WindowActivate:
0
3720 case
never executed: case QEvent::WindowDeactivate:
QEvent::WindowDeactivate:
never executed: case QEvent::WindowDeactivate:
0
3721-
3722 if (d_ptr->scene
d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3723 for (int i = 0; i < d_ptr->children.size()
i < d_ptr->children.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
3724 QGraphicsItem *child = d_ptr->children.at(i);-
3725 if (child->isVisible()
child->isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
&& !child->isPanel()
!child->isPanel()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
3726 if (!(child->d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorHandlesChildEvents)
!(child->d_ptr...esChildEvents)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3727 d_ptr->scene->sendEvent(child, event);
never executed: d_ptr->scene->sendEvent(child, event);
0
3728 }
never executed: end of block
0
3729 }
never executed: end of block
0
3730 }
never executed: end of block
0
3731 break;
never executed: break;
0
3732 default
never executed: default:
:
never executed: default:
0
3733 return
never executed: return false;
false;
never executed: return false;
0
3734 }-
3735-
3736 return
never executed: return true;
true;
never executed: return true;
0
3737}-
3738void QGraphicsItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)-
3739{-
3740 event->ignore();-
3741}
never executed: end of block
0
3742void QGraphicsItem::dragEnterEvent(QGraphicsSceneDragDropEvent *event)-
3743{-
3744 QGraphicsItemPrivate * const d = d_func();-
3745-
3746 if (d->isProxyWidget()
d->isProxyWidget()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3747 static_cast<
never executed: static_cast<QGraphicsProxyWidget*>(this)->dragEnterEvent(event);
QGraphicsProxyWidget*>(this)->dragEnterEvent(event);
never executed: static_cast<QGraphicsProxyWidget*>(this)->dragEnterEvent(event);
0
3748}
never executed: end of block
0
3749void QGraphicsItem::dragLeaveEvent(QGraphicsSceneDragDropEvent *event)-
3750{-
3751 QGraphicsItemPrivate * const d = d_func();-
3752-
3753 if (d->isProxyWidget()
d->isProxyWidget()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3754 static_cast<
never executed: static_cast<QGraphicsProxyWidget*>(this)->dragLeaveEvent(event);
QGraphicsProxyWidget*>(this)->dragLeaveEvent(event);
never executed: static_cast<QGraphicsProxyWidget*>(this)->dragLeaveEvent(event);
0
3755}
never executed: end of block
0
3756void QGraphicsItem::dragMoveEvent(QGraphicsSceneDragDropEvent *event)-
3757{-
3758 QGraphicsItemPrivate * const d = d_func();-
3759-
3760 if (d->isProxyWidget()
d->isProxyWidget()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3761 static_cast<
never executed: static_cast<QGraphicsProxyWidget*>(this)->dragMoveEvent(event);
QGraphicsProxyWidget*>(this)->dragMoveEvent(event);
never executed: static_cast<QGraphicsProxyWidget*>(this)->dragMoveEvent(event);
0
3762}
never executed: end of block
0
3763void QGraphicsItem::dropEvent(QGraphicsSceneDragDropEvent *event)-
3764{-
3765 QGraphicsItemPrivate * const d = d_func();-
3766-
3767 if (d->isProxyWidget()
d->isProxyWidget()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3768 static_cast<
never executed: static_cast<QGraphicsProxyWidget*>(this)->dropEvent(event);
QGraphicsProxyWidget*>(this)->dropEvent(event);
never executed: static_cast<QGraphicsProxyWidget*>(this)->dropEvent(event);
0
3769}
never executed: end of block
0
3770void QGraphicsItem::focusInEvent(QFocusEvent *event)-
3771{-
3772 (void)event;;-
3773 update();-
3774}
never executed: end of block
0
3775-
3776-
3777-
3778-
3779-
3780-
3781-
3782void QGraphicsItem::focusOutEvent(QFocusEvent *event)-
3783{-
3784 (void)event;;-
3785 update();-
3786}
never executed: end of block
0
3787void QGraphicsItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)-
3788{-
3789 (void)event;;-
3790 update();-
3791}
never executed: end of block
0
3792void QGraphicsItem::hoverMoveEvent(QGraphicsSceneHoverEvent *event)-
3793{-
3794 (void)event;;-
3795}
never executed: end of block
0
3796void QGraphicsItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)-
3797{-
3798 (void)event;;-
3799 update();-
3800}
never executed: end of block
0
3801void QGraphicsItem::keyPressEvent(QKeyEvent *event)-
3802{-
3803 event->ignore();-
3804}
never executed: end of block
0
3805void QGraphicsItem::keyReleaseEvent(QKeyEvent *event)-
3806{-
3807 event->ignore();-
3808}
never executed: end of block
0
3809void QGraphicsItem::mousePressEvent(QGraphicsSceneMouseEvent *event)-
3810{-
3811 if (event->button() == Qt::LeftButton
event->button(...Qt::LeftButtonDescription
TRUEnever evaluated
FALSEnever evaluated
&& (
(flags() & ItemIsSelectable)Description
TRUEnever evaluated
FALSEnever evaluated
flags() & ItemIsSelectable)
(flags() & ItemIsSelectable)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
3812 bool multiSelect = (event->modifiers() & Qt::ControlModifier) != 0;-
3813 if (!multiSelect
!multiSelectDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3814 if (!d_ptr->selected
!d_ptr->selectedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3815 if (QGraphicsScene *scene = d_ptr->scene
QGraphicsScene...= d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3816 ++scene->d_func()->selectionChanging;-
3817 scene->clearSelection();-
3818 --scene->d_func()->selectionChanging;-
3819 }
never executed: end of block
0
3820 setSelected(true);-
3821 }
never executed: end of block
0
3822 }
never executed: end of block
0
3823 }
never executed: end of block
else if (!(flags() & ItemIsMovable)
!(flags() & ItemIsMovable)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
3824 event->ignore();-
3825 }
never executed: end of block
0
3826 if (d_ptr->isWidget
d_ptr->isWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3827-
3828 QGraphicsWidget *w = static_cast<QGraphicsWidget *>(this);-
3829 if ((
(w->windowFlag...) == Qt::PopupDescription
TRUEnever evaluated
FALSEnever evaluated
w->windowFlags() & Qt::Popup) == Qt::Popup
(w->windowFlag...) == Qt::PopupDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3830 event->accept();-
3831 if (!w->rect().contains(event->pos())
!w->rect().con...(event->pos())Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3832 w->close();
never executed: w->close();
0
3833 }
never executed: end of block
0
3834 }
never executed: end of block
0
3835}
never executed: end of block
0
3836-
3837-
3838-
3839-
3840bool _qt_movableAncestorIsSelected(const QGraphicsItem *item)-
3841{-
3842 const QGraphicsItem *parent = item->parentItem();-
3843 return
never executed: return parent && (((parent->flags() & QGraphicsItem::ItemIsMovable) && parent->isSelected()) || _qt_movableAncestorIsSelected(parent));
parent && (((parent->flags() & QGraphicsItem::ItemIsMovable) && parent->isSelected()) || _qt_movableAncestorIsSelected(parent));
never executed: return parent && (((parent->flags() & QGraphicsItem::ItemIsMovable) && parent->isSelected()) || _qt_movableAncestorIsSelected(parent));
0
3844}-
3845-
3846bool QGraphicsItemPrivate::movableAncestorIsSelected(const QGraphicsItem *item)-
3847{-
3848 const QGraphicsItem *parent = item->d_ptr->parent;-
3849 return
never executed: return parent && (((parent->flags() & QGraphicsItem::ItemIsMovable) && parent->isSelected()) || _qt_movableAncestorIsSelected(parent));
parent && (((parent->flags() & QGraphicsItem::ItemIsMovable) && parent->isSelected()) || _qt_movableAncestorIsSelected(parent));
never executed: return parent && (((parent->flags() & QGraphicsItem::ItemIsMovable) && parent->isSelected()) || _qt_movableAncestorIsSelected(parent));
0
3850}-
3851void QGraphicsItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)-
3852{-
3853 if ((
(event->button...t::LeftButton)Description
TRUEnever evaluated
FALSEnever evaluated
event->buttons() & Qt::LeftButton)
(event->button...t::LeftButton)Description
TRUEnever evaluated
FALSEnever evaluated
&& (
(flags() & ItemIsMovable)Description
TRUEnever evaluated
FALSEnever evaluated
flags() & ItemIsMovable)
(flags() & ItemIsMovable)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
3854-
3855 QList<QGraphicsItem *> selectedItems;-
3856 QHash<QGraphicsItem *, QPointF> initialPositions;-
3857 if (d_ptr->scene
d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3858 selectedItems = d_ptr->scene->selectedItems();-
3859 initialPositions = d_ptr->scene->d_func()->movingItemsInitialPositions;-
3860 if (initialPositions.isEmpty()
initialPositions.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
3861 for (QForeachContainer<typename QtPrivate::remove_reference<decltype(selectedItems)>::type> _container_((selectedItems)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QGraphicsItem *item = *_container_.i; _container_.control; _container_.control = 0)-
3862 initialPositions[item] = item->pos();
never executed: initialPositions[item] = item->pos();
0
3863 initialPositions[this] = pos();-
3864 }
never executed: end of block
0
3865 d_ptr->scene->d_func()->movingItemsInitialPositions = initialPositions;-
3866 }
never executed: end of block
0
3867-
3868-
3869 QGraphicsView *view = 0;-
3870 if (event->widget()
event->widget()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3871 view = qobject_cast<QGraphicsView *>(event->widget()->parentWidget());
never executed: view = qobject_cast<QGraphicsView *>(event->widget()->parentWidget());
0
3872-
3873-
3874 int i = 0;-
3875 bool movedMe = false;-
3876 while (i <= selectedItems.size()
i <= selectedItems.size()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
3877 QGraphicsItem *item = 0;-
3878 if (i < selectedItems.size()
i < selectedItems.size()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3879 item = selectedItems.at(i);
never executed: item = selectedItems.at(i);
0
3880 else-
3881 item = this;
never executed: item = this;
0
3882 if (item == this
item == thisDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3883-
3884-
3885-
3886-
3887 if (movedMe
movedMeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3888 break;
never executed: break;
0
3889 movedMe = true;-
3890 }
never executed: end of block
0
3891-
3892 if ((
(item->flags()...ItemIsMovable)Description
TRUEnever evaluated
FALSEnever evaluated
item->flags() & ItemIsMovable)
(item->flags()...ItemIsMovable)Description
TRUEnever evaluated
FALSEnever evaluated
&& !QGraphicsItemPrivate::movableAncestorIsSelected(item)
!QGraphicsItem...Selected(item)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
3893 QPointF currentParentPos;-
3894 QPointF buttonDownParentPos;-
3895 if (item->d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorIgnoresTransformations
item->d_ptr->a...ransformationsDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3896-
3897-
3898-
3899 QTransform viewToItemTransform = (item->deviceTransform(view->viewportTransform())).inverted();-
3900 currentParentPos = mapToParent(viewToItemTransform.map(QPointF(view->mapFromGlobal(event->screenPos()))));-
3901 buttonDownParentPos = mapToParent(viewToItemTransform.map(QPointF(view->mapFromGlobal(event->buttonDownScreenPos(Qt::LeftButton)))));-
3902 }
never executed: end of block
else if (item->flags() & ItemIgnoresTransformations
item->flags() ...ransformationsDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3903-
3904-
3905-
3906-
3907 QTransform itemTransform;-
3908 if (item->d_ptr->transformData
item->d_ptr->transformDataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3909 itemTransform = item->d_ptr->transformData->computedFullTransform();
never executed: itemTransform = item->d_ptr->transformData->computedFullTransform();
0
3910 itemTransform.translate(item->d_ptr->pos.x(), item->d_ptr->pos.y());-
3911 QTransform viewToParentTransform = itemTransform-
3912 * (item->sceneTransform() * view->viewportTransform()).inverted();-
3913 currentParentPos = viewToParentTransform.map(QPointF(view->mapFromGlobal(event->screenPos())));-
3914 buttonDownParentPos = viewToParentTransform.map(QPointF(view->mapFromGlobal(event->buttonDownScreenPos(Qt::LeftButton))));-
3915 }
never executed: end of block
else {
0
3916-
3917 currentParentPos = item->mapToParent(item->mapFromScene(event->scenePos()));-
3918 buttonDownParentPos = item->mapToParent(item->mapFromScene(event->buttonDownScenePos(Qt::LeftButton)));-
3919 }
never executed: end of block
0
3920-
3921 item->setPos(initialPositions.value(item) + currentParentPos - buttonDownParentPos);-
3922-
3923 if (item->flags() & ItemIsSelectable
item->flags() ...emIsSelectableDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3924 item->setSelected(true);
never executed: item->setSelected(true);
0
3925 }
never executed: end of block
0
3926 ++i;-
3927 }
never executed: end of block
0
3928-
3929 }
never executed: end of block
else {
0
3930 event->ignore();-
3931 }
never executed: end of block
0
3932}-
3933void QGraphicsItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)-
3934{-
3935 if (event->button() == Qt::LeftButton
event->button(...Qt::LeftButtonDescription
TRUEnever evaluated
FALSEnever evaluated
&& (
(flags() & ItemIsSelectable)Description
TRUEnever evaluated
FALSEnever evaluated
flags() & ItemIsSelectable)
(flags() & ItemIsSelectable)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
3936 bool multiSelect = (event->modifiers() & Qt::ControlModifier) != 0;-
3937 if (event->scenePos() == event->buttonDownScenePos(Qt::LeftButton)
event->scenePo...t::LeftButton)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
3938-
3939 if (multiSelect
multiSelectDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3940 setSelected(!isSelected());-
3941 }
never executed: end of block
else {
0
3942 bool selectionChanged = false;-
3943 if (QGraphicsScene *scene = d_ptr->scene
QGraphicsScene...= d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3944 ++scene->d_func()->selectionChanging;-
3945-
3946-
3947-
3948 if (d_ptr->selected
d_ptr->selectedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3949 scene->d_func()->selectedItems.remove(this);-
3950 for (QForeachContainer<typename QtPrivate::remove_reference<decltype(scene->d_func()->selectedItems)>::type> _container_((scene->d_func()->selectedItems)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QGraphicsItem *item = *_container_.i; _container_.control; _container_.control = 0) {-
3951 if (item->isSelected()
item->isSelected()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
3952 selectionChanged = true;-
3953 break;
never executed: break;
0
3954 }-
3955 }
never executed: end of block
0
3956 }
never executed: end of block
0
3957 scene->clearSelection();-
3958 if (d_ptr->selected
d_ptr->selectedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3959 scene->d_func()->selectedItems.insert(this);
never executed: scene->d_func()->selectedItems.insert(this);
0
3960 --scene->d_func()->selectionChanging;-
3961 if (selectionChanged
selectionChangedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3962 d_ptr->scene->selectionChanged();
never executed: d_ptr->scene->selectionChanged();
0
3963 }
never executed: end of block
0
3964 setSelected(true);-
3965 }
never executed: end of block
0
3966 }-
3967 }
never executed: end of block
0
3968 if (d_ptr->scene
d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
&& !event->buttons()
!event->buttons()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3969 d_ptr->scene->d_func()->movingItemsInitialPositions.clear();
never executed: d_ptr->scene->d_func()->movingItemsInitialPositions.clear();
0
3970}
never executed: end of block
0
3971void QGraphicsItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)-
3972{-
3973 mousePressEvent(event);-
3974}
never executed: end of block
0
3975void QGraphicsItem::wheelEvent(QGraphicsSceneWheelEvent *event)-
3976{-
3977 event->ignore();-
3978}
never executed: end of block
0
3979void QGraphicsItem::inputMethodEvent(QInputMethodEvent *event)-
3980{-
3981 event->ignore();-
3982}
never executed: end of block
0
3983QVariant QGraphicsItem::inputMethodQuery(Qt::InputMethodQuery query) const-
3984{-
3985 (void)query;;-
3986 return
never executed: return QVariant();
QVariant();
never executed: return QVariant();
0
3987}-
3988Qt::InputMethodHints QGraphicsItem::inputMethodHints() const-
3989{-
3990 const QGraphicsItemPrivate * const d = d_func();-
3991 return
never executed: return d->imHints;
d->imHints;
never executed: return d->imHints;
0
3992}-
3993void QGraphicsItem::setInputMethodHints(Qt::InputMethodHints hints)-
3994{-
3995 QGraphicsItemPrivate * const d = d_func();-
3996 d->imHints = hints;-
3997 if (!hasFocus()
!hasFocus()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3998 return;
never executed: return;
0
3999 d->scene->d_func()->updateInputMethodSensitivityInViews();-
4000 QWidget *fw = QApplication::focusWidget();-
4001 if (!fw
!fwDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
4002 return;
never executed: return;
0
4003 QGuiApplication::inputMethod()->update(Qt::ImHints);-
4004}
never executed: end of block
0
4005void QGraphicsItem::updateMicroFocus()-
4006{-
4007}-
4008QVariant QGraphicsItem::itemChange(GraphicsItemChange change, const QVariant &value)-
4009{-
4010 (void)change;;-
4011 return
never executed: return value;
value;
never executed: return value;
0
4012}-
4013-
4014-
4015-
4016-
4017-
4018-
4019-
4020bool QGraphicsItem::supportsExtension(Extension extension) const-
4021{-
4022 (void)extension;;-
4023 return
never executed: return false;
false;
never executed: return false;
0
4024}-
4025-
4026-
4027-
4028-
4029-
4030-
4031-
4032void QGraphicsItem::setExtension(Extension extension, const QVariant &variant)-
4033{-
4034 (void)extension;;-
4035 (void)variant;;-
4036}
never executed: end of block
0
4037-
4038-
4039-
4040-
4041-
4042-
4043-
4044QVariant QGraphicsItem::extension(const QVariant &variant) const-
4045{-
4046 (void)variant;;-
4047 return
never executed: return QVariant();
QVariant();
never executed: return QVariant();
0
4048}-
4049void QGraphicsItem::addToIndex()-
4050{-
4051 if (d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren
d_ptr->ancesto...rClipsChildrenDescription
TRUEnever evaluated
FALSEnever evaluated
0
4052 || d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorContainsChildren
d_ptr->ancesto...ntainsChildrenDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
4053-
4054 return;
never executed: return;
0
4055 }-
4056 if (d_ptr->scene
d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
4057 d_ptr->scene->d_func()->index->addItem(this);
never executed: d_ptr->scene->d_func()->index->addItem(this);
0
4058}
never executed: end of block
0
4059void QGraphicsItem::removeFromIndex()-
4060{-
4061 if (d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren
d_ptr->ancesto...rClipsChildrenDescription
TRUEnever evaluated
FALSEnever evaluated
0
4062 || d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorContainsChildren
d_ptr->ancesto...ntainsChildrenDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
4063-
4064 return;
never executed: return;
0
4065 }-
4066 if (d_ptr->scene
d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
4067 d_ptr->scene->d_func()->index->removeItem(this);
never executed: d_ptr->scene->d_func()->index->removeItem(this);
0
4068}
never executed: end of block
0
4069void QGraphicsItem::prepareGeometryChange()-
4070{-
4071 if (d_ptr->inDestructor
d_ptr->inDestructorDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
4072 return;
never executed: return;
0
4073 if (d_ptr->scene
d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
4074 d_ptr->scene->d_func()->dirtyGrowingItemsBoundingRect = true;-
4075 d_ptr->geometryChanged = 1;-
4076 d_ptr->paintedViewBoundingRectsNeedRepaint = 1;-
4077 d_ptr->notifyBoundingRectChanged = !d_ptr->inSetPosHelper;-
4078-
4079 QGraphicsScenePrivate *scenePrivate = d_ptr->scene->d_func();-
4080 scenePrivate->index->prepareBoundingRectChange(this);-
4081 scenePrivate->markDirty(this, QRectF(), true, false,-
4082 false, false,-
4083 true);-
4084-
4085-
4086-
4087-
4088-
4089 if (scenePrivate->isSignalConnected(scenePrivate->changedSignalIndex)
scenePrivate->...edSignalIndex)Description
TRUEnever evaluated
FALSEnever evaluated
0
4090 || scenePrivate->views.isEmpty()
scenePrivate->views.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
4091 if (d_ptr->hasTranslateOnlySceneTransform()
d_ptr->hasTran...eneTransform()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
4092 d_ptr->scene->update(boundingRect().translated(d_ptr->sceneTransform.dx(),-
4093 d_ptr->sceneTransform.dy()));-
4094 }
never executed: end of block
else {
0
4095 d_ptr->scene->update(d_ptr->sceneTransform.mapRect(boundingRect()));-
4096 }
never executed: end of block
0
4097 }-
4098 }
never executed: end of block
0
4099-
4100 d_ptr->markParentDirty( true);-
4101}
never executed: end of block
0
4102static void qt_graphicsItem_highlightSelected(-
4103 QGraphicsItem *item, QPainter *painter, const QStyleOptionGraphicsItem *option)-
4104{-
4105 const QRectF murect = painter->transform().mapRect(QRectF(0, 0, 1, 1));-
4106 if (qFuzzyIsNull(qMax(murect.width(), murect.height()))
qFuzzyIsNull(q...ect.height()))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
4107 return;
never executed: return;
0
4108-
4109 const QRectF mbrect = painter->transform().mapRect(item->boundingRect());-
4110 if (qMin(mbrect.width(), mbrect.height()) < qreal(1.0)
qMin(mbrect.wi...) < qreal(1.0)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
4111 return;
never executed: return;
0
4112-
4113 qreal itemPenWidth;-
4114 switch (item->type()) {-
4115 case
never executed: case QGraphicsEllipseItem::Type:
QGraphicsEllipseItem::Type:
never executed: case QGraphicsEllipseItem::Type:
0
4116 itemPenWidth = static_cast<QGraphicsEllipseItem *>(item)->pen().widthF();-
4117 break;
never executed: break;
0
4118 case
never executed: case QGraphicsPathItem::Type:
QGraphicsPathItem::Type:
never executed: case QGraphicsPathItem::Type:
0
4119 itemPenWidth = static_cast<QGraphicsPathItem *>(item)->pen().widthF();-
4120 break;
never executed: break;
0
4121 case
never executed: case QGraphicsPolygonItem::Type:
QGraphicsPolygonItem::Type:
never executed: case QGraphicsPolygonItem::Type:
0
4122 itemPenWidth = static_cast<QGraphicsPolygonItem *>(item)->pen().widthF();-
4123 break;
never executed: break;
0
4124 case
never executed: case QGraphicsRectItem::Type:
QGraphicsRectItem::Type:
never executed: case QGraphicsRectItem::Type:
0
4125 itemPenWidth = static_cast<QGraphicsRectItem *>(item)->pen().widthF();-
4126 break;
never executed: break;
0
4127 case
never executed: case QGraphicsSimpleTextItem::Type:
QGraphicsSimpleTextItem::Type:
never executed: case QGraphicsSimpleTextItem::Type:
0
4128 itemPenWidth = static_cast<QGraphicsSimpleTextItem *>(item)->pen().widthF();-
4129 break;
never executed: break;
0
4130 case
never executed: case QGraphicsLineItem::Type:
QGraphicsLineItem::Type:
never executed: case QGraphicsLineItem::Type:
0
4131 itemPenWidth = static_cast<QGraphicsLineItem *>(item)->pen().widthF();-
4132 break;
never executed: break;
0
4133 default
never executed: default:
:
never executed: default:
0
4134 itemPenWidth = 1.0;-
4135 }
never executed: end of block
0
4136 const qreal pad = itemPenWidth / 2;-
4137-
4138 const qreal penWidth = 0;-
4139-
4140 const QColor fgcolor = option->palette.windowText().color();-
4141 const QColor bgcolor(-
4142 fgcolor.red() > 127 ? 0 : 255,-
4143 fgcolor.green() > 127 ? 0 : 255,-
4144 fgcolor.blue() > 127 ? 0 : 255);-
4145-
4146 painter->setPen(QPen(bgcolor, penWidth, Qt::SolidLine));-
4147 painter->setBrush(Qt::NoBrush);-
4148 painter->drawRect(item->boundingRect().adjusted(pad, pad, -pad, -pad));-
4149-
4150 painter->setPen(QPen(option->palette.windowText(), 0, Qt::DashLine));-
4151 painter->setBrush(Qt::NoBrush);-
4152 painter->drawRect(item->boundingRect().adjusted(pad, pad, -pad, -pad));-
4153}
never executed: end of block
0
4154QGraphicsObject::QGraphicsObject(QGraphicsItem *parent)-
4155 : QGraphicsItem(parent)-
4156{-
4157 QGraphicsItem::d_ptr->isObject = true;-
4158}
never executed: end of block
0
4159-
4160-
4161-
4162-
4163QGraphicsObject::QGraphicsObject(QGraphicsItemPrivate &dd, QGraphicsItem *parent)-
4164 : QGraphicsItem(dd, parent)-
4165{-
4166 QGraphicsItem::d_ptr->isObject = true;-
4167}
never executed: end of block
0
4168-
4169-
4170-
4171-
4172QGraphicsObject::~QGraphicsObject()-
4173{-
4174}-
4175-
4176-
4177-
4178-
4179bool QGraphicsObject::event(QEvent *ev)-
4180{-
4181 if (ev->type() == QEvent::StyleAnimationUpdate
ev->type() == ...nimationUpdateDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
4182 if (isVisible()
isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
4183 ev->accept();-
4184 update();-
4185 }
never executed: end of block
0
4186 return
never executed: return true;
true;
never executed: return true;
0
4187 }-
4188 return
never executed: return QObject::event(ev);
QObject::event(ev);
never executed: return QObject::event(ev);
0
4189}-
4190-
4191-
4192-
4193-
4194-
4195-
4196-
4197void QGraphicsObject::grabGesture(Qt::GestureType gesture, Qt::GestureFlags flags)-
4198{-
4199 bool contains = QGraphicsItem::d_ptr->gestureContext.contains(gesture);-
4200 QGraphicsItem::d_ptr->gestureContext.insert(gesture, flags);-
4201 if (!contains
!containsDescription
TRUEnever evaluated
FALSEnever evaluated
&& QGraphicsItem::d_ptr->scene
QGraphicsItem::d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
4202 QGraphicsItem::d_ptr->scene->d_func()->grabGesture(this, gesture);
never executed: QGraphicsItem::d_ptr->scene->d_func()->grabGesture(this, gesture);
0
4203}
never executed: end of block
0
4204-
4205-
4206-
4207-
4208-
4209-
4210void QGraphicsObject::ungrabGesture(Qt::GestureType gesture)-
4211{-
4212 if (QGraphicsItem::d_ptr->gestureContext.remove(gesture)
QGraphicsItem:...emove(gesture)Description
TRUEnever evaluated
FALSEnever evaluated
&& QGraphicsItem::d_ptr->scene
QGraphicsItem::d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
4213 QGraphicsItem::d_ptr->scene->d_func()->ungrabGesture(this, gesture);
never executed: QGraphicsItem::d_ptr->scene->d_func()->ungrabGesture(this, gesture);
0
4214}
never executed: end of block
0
4215void QGraphicsObject::updateMicroFocus()-
4216{-
4217 QGraphicsItem::updateMicroFocus();-
4218}
never executed: end of block
0
4219-
4220void QGraphicsItemPrivate::children_append(QDeclarativeListProperty<QGraphicsObject> *list, QGraphicsObject *item)-
4221{-
4222 if (item
itemDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
4223 QGraphicsObject *graphicsObject = static_cast<QGraphicsObject *>(list->object);-
4224 if (QGraphicsItemPrivate::get(graphicsObject)->sendParentChangeNotification
QGraphicsItemP...geNotificationDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
4225 item->setParentItem(graphicsObject);-
4226 }
never executed: end of block
else {
0
4227 QGraphicsItemPrivate::get(item)->setParentItemHelper(graphicsObject, 0, 0);-
4228 }
never executed: end of block
0
4229 }-
4230}
never executed: end of block
0
4231-
4232int QGraphicsItemPrivate::children_count(QDeclarativeListProperty<QGraphicsObject> *list)-
4233{-
4234 QGraphicsItemPrivate *d = QGraphicsItemPrivate::get(static_cast<QGraphicsObject *>(list->object));-
4235 return
never executed: return d->children.count();
d->children.count();
never executed: return d->children.count();
0
4236}-
4237-
4238QGraphicsObject *QGraphicsItemPrivate::children_at(QDeclarativeListProperty<QGraphicsObject> *list, int index)-
4239{-
4240 QGraphicsItemPrivate *d = QGraphicsItemPrivate::get(static_cast<QGraphicsObject *>(list->object));-
4241 if (index >= 0
index >= 0Description
TRUEnever evaluated
FALSEnever evaluated
&& index < d->children.count()
index < d->children.count()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
4242 return
never executed: return d->children.at(index)->toGraphicsObject();
d->children.at(index)->toGraphicsObject();
never executed: return d->children.at(index)->toGraphicsObject();
0
4243 else-
4244 return
never executed: return 0;
0;
never executed: return 0;
0
4245}-
4246-
4247void QGraphicsItemPrivate::children_clear(QDeclarativeListProperty<QGraphicsObject> *list)-
4248{-
4249 QGraphicsItemPrivate *d = QGraphicsItemPrivate::get(static_cast<QGraphicsObject *>(list->object));-
4250 int childCount = d->children.count();-
4251 if (d->sendParentChangeNotification
d->sendParentC...geNotificationDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
4252 for (int index = 0; index < childCount
index < childCountDescription
TRUEnever evaluated
FALSEnever evaluated
; index++)
0
4253 d->children.at(0)->setParentItem(0);
never executed: d->children.at(0)->setParentItem(0);
0
4254 }
never executed: end of block
else {
0
4255 for (int index = 0; index < childCount
index < childCountDescription
TRUEnever evaluated
FALSEnever evaluated
; index++)
0
4256 QGraphicsItemPrivate::get(d->children.at(0))->setParentItemHelper(0, 0, 0);
never executed: QGraphicsItemPrivate::get(d->children.at(0))->setParentItemHelper(0, 0, 0);
0
4257 }
never executed: end of block
0
4258}-
4259QDeclarativeListProperty<QGraphicsObject> QGraphicsItemPrivate::childrenList()-
4260{-
4261 QGraphicsItem * const q = q_func();-
4262 if (isObject
isObjectDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
4263 QGraphicsObject *that = static_cast<QGraphicsObject *>(q);-
4264 return
never executed: return QDeclarativeListProperty<QGraphicsObject>(that, &children, children_append, children_count, children_at, children_clear);
QDeclarativeListProperty<QGraphicsObject>(that, &children, children_append,
never executed: return QDeclarativeListProperty<QGraphicsObject>(that, &children, children_append, children_count, children_at, children_clear);
0
4265 children_count, children_at, children_clear);
never executed: return QDeclarativeListProperty<QGraphicsObject>(that, &children, children_append, children_count, children_at, children_clear);
0
4266 } else {-
4267-
4268 return
never executed: return QDeclarativeListProperty<QGraphicsObject>();
QDeclarativeListProperty<QGraphicsObject>();
never executed: return QDeclarativeListProperty<QGraphicsObject>();
0
4269 }-
4270}-
4271-
4272-
4273-
4274-
4275-
4276-
4277qreal QGraphicsItemPrivate::width() const-
4278{-
4279 return
never executed: return 0;
0;
never executed: return 0;
0
4280}-
4281-
4282-
4283-
4284-
4285-
4286-
4287void QGraphicsItemPrivate::setWidth(qreal w)-
4288{-
4289 (void)w;;-
4290}
never executed: end of block
0
4291-
4292-
4293-
4294-
4295-
4296-
4297void QGraphicsItemPrivate::resetWidth()-
4298{-
4299}-
4300-
4301-
4302-
4303-
4304-
4305-
4306qreal QGraphicsItemPrivate::height() const-
4307{-
4308 return
never executed: return 0;
0;
never executed: return 0;
0
4309}-
4310-
4311-
4312-
4313-
4314-
4315-
4316void QGraphicsItemPrivate::setHeight(qreal h)-
4317{-
4318 (void)h;;-
4319}
never executed: end of block
0
4320-
4321-
4322-
4323-
4324-
4325-
4326void QGraphicsItemPrivate::resetHeight()-
4327{-
4328}-
4329class QAbstractGraphicsShapeItemPrivate : public QGraphicsItemPrivate-
4330{-
4331 inline QAbstractGraphicsShapeItem* q_func() { return static_cast<QAbstractGraphicsShapeItem *>(q_ptr); } inline const QAbstractGraphicsShapeItem* q_func() const { return static_cast<const QAbstractGraphicsShapeItem *>(q_ptr); } friend class QAbstractGraphicsShapeItem;-
4332public:-
4333-
4334 QBrush brush;-
4335 QPen pen;-
4336-
4337-
4338 mutable QRectF boundingRect;-
4339};-
4340-
4341-
4342-
4343-
4344-
4345QAbstractGraphicsShapeItem::QAbstractGraphicsShapeItem(QGraphicsItem *parent)-
4346 : QGraphicsItem(*new QAbstractGraphicsShapeItemPrivate, parent)-
4347{-
4348}
never executed: end of block
0
4349-
4350-
4351-
4352-
4353QAbstractGraphicsShapeItem::QAbstractGraphicsShapeItem(QAbstractGraphicsShapeItemPrivate &dd, QGraphicsItem *parent)-
4354 : QGraphicsItem(dd, parent)-
4355{-
4356}
never executed: end of block
0
4357-
4358-
4359-
4360-
4361QAbstractGraphicsShapeItem::~QAbstractGraphicsShapeItem()-
4362{-
4363}-
4364-
4365-
4366-
4367-
4368-
4369QPen QAbstractGraphicsShapeItem::pen() const-
4370{-
4371 const QAbstractGraphicsShapeItemPrivate * const d = d_func();-
4372 return
never executed: return d->pen;
d->pen;
never executed: return d->pen;
0
4373}-
4374void QAbstractGraphicsShapeItem::setPen(const QPen &pen)-
4375{-
4376 QAbstractGraphicsShapeItemPrivate * const d = d_func();-
4377 if (d->pen == pen
d->pen == penDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
4378 return;
never executed: return;
0
4379 prepareGeometryChange();-
4380 d->pen = pen;-
4381 d->boundingRect = QRectF();-
4382 update();-
4383}
never executed: end of block
0
4384-
4385-
4386-
4387-
4388-
4389-
4390QBrush QAbstractGraphicsShapeItem::brush() const-
4391{-
4392 const QAbstractGraphicsShapeItemPrivate * const d = d_func();-
4393 return
never executed: return d->brush;
d->brush;
never executed: return d->brush;
0
4394}-
4395void QAbstractGraphicsShapeItem::setBrush(const QBrush &brush)-
4396{-
4397 QAbstractGraphicsShapeItemPrivate * const d = d_func();-
4398 if (d->brush == brush
d->brush == brushDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
4399 return;
never executed: return;
0
4400 d->brush = brush;-
4401 update();-
4402}
never executed: end of block
0
4403-
4404-
4405-
4406-
4407bool QAbstractGraphicsShapeItem::isObscuredBy(const QGraphicsItem *item) const-
4408{-
4409 return
never executed: return QGraphicsItem::isObscuredBy(item);
QGraphicsItem::isObscuredBy(item);
never executed: return QGraphicsItem::isObscuredBy(item);
0
4410}-
4411-
4412-
4413-
4414-
4415QPainterPath QAbstractGraphicsShapeItem::opaqueArea() const-
4416{-
4417 const QAbstractGraphicsShapeItemPrivate * const d = d_func();-
4418 if (d->brush.isOpaque()
d->brush.isOpaque()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
4419 return
never executed: return isClipped() ? clipPath() : shape();
isClipped() ? clipPath() : shape();
never executed: return isClipped() ? clipPath() : shape();
0
4420 return
never executed: return QGraphicsItem::opaqueArea();
QGraphicsItem::opaqueArea();
never executed: return QGraphicsItem::opaqueArea();
0
4421}-
4422class QGraphicsPathItemPrivate : public QAbstractGraphicsShapeItemPrivate-
4423{-
4424 inline QGraphicsPathItem* q_func() { return static_cast<QGraphicsPathItem *>(q_ptr); } inline const QGraphicsPathItem* q_func() const { return static_cast<const QGraphicsPathItem *>(q_ptr); } friend class QGraphicsPathItem;-
4425public:-
4426 QPainterPath path;-
4427};-
4428-
4429-
4430-
4431-
4432-
4433-
4434-
4435QGraphicsPathItem::QGraphicsPathItem(const QPainterPath &path,-
4436 QGraphicsItem *parent)-
4437 : QAbstractGraphicsShapeItem(*new QGraphicsPathItemPrivate, parent)-
4438{-
4439 if (!path.isEmpty()
!path.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
4440 setPath(path);
never executed: setPath(path);
0
4441}
never executed: end of block
0
4442-
4443-
4444-
4445-
4446-
4447-
4448-
4449QGraphicsPathItem::QGraphicsPathItem(QGraphicsItem *parent)-
4450 : QAbstractGraphicsShapeItem(*new QGraphicsPathItemPrivate, parent)-
4451{-
4452}
never executed: end of block
0
4453-
4454-
4455-
4456-
4457QGraphicsPathItem::~QGraphicsPathItem()-
4458{-
4459}-
4460-
4461-
4462-
4463-
4464-
4465-
4466-
4467QPainterPath QGraphicsPathItem::path() const-
4468{-
4469 const QGraphicsPathItemPrivate * const d = d_func();-
4470 return
never executed: return d->path;
d->path;
never executed: return d->path;
0
4471}-
4472-
4473-
4474-
4475-
4476-
4477-
4478void QGraphicsPathItem::setPath(const QPainterPath &path)-
4479{-
4480 QGraphicsPathItemPrivate * const d = d_func();-
4481 if (d->path == path
d->path == pathDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
4482 return;
never executed: return;
0
4483 prepareGeometryChange();-
4484 d->path = path;-
4485 d->boundingRect = QRectF();-
4486 update();-
4487}
never executed: end of block
0
4488-
4489-
4490-
4491-
4492QRectF QGraphicsPathItem::boundingRect() const-
4493{-
4494 const QGraphicsPathItemPrivate * const d = d_func();-
4495 if (d->boundingRect.isNull()
d->boundingRect.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
4496 qreal pw = pen().style() == Qt::NoPen
pen().style() == Qt::NoPenDescription
TRUEnever evaluated
FALSEnever evaluated
? qreal(0) : pen().widthF();
0
4497 if (pw == 0.0
pw == 0.0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
4498 d->boundingRect = d->path.controlPointRect();
never executed: d->boundingRect = d->path.controlPointRect();
0
4499 else {-
4500 d->boundingRect = shape().controlPointRect();-
4501 }
never executed: end of block
0
4502 }-
4503 return
never executed: return d->boundingRect;
d->boundingRect;
never executed: return d->boundingRect;
0
4504}-
4505-
4506-
4507-
4508-
4509QPainterPath QGraphicsPathItem::shape() const-
4510{-
4511 const QGraphicsPathItemPrivate * const d = d_func();-
4512 return
never executed: return qt_graphicsItem_shapeFromPath(d->path, d->pen);
qt_graphicsItem_shapeFromPath(d->path, d->pen);
never executed: return qt_graphicsItem_shapeFromPath(d->path, d->pen);
0
4513}-
4514-
4515-
4516-
4517-
4518bool QGraphicsPathItem::contains(const QPointF &point) const-
4519{-
4520 return
never executed: return QAbstractGraphicsShapeItem::contains(point);
QAbstractGraphicsShapeItem::contains(point);
never executed: return QAbstractGraphicsShapeItem::contains(point);
0
4521}-
4522-
4523-
4524-
4525-
4526void QGraphicsPathItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,-
4527 QWidget *widget)-
4528{-
4529 QGraphicsPathItemPrivate * const d = d_func();-
4530 (void)widget;;-
4531 painter->setPen(d->pen);-
4532 painter->setBrush(d->brush);-
4533 painter->drawPath(d->path);-
4534-
4535 if (option->state & QStyle::State_Selected
option->state ...State_SelectedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
4536 qt_graphicsItem_highlightSelected(this, painter, option);
never executed: qt_graphicsItem_highlightSelected(this, painter, option);
0
4537}
never executed: end of block
0
4538-
4539-
4540-
4541-
4542bool QGraphicsPathItem::isObscuredBy(const QGraphicsItem *item) const-
4543{-
4544 return
never executed: return QAbstractGraphicsShapeItem::isObscuredBy(item);
QAbstractGraphicsShapeItem::isObscuredBy(item);
never executed: return QAbstractGraphicsShapeItem::isObscuredBy(item);
0
4545}-
4546-
4547-
4548-
4549-
4550QPainterPath QGraphicsPathItem::opaqueArea() const-
4551{-
4552 return
never executed: return QAbstractGraphicsShapeItem::opaqueArea();
QAbstractGraphicsShapeItem::opaqueArea();
never executed: return QAbstractGraphicsShapeItem::opaqueArea();
0
4553}-
4554-
4555-
4556-
4557-
4558int QGraphicsPathItem::type() const-
4559{-
4560 return
never executed: return Type;
Type;
never executed: return Type;
0
4561}-
4562-
4563-
4564-
4565-
4566bool QGraphicsPathItem::supportsExtension(Extension extension) const-
4567{-
4568 (void)extension;;-
4569 return
never executed: return false;
false;
never executed: return false;
0
4570}-
4571-
4572-
4573-
4574-
4575void QGraphicsPathItem::setExtension(Extension extension, const QVariant &variant)-
4576{-
4577 (void)extension;;-
4578 (void)variant;;-
4579}
never executed: end of block
0
4580-
4581-
4582-
4583-
4584QVariant QGraphicsPathItem::extension(const QVariant &variant) const-
4585{-
4586 (void)variant;;-
4587 return
never executed: return QVariant();
QVariant();
never executed: return QVariant();
0
4588}-
4589class QGraphicsRectItemPrivate : public QAbstractGraphicsShapeItemPrivate-
4590{-
4591 inline QGraphicsRectItem* q_func() { return static_cast<QGraphicsRectItem *>(q_ptr); } inline const QGraphicsRectItem* q_func() const { return static_cast<const QGraphicsRectItem *>(q_ptr); } friend class QGraphicsRectItem;-
4592public:-
4593 QRectF rect;-
4594};-
4595-
4596-
4597-
4598-
4599-
4600-
4601-
4602QGraphicsRectItem::QGraphicsRectItem(const QRectF &rect, QGraphicsItem *parent)-
4603 : QAbstractGraphicsShapeItem(*new QGraphicsRectItemPrivate, parent)-
4604{-
4605 setRect(rect);-
4606}
never executed: end of block
0
4607QGraphicsRectItem::QGraphicsRectItem(qreal x, qreal y, qreal w, qreal h,-
4608 QGraphicsItem *parent)-
4609 : QAbstractGraphicsShapeItem(*new QGraphicsRectItemPrivate, parent)-
4610{-
4611 setRect(QRectF(x, y, w, h));-
4612}
never executed: end of block
0
4613-
4614-
4615-
4616-
4617-
4618-
4619-
4620QGraphicsRectItem::QGraphicsRectItem(QGraphicsItem *parent)-
4621 : QAbstractGraphicsShapeItem(*new QGraphicsRectItemPrivate, parent)-
4622{-
4623}
never executed: end of block
0
4624-
4625-
4626-
4627-
4628QGraphicsRectItem::~QGraphicsRectItem()-
4629{-
4630}-
4631-
4632-
4633-
4634-
4635-
4636-
4637QRectF QGraphicsRectItem::rect() const-
4638{-
4639 const QGraphicsRectItemPrivate * const d = d_func();-
4640 return
never executed: return d->rect;
d->rect;
never executed: return d->rect;
0
4641}-
4642void QGraphicsRectItem::setRect(const QRectF &rect)-
4643{-
4644 QGraphicsRectItemPrivate * const d = d_func();-
4645 if (d->rect == rect
d->rect == rectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
4646 return;
never executed: return;
0
4647 prepareGeometryChange();-
4648 d->rect = rect;-
4649 d->boundingRect = QRectF();-
4650 update();-
4651}
never executed: end of block
0
4652QRectF QGraphicsRectItem::boundingRect() const-
4653{-
4654 const QGraphicsRectItemPrivate * const d = d_func();-
4655 if (d->boundingRect.isNull()
d->boundingRect.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
4656 qreal halfpw = pen().style() == Qt::NoPen
pen().style() == Qt::NoPenDescription
TRUEnever evaluated
FALSEnever evaluated
? qreal(0) : pen().widthF() / 2;
0
4657 d->boundingRect = d->rect;-
4658 if (halfpw > 0.0
halfpw > 0.0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
4659 d->boundingRect.adjust(-halfpw, -halfpw, halfpw, halfpw);
never executed: d->boundingRect.adjust(-halfpw, -halfpw, halfpw, halfpw);
0
4660 }
never executed: end of block
0
4661 return
never executed: return d->boundingRect;
d->boundingRect;
never executed: return d->boundingRect;
0
4662}-
4663-
4664-
4665-
4666-
4667QPainterPath QGraphicsRectItem::shape() const-
4668{-
4669 const QGraphicsRectItemPrivate * const d = d_func();-
4670 QPainterPath path;-
4671 path.addRect(d->rect);-
4672 return
never executed: return qt_graphicsItem_shapeFromPath(path, d->pen);
qt_graphicsItem_shapeFromPath(path, d->pen);
never executed: return qt_graphicsItem_shapeFromPath(path, d->pen);
0
4673}-
4674-
4675-
4676-
4677-
4678bool QGraphicsRectItem::contains(const QPointF &point) const-
4679{-
4680 return
never executed: return QAbstractGraphicsShapeItem::contains(point);
QAbstractGraphicsShapeItem::contains(point);
never executed: return QAbstractGraphicsShapeItem::contains(point);
0
4681}-
4682-
4683-
4684-
4685-
4686void QGraphicsRectItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,-
4687 QWidget *widget)-
4688{-
4689 QGraphicsRectItemPrivate * const d = d_func();-
4690 (void)widget;;-
4691 painter->setPen(d->pen);-
4692 painter->setBrush(d->brush);-
4693 painter->drawRect(d->rect);-
4694-
4695 if (option->state & QStyle::State_Selected
option->state ...State_SelectedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
4696 qt_graphicsItem_highlightSelected(this, painter, option);
never executed: qt_graphicsItem_highlightSelected(this, painter, option);
0
4697}
never executed: end of block
0
4698-
4699-
4700-
4701-
4702bool QGraphicsRectItem::isObscuredBy(const QGraphicsItem *item) const-
4703{-
4704 return
never executed: return QAbstractGraphicsShapeItem::isObscuredBy(item);
QAbstractGraphicsShapeItem::isObscuredBy(item);
never executed: return QAbstractGraphicsShapeItem::isObscuredBy(item);
0
4705}-
4706-
4707-
4708-
4709-
4710QPainterPath QGraphicsRectItem::opaqueArea() const-
4711{-
4712 return
never executed: return QAbstractGraphicsShapeItem::opaqueArea();
QAbstractGraphicsShapeItem::opaqueArea();
never executed: return QAbstractGraphicsShapeItem::opaqueArea();
0
4713}-
4714-
4715-
4716-
4717-
4718int QGraphicsRectItem::type() const-
4719{-
4720 return
never executed: return Type;
Type;
never executed: return Type;
0
4721}-
4722-
4723-
4724-
4725-
4726bool QGraphicsRectItem::supportsExtension(Extension extension) const-
4727{-
4728 (void)extension;;-
4729 return
never executed: return false;
false;
never executed: return false;
0
4730}-
4731-
4732-
4733-
4734-
4735void QGraphicsRectItem::setExtension(Extension extension, const QVariant &variant)-
4736{-
4737 (void)extension;;-
4738 (void)variant;;-
4739}
never executed: end of block
0
4740-
4741-
4742-
4743-
4744QVariant QGraphicsRectItem::extension(const QVariant &variant) const-
4745{-
4746 (void)variant;;-
4747 return
never executed: return QVariant();
QVariant();
never executed: return QVariant();
0
4748}-
4749class QGraphicsEllipseItemPrivate : public QAbstractGraphicsShapeItemPrivate-
4750{-
4751 inline QGraphicsEllipseItem* q_func() { return static_cast<QGraphicsEllipseItem *>(q_ptr); } inline const QGraphicsEllipseItem* q_func() const { return static_cast<const QGraphicsEllipseItem *>(q_ptr); } friend class QGraphicsEllipseItem;-
4752public:-
4753 inline QGraphicsEllipseItemPrivate()-
4754 : startAngle(0), spanAngle(360 * 16)-
4755 { }
never executed: end of block
0
4756-
4757 QRectF rect;-
4758 int startAngle;-
4759 int spanAngle;-
4760};-
4761-
4762-
4763-
4764-
4765-
4766-
4767-
4768QGraphicsEllipseItem::QGraphicsEllipseItem(const QRectF &rect, QGraphicsItem *parent)-
4769 : QAbstractGraphicsShapeItem(*new QGraphicsEllipseItemPrivate, parent)-
4770{-
4771 setRect(rect);-
4772}
never executed: end of block
0
4773QGraphicsEllipseItem::QGraphicsEllipseItem(qreal x, qreal y, qreal w, qreal h,-
4774 QGraphicsItem *parent)-
4775 : QAbstractGraphicsShapeItem(*new QGraphicsEllipseItemPrivate, parent)-
4776{-
4777 setRect(x,y,w,h);-
4778}
never executed: end of block
0
4779QGraphicsEllipseItem::QGraphicsEllipseItem(QGraphicsItem *parent)-
4780 : QAbstractGraphicsShapeItem(*new QGraphicsEllipseItemPrivate, parent)-
4781{-
4782}
never executed: end of block
0
4783-
4784-
4785-
4786-
4787QGraphicsEllipseItem::~QGraphicsEllipseItem()-
4788{-
4789}-
4790-
4791-
4792-
4793-
4794-
4795-
4796QRectF QGraphicsEllipseItem::rect() const-
4797{-
4798 const QGraphicsEllipseItemPrivate * const d = d_func();-
4799 return
never executed: return d->rect;
d->rect;
never executed: return d->rect;
0
4800}-
4801void QGraphicsEllipseItem::setRect(const QRectF &rect)-
4802{-
4803 QGraphicsEllipseItemPrivate * const d = d_func();-
4804 if (d->rect == rect
d->rect == rectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
4805 return;
never executed: return;
0
4806 prepareGeometryChange();-
4807 d->rect = rect;-
4808 d->boundingRect = QRectF();-
4809 update();-
4810}
never executed: end of block
0
4811int QGraphicsEllipseItem::startAngle() const-
4812{-
4813 const QGraphicsEllipseItemPrivate * const d = d_func();-
4814 return
never executed: return d->startAngle;
d->startAngle;
never executed: return d->startAngle;
0
4815}-
4816void QGraphicsEllipseItem::setStartAngle(int angle)-
4817{-
4818 QGraphicsEllipseItemPrivate * const d = d_func();-
4819 if (angle != d->startAngle
angle != d->startAngleDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
4820 prepareGeometryChange();-
4821 d->boundingRect = QRectF();-
4822 d->startAngle = angle;-
4823 update();-
4824 }
never executed: end of block
0
4825}
never executed: end of block
0
4826int QGraphicsEllipseItem::spanAngle() const-
4827{-
4828 const QGraphicsEllipseItemPrivate * const d = d_func();-
4829 return
never executed: return d->spanAngle;
d->spanAngle;
never executed: return d->spanAngle;
0
4830}-
4831void QGraphicsEllipseItem::setSpanAngle(int angle)-
4832{-
4833 QGraphicsEllipseItemPrivate * const d = d_func();-
4834 if (angle != d->spanAngle
angle != d->spanAngleDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
4835 prepareGeometryChange();-
4836 d->boundingRect = QRectF();-
4837 d->spanAngle = angle;-
4838 update();-
4839 }
never executed: end of block
0
4840}
never executed: end of block
0
4841-
4842-
4843-
4844-
4845QRectF QGraphicsEllipseItem::boundingRect() const-
4846{-
4847 const QGraphicsEllipseItemPrivate * const d = d_func();-
4848 if (d->boundingRect.isNull()
d->boundingRect.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
4849 qreal pw = pen().style() == Qt::NoPen
pen().style() == Qt::NoPenDescription
TRUEnever evaluated
FALSEnever evaluated
? qreal(0) : pen().widthF();
0
4850 if (pw == 0.0
pw == 0.0Description
TRUEnever evaluated
FALSEnever evaluated
&& d->spanAngle == 360 * 16
d->spanAngle == 360 * 16Description
TRUEnever evaluated
FALSEnever evaluated
)
0
4851 d->boundingRect = d->rect;
never executed: d->boundingRect = d->rect;
0
4852 else-
4853 d->boundingRect = shape().controlPointRect();
never executed: d->boundingRect = shape().controlPointRect();
0
4854 }-
4855 return
never executed: return d->boundingRect;
d->boundingRect;
never executed: return d->boundingRect;
0
4856}-
4857-
4858-
4859-
4860-
4861QPainterPath QGraphicsEllipseItem::shape() const-
4862{-
4863 const QGraphicsEllipseItemPrivate * const d = d_func();-
4864 QPainterPath path;-
4865 if (d->rect.isNull()
d->rect.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
4866 return
never executed: return path;
path;
never executed: return path;
0
4867 if (d->spanAngle != 360 * 16
d->spanAngle != 360 * 16Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
4868 path.moveTo(d->rect.center());-
4869 path.arcTo(d->rect, d->startAngle / 16.0, d->spanAngle / 16.0);-
4870 }
never executed: end of block
else {
0
4871 path.addEllipse(d->rect);-
4872 }
never executed: end of block
0
4873-
4874 return
never executed: return qt_graphicsItem_shapeFromPath(path, d->pen);
qt_graphicsItem_shapeFromPath(path, d->pen);
never executed: return qt_graphicsItem_shapeFromPath(path, d->pen);
0
4875}-
4876-
4877-
4878-
4879-
4880bool QGraphicsEllipseItem::contains(const QPointF &point) const-
4881{-
4882 return
never executed: return QAbstractGraphicsShapeItem::contains(point);
QAbstractGraphicsShapeItem::contains(point);
never executed: return QAbstractGraphicsShapeItem::contains(point);
0
4883}-
4884-
4885-
4886-
4887-
4888void QGraphicsEllipseItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,-
4889 QWidget *widget)-
4890{-
4891 QGraphicsEllipseItemPrivate * const d = d_func();-
4892 (void)widget;;-
4893 painter->setPen(d->pen);-
4894 painter->setBrush(d->brush);-
4895 if ((
(d->spanAngle != 0)Description
TRUEnever evaluated
FALSEnever evaluated
d->spanAngle != 0)
(d->spanAngle != 0)Description
TRUEnever evaluated
FALSEnever evaluated
&& (
(qAbs(d->spanA...60 * 16) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
qAbs(d->spanAngle) % (360 * 16) == 0)
(qAbs(d->spanA...60 * 16) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
4896 painter->drawEllipse(d->rect);
never executed: painter->drawEllipse(d->rect);
0
4897 else-
4898 painter->drawPie(d->rect, d->startAngle, d->spanAngle);
never executed: painter->drawPie(d->rect, d->startAngle, d->spanAngle);
0
4899-
4900 if (option->state & QStyle::State_Selected
option->state ...State_SelectedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
4901 qt_graphicsItem_highlightSelected(this, painter, option);
never executed: qt_graphicsItem_highlightSelected(this, painter, option);
0
4902}
never executed: end of block
0
4903-
4904-
4905-
4906-
4907bool QGraphicsEllipseItem::isObscuredBy(const QGraphicsItem *item) const-
4908{-
4909 return
never executed: return QAbstractGraphicsShapeItem::isObscuredBy(item);
QAbstractGraphicsShapeItem::isObscuredBy(item);
never executed: return QAbstractGraphicsShapeItem::isObscuredBy(item);
0
4910}-
4911-
4912-
4913-
4914-
4915QPainterPath QGraphicsEllipseItem::opaqueArea() const-
4916{-
4917 return
never executed: return QAbstractGraphicsShapeItem::opaqueArea();
QAbstractGraphicsShapeItem::opaqueArea();
never executed: return QAbstractGraphicsShapeItem::opaqueArea();
0
4918}-
4919-
4920-
4921-
4922-
4923int QGraphicsEllipseItem::type() const-
4924{-
4925 return
never executed: return Type;
Type;
never executed: return Type;
0
4926}-
4927-
4928-
4929-
4930-
4931-
4932bool QGraphicsEllipseItem::supportsExtension(Extension extension) const-
4933{-
4934 (void)extension;;-
4935 return
never executed: return false;
false;
never executed: return false;
0
4936}-
4937-
4938-
4939-
4940-
4941void QGraphicsEllipseItem::setExtension(Extension extension, const QVariant &variant)-
4942{-
4943 (void)extension;;-
4944 (void)variant;;-
4945}
never executed: end of block
0
4946-
4947-
4948-
4949-
4950QVariant QGraphicsEllipseItem::extension(const QVariant &variant) const-
4951{-
4952 (void)variant;;-
4953 return
never executed: return QVariant();
QVariant();
never executed: return QVariant();
0
4954}-
4955class QGraphicsPolygonItemPrivate : public QAbstractGraphicsShapeItemPrivate-
4956{-
4957 inline QGraphicsPolygonItem* q_func() { return static_cast<QGraphicsPolygonItem *>(q_ptr); } inline const QGraphicsPolygonItem* q_func() const { return static_cast<const QGraphicsPolygonItem *>(q_ptr); } friend class QGraphicsPolygonItem;-
4958public:-
4959 inline QGraphicsPolygonItemPrivate()-
4960 : fillRule(Qt::OddEvenFill)-
4961 { }
never executed: end of block
0
4962-
4963 QPolygonF polygon;-
4964 Qt::FillRule fillRule;-
4965};-
4966-
4967-
4968-
4969-
4970-
4971-
4972-
4973QGraphicsPolygonItem::QGraphicsPolygonItem(const QPolygonF &polygon, QGraphicsItem *parent)-
4974 : QAbstractGraphicsShapeItem(*new QGraphicsPolygonItemPrivate, parent)-
4975{-
4976 setPolygon(polygon);-
4977}
never executed: end of block
0
4978-
4979-
4980-
4981-
4982-
4983-
4984-
4985QGraphicsPolygonItem::QGraphicsPolygonItem(QGraphicsItem *parent)-
4986 : QAbstractGraphicsShapeItem(*new QGraphicsPolygonItemPrivate, parent)-
4987{-
4988}
never executed: end of block
0
4989-
4990-
4991-
4992-
4993QGraphicsPolygonItem::~QGraphicsPolygonItem()-
4994{-
4995}-
4996-
4997-
4998-
4999-
5000-
5001-
5002-
5003QPolygonF QGraphicsPolygonItem::polygon() const-
5004{-
5005 const QGraphicsPolygonItemPrivate * const d = d_func();-
5006 return
never executed: return d->polygon;
d->polygon;
never executed: return d->polygon;
0
5007}-
5008-
5009-
5010-
5011-
5012-
5013-
5014void QGraphicsPolygonItem::setPolygon(const QPolygonF &polygon)-
5015{-
5016 QGraphicsPolygonItemPrivate * const d = d_func();-
5017 if (d->polygon == polygon
d->polygon == polygonDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
5018 return;
never executed: return;
0
5019 prepareGeometryChange();-
5020 d->polygon = polygon;-
5021 d->boundingRect = QRectF();-
5022 update();-
5023}
never executed: end of block
0
5024-
5025-
5026-
5027-
5028-
5029-
5030-
5031Qt::FillRule QGraphicsPolygonItem::fillRule() const-
5032{-
5033 const QGraphicsPolygonItemPrivate * const d = d_func();-
5034 return
never executed: return d->fillRule;
d->fillRule;
never executed: return d->fillRule;
0
5035}-
5036-
5037-
5038-
5039-
5040-
5041-
5042-
5043void QGraphicsPolygonItem::setFillRule(Qt::FillRule rule)-
5044{-
5045 QGraphicsPolygonItemPrivate * const d = d_func();-
5046 if (rule != d->fillRule
rule != d->fillRuleDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
5047 d->fillRule = rule;-
5048 update();-
5049 }
never executed: end of block
0
5050}
never executed: end of block
0
5051-
5052-
5053-
5054-
5055QRectF QGraphicsPolygonItem::boundingRect() const-
5056{-
5057 const QGraphicsPolygonItemPrivate * const d = d_func();-
5058 if (d->boundingRect.isNull()
d->boundingRect.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
5059 qreal pw = pen().style() == Qt::NoPen
pen().style() == Qt::NoPenDescription
TRUEnever evaluated
FALSEnever evaluated
? qreal(0) : pen().widthF();
0
5060 if (pw == 0.0
pw == 0.0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
5061 d->boundingRect = d->polygon.boundingRect();
never executed: d->boundingRect = d->polygon.boundingRect();
0
5062 else-
5063 d->boundingRect = shape().controlPointRect();
never executed: d->boundingRect = shape().controlPointRect();
0
5064 }-
5065 return
never executed: return d->boundingRect;
d->boundingRect;
never executed: return d->boundingRect;
0
5066}-
5067-
5068-
5069-
5070-
5071QPainterPath QGraphicsPolygonItem::shape() const-
5072{-
5073 const QGraphicsPolygonItemPrivate * const d = d_func();-
5074 QPainterPath path;-
5075 path.addPolygon(d->polygon);-
5076 return
never executed: return qt_graphicsItem_shapeFromPath(path, d->pen);
qt_graphicsItem_shapeFromPath(path, d->pen);
never executed: return qt_graphicsItem_shapeFromPath(path, d->pen);
0
5077}-
5078-
5079-
5080-
5081-
5082bool QGraphicsPolygonItem::contains(const QPointF &point) const-
5083{-
5084 return
never executed: return QAbstractGraphicsShapeItem::contains(point);
QAbstractGraphicsShapeItem::contains(point);
never executed: return QAbstractGraphicsShapeItem::contains(point);
0
5085}-
5086-
5087-
5088-
5089-
5090void QGraphicsPolygonItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)-
5091{-
5092 QGraphicsPolygonItemPrivate * const d = d_func();-
5093 (void)widget;;-
5094 painter->setPen(d->pen);-
5095 painter->setBrush(d->brush);-
5096 painter->drawPolygon(d->polygon, d->fillRule);-
5097-
5098 if (option->state & QStyle::State_Selected
option->state ...State_SelectedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
5099 qt_graphicsItem_highlightSelected(this, painter, option);
never executed: qt_graphicsItem_highlightSelected(this, painter, option);
0
5100}
never executed: end of block
0
5101-
5102-
5103-
5104-
5105bool QGraphicsPolygonItem::isObscuredBy(const QGraphicsItem *item) const-
5106{-
5107 return
never executed: return QAbstractGraphicsShapeItem::isObscuredBy(item);
QAbstractGraphicsShapeItem::isObscuredBy(item);
never executed: return QAbstractGraphicsShapeItem::isObscuredBy(item);
0
5108}-
5109-
5110-
5111-
5112-
5113QPainterPath QGraphicsPolygonItem::opaqueArea() const-
5114{-
5115 return
never executed: return QAbstractGraphicsShapeItem::opaqueArea();
QAbstractGraphicsShapeItem::opaqueArea();
never executed: return QAbstractGraphicsShapeItem::opaqueArea();
0
5116}-
5117-
5118-
5119-
5120-
5121int QGraphicsPolygonItem::type() const-
5122{-
5123 return
never executed: return Type;
Type;
never executed: return Type;
0
5124}-
5125-
5126-
5127-
5128-
5129bool QGraphicsPolygonItem::supportsExtension(Extension extension) const-
5130{-
5131 (void)extension;;-
5132 return
never executed: return false;
false;
never executed: return false;
0
5133}-
5134-
5135-
5136-
5137-
5138void QGraphicsPolygonItem::setExtension(Extension extension, const QVariant &variant)-
5139{-
5140 (void)extension;;-
5141 (void)variant;;-
5142}
never executed: end of block
0
5143-
5144-
5145-
5146-
5147QVariant QGraphicsPolygonItem::extension(const QVariant &variant) const-
5148{-
5149 (void)variant;;-
5150 return
never executed: return QVariant();
QVariant();
never executed: return QVariant();
0
5151}-
5152class QGraphicsLineItemPrivate : public QGraphicsItemPrivate-
5153{-
5154 inline QGraphicsLineItem* q_func() { return static_cast<QGraphicsLineItem *>(q_ptr); } inline const QGraphicsLineItem* q_func() const { return static_cast<const QGraphicsLineItem *>(q_ptr); } friend class QGraphicsLineItem;-
5155public:-
5156 QLineF line;-
5157 QPen pen;-
5158};-
5159-
5160-
5161-
5162-
5163-
5164-
5165-
5166QGraphicsLineItem::QGraphicsLineItem(const QLineF &line, QGraphicsItem *parent)-
5167 : QGraphicsItem(*new QGraphicsLineItemPrivate, parent)-
5168{-
5169 setLine(line);-
5170}
never executed: end of block
0
5171QGraphicsLineItem::QGraphicsLineItem(qreal x1, qreal y1, qreal x2, qreal y2, QGraphicsItem *parent)-
5172 : QGraphicsItem(*new QGraphicsLineItemPrivate, parent)-
5173{-
5174 setLine(x1, y1, x2, y2);-
5175}
never executed: end of block
0
5176QGraphicsLineItem::QGraphicsLineItem(QGraphicsItem *parent)-
5177 : QGraphicsItem(*new QGraphicsLineItemPrivate, parent)-
5178{-
5179}
never executed: end of block
0
5180-
5181-
5182-
5183-
5184QGraphicsLineItem::~QGraphicsLineItem()-
5185{-
5186}-
5187-
5188-
5189-
5190-
5191-
5192-
5193-
5194QPen QGraphicsLineItem::pen() const-
5195{-
5196 const QGraphicsLineItemPrivate * const d = d_func();-
5197 return
never executed: return d->pen;
d->pen;
never executed: return d->pen;
0
5198}-
5199-
5200-
5201-
5202-
5203-
5204-
5205-
5206void QGraphicsLineItem::setPen(const QPen &pen)-
5207{-
5208 QGraphicsLineItemPrivate * const d = d_func();-
5209 if (d->pen == pen
d->pen == penDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
5210 return;
never executed: return;
0
5211 prepareGeometryChange();-
5212 d->pen = pen;-
5213 update();-
5214}
never executed: end of block
0
5215-
5216-
5217-
5218-
5219-
5220-
5221QLineF QGraphicsLineItem::line() const-
5222{-
5223 const QGraphicsLineItemPrivate * const d = d_func();-
5224 return
never executed: return d->line;
d->line;
never executed: return d->line;
0
5225}-
5226-
5227-
5228-
5229-
5230-
5231-
5232void QGraphicsLineItem::setLine(const QLineF &line)-
5233{-
5234 QGraphicsLineItemPrivate * const d = d_func();-
5235 if (d->line == line
d->line == lineDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
5236 return;
never executed: return;
0
5237 prepareGeometryChange();-
5238 d->line = line;-
5239 update();-
5240}
never executed: end of block
0
5241QRectF QGraphicsLineItem::boundingRect() const-
5242{-
5243 const QGraphicsLineItemPrivate * const d = d_func();-
5244 if (d->pen.widthF() == 0.0
d->pen.widthF() == 0.0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
5245 const qreal x1 = d->line.p1().x();-
5246 const qreal x2 = d->line.p2().x();-
5247 const qreal y1 = d->line.p1().y();-
5248 const qreal y2 = d->line.p2().y();-
5249 qreal lx = qMin(x1, x2);-
5250 qreal rx = qMax(x1, x2);-
5251 qreal ty = qMin(y1, y2);-
5252 qreal by = qMax(y1, y2);-
5253 return
never executed: return QRectF(lx, ty, rx - lx, by - ty);
QRectF(lx, ty, rx - lx, by - ty);
never executed: return QRectF(lx, ty, rx - lx, by - ty);
0
5254 }-
5255 return
never executed: return shape().controlPointRect();
shape().controlPointRect();
never executed: return shape().controlPointRect();
0
5256}-
5257-
5258-
5259-
5260-
5261QPainterPath QGraphicsLineItem::shape() const-
5262{-
5263 const QGraphicsLineItemPrivate * const d = d_func();-
5264 QPainterPath path;-
5265 if (d->line == QLineF()
d->line == QLineF()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
5266 return
never executed: return path;
path;
never executed: return path;
0
5267-
5268 path.moveTo(d->line.p1());-
5269 path.lineTo(d->line.p2());-
5270 return
never executed: return qt_graphicsItem_shapeFromPath(path, d->pen);
qt_graphicsItem_shapeFromPath(path, d->pen);
never executed: return qt_graphicsItem_shapeFromPath(path, d->pen);
0
5271}-
5272-
5273-
5274-
5275-
5276bool QGraphicsLineItem::contains(const QPointF &point) const-
5277{-
5278 return
never executed: return QGraphicsItem::contains(point);
QGraphicsItem::contains(point);
never executed: return QGraphicsItem::contains(point);
0
5279}-
5280-
5281-
5282-
5283-
5284void QGraphicsLineItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)-
5285{-
5286 QGraphicsLineItemPrivate * const d = d_func();-
5287 (void)widget;;-
5288 painter->setPen(d->pen);-
5289 painter->drawLine(d->line);-
5290-
5291 if (option->state & QStyle::State_Selected
option->state ...State_SelectedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
5292 qt_graphicsItem_highlightSelected(this, painter, option);
never executed: qt_graphicsItem_highlightSelected(this, painter, option);
0
5293}
never executed: end of block
0
5294-
5295-
5296-
5297-
5298bool QGraphicsLineItem::isObscuredBy(const QGraphicsItem *item) const-
5299{-
5300 return
never executed: return QGraphicsItem::isObscuredBy(item);
QGraphicsItem::isObscuredBy(item);
never executed: return QGraphicsItem::isObscuredBy(item);
0
5301}-
5302-
5303-
5304-
5305-
5306QPainterPath QGraphicsLineItem::opaqueArea() const-
5307{-
5308 return
never executed: return QGraphicsItem::opaqueArea();
QGraphicsItem::opaqueArea();
never executed: return QGraphicsItem::opaqueArea();
0
5309}-
5310-
5311-
5312-
5313-
5314int QGraphicsLineItem::type() const-
5315{-
5316 return
never executed: return Type;
Type;
never executed: return Type;
0
5317}-
5318-
5319-
5320-
5321-
5322bool QGraphicsLineItem::supportsExtension(Extension extension) const-
5323{-
5324 (void)extension;;-
5325 return
never executed: return false;
false;
never executed: return false;
0
5326}-
5327-
5328-
5329-
5330-
5331void QGraphicsLineItem::setExtension(Extension extension, const QVariant &variant)-
5332{-
5333 (void)extension;;-
5334 (void)variant;;-
5335}
never executed: end of block
0
5336-
5337-
5338-
5339-
5340QVariant QGraphicsLineItem::extension(const QVariant &variant) const-
5341{-
5342 (void)variant;;-
5343 return
never executed: return QVariant();
QVariant();
never executed: return QVariant();
0
5344}-
5345extern QPainterPath qt_regionToPath(const QRegion &region);-
5346-
5347class QGraphicsPixmapItemPrivate : public QGraphicsItemPrivate-
5348{-
5349 inline QGraphicsPixmapItem* q_func() { return static_cast<QGraphicsPixmapItem *>(q_ptr); } inline const QGraphicsPixmapItem* q_func() const { return static_cast<const QGraphicsPixmapItem *>(q_ptr); } friend class QGraphicsPixmapItem;-
5350public:-
5351 QGraphicsPixmapItemPrivate()-
5352 : transformationMode(Qt::FastTransformation),-
5353 shapeMode(QGraphicsPixmapItem::MaskShape),-
5354 hasShape(false)-
5355 {}
never executed: end of block
0
5356-
5357 QPixmap pixmap;-
5358 Qt::TransformationMode transformationMode;-
5359 QPointF offset;-
5360 QGraphicsPixmapItem::ShapeMode shapeMode;-
5361 QPainterPath shape;-
5362 bool hasShape;-
5363-
5364 void updateShape()-
5365 {-
5366 shape = QPainterPath();-
5367 switch (shapeMode) {-
5368 case
never executed: case QGraphicsPixmapItem::MaskShape:
QGraphicsPixmapItem::MaskShape:
never executed: case QGraphicsPixmapItem::MaskShape:
{
0
5369 QBitmap mask = pixmap.mask();-
5370 if (!mask.isNull()
!mask.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
5371 shape = qt_regionToPath(QRegion(mask).translated(offset.toPoint()));-
5372 break;
never executed: break;
0
5373 }-
5374-
5375 }-
5376 case
never executed: case QGraphicsPixmapItem::BoundingRectShape:
QGraphicsPixmapItem::BoundingRectShape:
never executed: case QGraphicsPixmapItem::BoundingRectShape:
code before this statement never executed: case QGraphicsPixmapItem::BoundingRectShape:
0
5377 shape.addRect(QRectF(offset.x(), offset.y(), pixmap.width(), pixmap.height()));-
5378 break;
never executed: break;
0
5379 case
never executed: case QGraphicsPixmapItem::HeuristicMaskShape:
QGraphicsPixmapItem::HeuristicMaskShape:
never executed: case QGraphicsPixmapItem::HeuristicMaskShape:
0
5380-
5381 shape = qt_regionToPath(QRegion(pixmap.createHeuristicMask()).translated(offset.toPoint()));-
5382-
5383-
5384-
5385 break;
never executed: break;
0
5386 }-
5387 }
never executed: end of block
0
5388};-
5389-
5390-
5391-
5392-
5393-
5394-
5395-
5396QGraphicsPixmapItem::QGraphicsPixmapItem(const QPixmap &pixmap, QGraphicsItem *parent)-
5397 : QGraphicsItem(*new QGraphicsPixmapItemPrivate, parent)-
5398{-
5399 setPixmap(pixmap);-
5400}
never executed: end of block
0
5401-
5402-
5403-
5404-
5405-
5406-
5407-
5408QGraphicsPixmapItem::QGraphicsPixmapItem(QGraphicsItem *parent)-
5409 : QGraphicsItem(*new QGraphicsPixmapItemPrivate, parent)-
5410{-
5411}
never executed: end of block
0
5412-
5413-
5414-
5415-
5416QGraphicsPixmapItem::~QGraphicsPixmapItem()-
5417{-
5418}-
5419-
5420-
5421-
5422-
5423-
5424-
5425void QGraphicsPixmapItem::setPixmap(const QPixmap &pixmap)-
5426{-
5427 QGraphicsPixmapItemPrivate * const d = d_func();-
5428 prepareGeometryChange();-
5429 d->pixmap = pixmap;-
5430 d->hasShape = false;-
5431 update();-
5432}
never executed: end of block
0
5433-
5434-
5435-
5436-
5437-
5438-
5439-
5440QPixmap QGraphicsPixmapItem::pixmap() const-
5441{-
5442 const QGraphicsPixmapItemPrivate * const d = d_func();-
5443 return
never executed: return d->pixmap;
d->pixmap;
never executed: return d->pixmap;
0
5444}-
5445Qt::TransformationMode QGraphicsPixmapItem::transformationMode() const-
5446{-
5447 const QGraphicsPixmapItemPrivate * const d = d_func();-
5448 return
never executed: return d->transformationMode;
d->transformationMode;
never executed: return d->transformationMode;
0
5449}-
5450void QGraphicsPixmapItem::setTransformationMode(Qt::TransformationMode mode)-
5451{-
5452 QGraphicsPixmapItemPrivate * const d = d_func();-
5453 if (mode != d->transformationMode
mode != d->transformationModeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
5454 d->transformationMode = mode;-
5455 update();-
5456 }
never executed: end of block
0
5457}
never executed: end of block
0
5458-
5459-
5460-
5461-
5462-
5463-
5464-
5465QPointF QGraphicsPixmapItem::offset() const-
5466{-
5467 const QGraphicsPixmapItemPrivate * const d = d_func();-
5468 return
never executed: return d->offset;
d->offset;
never executed: return d->offset;
0
5469}-
5470-
5471-
5472-
5473-
5474-
5475-
5476-
5477void QGraphicsPixmapItem::setOffset(const QPointF &offset)-
5478{-
5479 QGraphicsPixmapItemPrivate * const d = d_func();-
5480 if (d->offset == offset
d->offset == offsetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
5481 return;
never executed: return;
0
5482 prepareGeometryChange();-
5483 d->offset = offset;-
5484 d->hasShape = false;-
5485 update();-
5486}
never executed: end of block
0
5487QRectF QGraphicsPixmapItem::boundingRect() const-
5488{-
5489 const QGraphicsPixmapItemPrivate * const d = d_func();-
5490 if (d->pixmap.isNull()
d->pixmap.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
5491 return
never executed: return QRectF();
QRectF();
never executed: return QRectF();
0
5492 if (d->flags & ItemIsSelectable
d->flags & ItemIsSelectableDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
5493 qreal pw = 1.0;-
5494 return
never executed: return QRectF(d->offset, d->pixmap.size() / d->pixmap.devicePixelRatio()).adjusted(-pw/2, -pw/2, pw/2, pw/2);
QRectF(d->offset, d->pixmap.size() / d->pixmap.devicePixelRatio()).adjusted(-pw/2, -pw/2, pw/2, pw/2);
never executed: return QRectF(d->offset, d->pixmap.size() / d->pixmap.devicePixelRatio()).adjusted(-pw/2, -pw/2, pw/2, pw/2);
0
5495 } else {-
5496 return
never executed: return QRectF(d->offset, d->pixmap.size() / d->pixmap.devicePixelRatio());
QRectF(d->offset, d->pixmap.size() / d->pixmap.devicePixelRatio());
never executed: return QRectF(d->offset, d->pixmap.size() / d->pixmap.devicePixelRatio());
0
5497 }-
5498}-
5499-
5500-
5501-
5502-
5503QPainterPath QGraphicsPixmapItem::shape() const-
5504{-
5505 const QGraphicsPixmapItemPrivate * const d = d_func();-
5506 if (!d->hasShape
!d->hasShapeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
5507 QGraphicsPixmapItemPrivate *thatD = const_cast<QGraphicsPixmapItemPrivate *>(d);-
5508 thatD->updateShape();-
5509 thatD->hasShape = true;-
5510 }
never executed: end of block
0
5511 return
never executed: return d_func()->shape;
d_func()->shape;
never executed: return d_func()->shape;
0
5512}-
5513-
5514-
5515-
5516-
5517bool QGraphicsPixmapItem::contains(const QPointF &point) const-
5518{-
5519 return
never executed: return QGraphicsItem::contains(point);
QGraphicsItem::contains(point);
never executed: return QGraphicsItem::contains(point);
0
5520}-
5521-
5522-
5523-
5524-
5525void QGraphicsPixmapItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,-
5526 QWidget *widget)-
5527{-
5528 QGraphicsPixmapItemPrivate * const d = d_func();-
5529 (void)widget;;-
5530-
5531 painter->setRenderHint(QPainter::SmoothPixmapTransform,-
5532 (d->transformationMode == Qt::SmoothTransformation));-
5533-
5534 painter->drawPixmap(d->offset, d->pixmap);-
5535-
5536 if (option->state & QStyle::State_Selected
option->state ...State_SelectedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
5537 qt_graphicsItem_highlightSelected(this, painter, option);
never executed: qt_graphicsItem_highlightSelected(this, painter, option);
0
5538}
never executed: end of block
0
5539-
5540-
5541-
5542-
5543bool QGraphicsPixmapItem::isObscuredBy(const QGraphicsItem *item) const-
5544{-
5545 return
never executed: return QGraphicsItem::isObscuredBy(item);
QGraphicsItem::isObscuredBy(item);
never executed: return QGraphicsItem::isObscuredBy(item);
0
5546}-
5547-
5548-
5549-
5550-
5551QPainterPath QGraphicsPixmapItem::opaqueArea() const-
5552{-
5553 return
never executed: return shape();
shape();
never executed: return shape();
0
5554}-
5555-
5556-
5557-
5558-
5559int QGraphicsPixmapItem::type() const-
5560{-
5561 return
never executed: return Type;
Type;
never executed: return Type;
0
5562}-
5563-
5564-
5565-
5566-
5567-
5568-
5569-
5570QGraphicsPixmapItem::ShapeMode QGraphicsPixmapItem::shapeMode() const-
5571{-
5572 return
never executed: return d_func()->shapeMode;
d_func()->shapeMode;
never executed: return d_func()->shapeMode;
0
5573}-
5574-
5575-
5576-
5577-
5578-
5579-
5580-
5581void QGraphicsPixmapItem::setShapeMode(ShapeMode mode)-
5582{-
5583 QGraphicsPixmapItemPrivate * const d = d_func();-
5584 if (d->shapeMode == mode
d->shapeMode == modeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
5585 return;
never executed: return;
0
5586 d->shapeMode = mode;-
5587 d->hasShape = false;-
5588}
never executed: end of block
0
5589-
5590-
5591-
5592-
5593bool QGraphicsPixmapItem::supportsExtension(Extension extension) const-
5594{-
5595 (void)extension;;-
5596 return
never executed: return false;
false;
never executed: return false;
0
5597}-
5598-
5599-
5600-
5601-
5602void QGraphicsPixmapItem::setExtension(Extension extension, const QVariant &variant)-
5603{-
5604 (void)extension;;-
5605 (void)variant;;-
5606}
never executed: end of block
0
5607-
5608-
5609-
5610-
5611QVariant QGraphicsPixmapItem::extension(const QVariant &variant) const-
5612{-
5613 (void)variant;;-
5614 return
never executed: return QVariant();
QVariant();
never executed: return QVariant();
0
5615}-
5616class QGraphicsTextItemPrivate-
5617{-
5618public:-
5619 QGraphicsTextItemPrivate()-
5620 : control(0), pageNumber(0), useDefaultImpl(false), tabChangesFocus(false), clickCausedFocus(0)-
5621 { }
never executed: end of block
0
5622-
5623 mutable QWidgetTextControl *control;-
5624 QWidgetTextControl *textControl() const;-
5625-
5626 inline QPointF controlOffset() const-
5627 { return
never executed: return QPointF(0., pageNumber * control->document()->pageSize().height());
QPointF(0., pageNumber * control->document()->pageSize().height());
never executed: return QPointF(0., pageNumber * control->document()->pageSize().height());
}
0
5628 inline void sendControlEvent(QEvent *e)-
5629 { if (control
controlDescription
TRUEnever evaluated
FALSEnever evaluated
) control->processEvent(e, controlOffset());
never executed: control->processEvent(e, controlOffset());
}
never executed: end of block
0
5630-
5631 void _q_updateBoundingRect(const QSizeF &);-
5632 void _q_update(QRectF);-
5633 void _q_ensureVisible(QRectF);-
5634 bool _q_mouseOnEdge(QGraphicsSceneMouseEvent *);-
5635-
5636 QRectF boundingRect;-
5637 int pageNumber;-
5638 bool useDefaultImpl;-
5639 bool tabChangesFocus;-
5640-
5641 uint clickCausedFocus : 1;-
5642-
5643 QGraphicsTextItem *qq;-
5644};-
5645QGraphicsTextItem::QGraphicsTextItem(const QString &text, QGraphicsItem *parent)-
5646 : QGraphicsObject(*new QGraphicsItemPrivate, parent),-
5647 dd(new QGraphicsTextItemPrivate)-
5648{-
5649 dd->qq = this;-
5650 if (!text.isEmpty()
!text.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
5651 setPlainText(text);
never executed: setPlainText(text);
0
5652 setAcceptDrops(true);-
5653 setAcceptHoverEvents(true);-
5654 setFlags(ItemUsesExtendedStyleOption);-
5655}
never executed: end of block
0
5656-
5657-
5658-
5659-
5660-
5661-
5662-
5663QGraphicsTextItem::QGraphicsTextItem(QGraphicsItem *parent)-
5664 : QGraphicsObject(*new QGraphicsItemPrivate, parent),-
5665 dd(new QGraphicsTextItemPrivate)-
5666{-
5667 dd->qq = this;-
5668 setAcceptDrops(true);-
5669 setAcceptHoverEvents(true);-
5670 setFlag(ItemUsesExtendedStyleOption);-
5671}
never executed: end of block
0
5672-
5673-
5674-
5675-
5676QGraphicsTextItem::~QGraphicsTextItem()-
5677{-
5678 delete dd;-
5679}
never executed: end of block
0
5680-
5681-
5682-
5683-
5684-
5685-
5686QString QGraphicsTextItem::toHtml() const-
5687{-
5688-
5689 if (dd->control
dd->controlDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
5690 return
never executed: return dd->control->toHtml();
dd->control->toHtml();
never executed: return dd->control->toHtml();
0
5691-
5692 return
never executed: return QString();
QString();
never executed: return QString();
0
5693}-
5694void QGraphicsTextItem::setHtml(const QString &text)-
5695{-
5696 dd->textControl()->setHtml(text);-
5697}
never executed: end of block
0
5698-
5699-
5700-
5701-
5702-
5703-
5704QString QGraphicsTextItem::toPlainText() const-
5705{-
5706 if (dd->control
dd->controlDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
5707 return
never executed: return dd->control->toPlainText();
dd->control->toPlainText();
never executed: return dd->control->toPlainText();
0
5708 return
never executed: return QString();
QString();
never executed: return QString();
0
5709}-
5710void QGraphicsTextItem::setPlainText(const QString &text)-
5711{-
5712 dd->textControl()->setPlainText(text);-
5713}
never executed: end of block
0
5714-
5715-
5716-
5717-
5718-
5719-
5720QFont QGraphicsTextItem::font() const-
5721{-
5722 if (!dd->control
!dd->controlDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
5723 return
never executed: return QFont();
QFont();
never executed: return QFont();
0
5724 return
never executed: return dd->control->document()->defaultFont();
dd->control->document()->defaultFont();
never executed: return dd->control->document()->defaultFont();
0
5725}-
5726-
5727-
5728-
5729-
5730-
5731-
5732void QGraphicsTextItem::setFont(const QFont &font)-
5733{-
5734 dd->textControl()->document()->setDefaultFont(font);-
5735}
never executed: end of block
0
5736-
5737-
5738-
5739-
5740void QGraphicsTextItem::setDefaultTextColor(const QColor &col)-
5741{-
5742 QWidgetTextControl *c = dd->textControl();-
5743 QPalette pal = c->palette();-
5744 QColor old = pal.color(QPalette::Text);-
5745 pal.setColor(QPalette::Text, col);-
5746 c->setPalette(pal);-
5747 if (old != col
old != colDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
5748 update();
never executed: update();
0
5749}
never executed: end of block
0
5750-
5751-
5752-
5753-
5754QColor QGraphicsTextItem::defaultTextColor() const-
5755{-
5756 return
never executed: return dd->textControl()->palette().color(QPalette::Text);
dd->textControl()->palette().color(QPalette::Text);
never executed: return dd->textControl()->palette().color(QPalette::Text);
0
5757}-
5758-
5759-
5760-
5761-
5762QRectF QGraphicsTextItem::boundingRect() const-
5763{-
5764 return
never executed: return dd->boundingRect;
dd->boundingRect;
never executed: return dd->boundingRect;
0
5765}-
5766-
5767-
5768-
5769-
5770QPainterPath QGraphicsTextItem::shape() const-
5771{-
5772 if (!dd->control
!dd->controlDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
5773 return
never executed: return QPainterPath();
QPainterPath();
never executed: return QPainterPath();
0
5774 QPainterPath path;-
5775 path.addRect(dd->boundingRect);-
5776 return
never executed: return path;
path;
never executed: return path;
0
5777}-
5778-
5779-
5780-
5781-
5782bool QGraphicsTextItem::contains(const QPointF &point) const-
5783{-
5784 return
never executed: return dd->boundingRect.contains(point);
dd->boundingRect.contains(point);
never executed: return dd->boundingRect.contains(point);
0
5785}-
5786-
5787-
5788-
5789-
5790void QGraphicsTextItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,-
5791 QWidget *widget)-
5792{-
5793 (void)widget;;-
5794 if (dd->control
dd->controlDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
5795 painter->save();-
5796 QRectF r = option->exposedRect;-
5797 painter->translate(-dd->controlOffset());-
5798 r.translate(dd->controlOffset());-
5799-
5800 QTextDocument *doc = dd->control->document();-
5801 QTextDocumentLayout *layout = qobject_cast<QTextDocumentLayout *>(doc->documentLayout());-
5802-
5803-
5804-
5805 if (layout
layoutDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
5806 layout->setViewport(dd->boundingRect);
never executed: layout->setViewport(dd->boundingRect);
0
5807-
5808 dd->control->drawContents(painter, r);-
5809-
5810 if (layout
layoutDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
5811 layout->setViewport(QRect());
never executed: layout->setViewport(QRect());
0
5812-
5813 painter->restore();-
5814 }
never executed: end of block
0
5815-
5816 if (option->state & (QStyle::State_Selected | QStyle::State_HasFocus)
option->state ...tate_HasFocus)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
5817 qt_graphicsItem_highlightSelected(this, painter, option);
never executed: qt_graphicsItem_highlightSelected(this, painter, option);
0
5818}
never executed: end of block
0
5819-
5820-
5821-
5822-
5823bool QGraphicsTextItem::isObscuredBy(const QGraphicsItem *item) const-
5824{-
5825 return
never executed: return QGraphicsItem::isObscuredBy(item);
QGraphicsItem::isObscuredBy(item);
never executed: return QGraphicsItem::isObscuredBy(item);
0
5826}-
5827-
5828-
5829-
5830-
5831QPainterPath QGraphicsTextItem::opaqueArea() const-
5832{-
5833 return
never executed: return QGraphicsItem::opaqueArea();
QGraphicsItem::opaqueArea();
never executed: return QGraphicsItem::opaqueArea();
0
5834}-
5835-
5836-
5837-
5838-
5839int QGraphicsTextItem::type() const-
5840{-
5841 return
never executed: return Type;
Type;
never executed: return Type;
0
5842}-
5843void QGraphicsTextItem::setTextWidth(qreal width)-
5844{-
5845 dd->textControl()->setTextWidth(width);-
5846}
never executed: end of block
0
5847qreal QGraphicsTextItem::textWidth() const-
5848{-
5849 if (!dd->control
!dd->controlDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
5850 return
never executed: return -1;
-1;
never executed: return -1;
0
5851 return
never executed: return dd->control->textWidth();
dd->control->textWidth();
never executed: return dd->control->textWidth();
0
5852}-
5853-
5854-
5855-
5856-
5857void QGraphicsTextItem::adjustSize()-
5858{-
5859 if (dd->control
dd->controlDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
5860 dd->control->adjustSize();
never executed: dd->control->adjustSize();
0
5861}
never executed: end of block
0
5862-
5863-
5864-
5865-
5866void QGraphicsTextItem::setDocument(QTextDocument *document)-
5867{-
5868 dd->textControl()->setDocument(document);-
5869 dd->_q_updateBoundingRect(dd->control->size());-
5870}
never executed: end of block
0
5871-
5872-
5873-
5874-
5875QTextDocument *QGraphicsTextItem::document() const-
5876{-
5877 return
never executed: return dd->textControl()->document();
dd->textControl()->document();
never executed: return dd->textControl()->document();
0
5878}-
5879-
5880-
5881-
5882-
5883bool QGraphicsTextItem::sceneEvent(QEvent *event)-
5884{-
5885 QEvent::Type t = event->type();-
5886 if (!dd->tabChangesFocus
!dd->tabChangesFocusDescription
TRUEnever evaluated
FALSEnever evaluated
&& (t == QEvent::KeyPress
t == QEvent::KeyPressDescription
TRUEnever evaluated
FALSEnever evaluated
|| t == QEvent::KeyRelease
t == QEvent::KeyReleaseDescription
TRUEnever evaluated
FALSEnever evaluated
)) {
0
5887 int k = ((QKeyEvent *)event)->key();-
5888 if (k == Qt::Key_Tab
k == Qt::Key_TabDescription
TRUEnever evaluated
FALSEnever evaluated
|| k == Qt::Key_Backtab
k == Qt::Key_BacktabDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
5889 dd->sendControlEvent(event);-
5890 return
never executed: return true;
true;
never executed: return true;
0
5891 }-
5892 }
never executed: end of block
0
5893 bool result = QGraphicsItem::sceneEvent(event);-
5894-
5895-
5896 switch (event->type()) {-
5897 case
never executed: case QEvent::ContextMenu:
QEvent::ContextMenu:
never executed: case QEvent::ContextMenu:
0
5898 case
never executed: case QEvent::FocusIn:
QEvent::FocusIn:
never executed: case QEvent::FocusIn:
0
5899 case
never executed: case QEvent::FocusOut:
QEvent::FocusOut:
never executed: case QEvent::FocusOut:
0
5900 case
never executed: case QEvent::GraphicsSceneDragEnter:
QEvent::GraphicsSceneDragEnter:
never executed: case QEvent::GraphicsSceneDragEnter:
0
5901 case
never executed: case QEvent::GraphicsSceneDragLeave:
QEvent::GraphicsSceneDragLeave:
never executed: case QEvent::GraphicsSceneDragLeave:
0
5902 case
never executed: case QEvent::GraphicsSceneDragMove:
QEvent::GraphicsSceneDragMove:
never executed: case QEvent::GraphicsSceneDragMove:
0
5903 case
never executed: case QEvent::GraphicsSceneDrop:
QEvent::GraphicsSceneDrop:
never executed: case QEvent::GraphicsSceneDrop:
0
5904 case
never executed: case QEvent::GraphicsSceneHoverEnter:
QEvent::GraphicsSceneHoverEnter:
never executed: case QEvent::GraphicsSceneHoverEnter:
0
5905 case
never executed: case QEvent::GraphicsSceneHoverLeave:
QEvent::GraphicsSceneHoverLeave:
never executed: case QEvent::GraphicsSceneHoverLeave:
0
5906 case
never executed: case QEvent::GraphicsSceneHoverMove:
QEvent::GraphicsSceneHoverMove:
never executed: case QEvent::GraphicsSceneHoverMove:
0
5907 case
never executed: case QEvent::GraphicsSceneMouseDoubleClick:
QEvent::GraphicsSceneMouseDoubleClick:
never executed: case QEvent::GraphicsSceneMouseDoubleClick:
0
5908 case
never executed: case QEvent::GraphicsSceneMousePress:
QEvent::GraphicsSceneMousePress:
never executed: case QEvent::GraphicsSceneMousePress:
0
5909 case
never executed: case QEvent::GraphicsSceneMouseMove:
QEvent::GraphicsSceneMouseMove:
never executed: case QEvent::GraphicsSceneMouseMove:
0
5910 case
never executed: case QEvent::GraphicsSceneMouseRelease:
QEvent::GraphicsSceneMouseRelease:
never executed: case QEvent::GraphicsSceneMouseRelease:
0
5911 case
never executed: case QEvent::KeyPress:
QEvent::KeyPress:
never executed: case QEvent::KeyPress:
0
5912 case
never executed: case QEvent::KeyRelease:
QEvent::KeyRelease:
never executed: case QEvent::KeyRelease:
0
5913-
5914-
5915 if (event->type() == QEvent::FocusIn
event->type() ...Event::FocusInDescription
TRUEnever evaluated
FALSEnever evaluated
|| event->type() == QEvent::FocusOut
event->type() ...vent::FocusOutDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
5916 QGuiApplication::inputMethod()->reset();-
5917 }
never executed: end of block
else {
0
5918 QGuiApplication::inputMethod()->update(Qt::ImQueryInput);-
5919 }
never executed: end of block
0
5920 break;
never executed: break;
0
5921 case
never executed: case QEvent::ShortcutOverride:
QEvent::ShortcutOverride:
never executed: case QEvent::ShortcutOverride:
0
5922 dd->sendControlEvent(event);-
5923 return
never executed: return true;
true;
never executed: return true;
0
5924 default
never executed: default:
:
never executed: default:
0
5925 break;
never executed: break;
0
5926 }-
5927-
5928 return
never executed: return result;
result;
never executed: return result;
0
5929}-
5930-
5931-
5932-
5933-
5934void QGraphicsTextItem::mousePressEvent(QGraphicsSceneMouseEvent *event)-
5935{-
5936 if ((
(QGraphicsItem...temIsMovable))Description
TRUEnever evaluated
FALSEnever evaluated
QGraphicsItem::d_ptr->flags & (ItemIsSelectable | ItemIsMovable))
(QGraphicsItem...temIsMovable))Description
TRUEnever evaluated
FALSEnever evaluated
0
5937 && (
(event->button...t::LeftButton)Description
TRUEnever evaluated
FALSEnever evaluated
event->buttons() & Qt::LeftButton)
(event->button...t::LeftButton)Description
TRUEnever evaluated
FALSEnever evaluated
&& dd->_q_mouseOnEdge(event)
dd->_q_mouseOnEdge(event)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
5938-
5939-
5940 dd->useDefaultImpl = true;-
5941 }
never executed: end of block
else if (event->buttons() == event->button()
event->buttons...vent->button()Description
TRUEnever evaluated
FALSEnever evaluated
0
5942 && dd->control->textInteractionFlags() == Qt::NoTextInteraction
dd->control->t...extInteractionDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
5943-
5944 dd->useDefaultImpl = true;-
5945 }
never executed: end of block
0
5946 if (dd->useDefaultImpl
dd->useDefaultImplDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
5947 QGraphicsItem::mousePressEvent(event);-
5948 if (!event->isAccepted()
!event->isAccepted()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
5949 dd->useDefaultImpl = false;
never executed: dd->useDefaultImpl = false;
0
5950 return;
never executed: return;
0
5951 }-
5952-
5953 dd->sendControlEvent(event);-
5954}
never executed: end of block
0
5955-
5956-
5957-
5958-
5959void QGraphicsTextItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)-
5960{-
5961 if (dd->useDefaultImpl
dd->useDefaultImplDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
5962 QGraphicsItem::mouseMoveEvent(event);-
5963 return;
never executed: return;
0
5964 }-
5965-
5966 dd->sendControlEvent(event);-
5967}
never executed: end of block
0
5968-
5969-
5970-
5971-
5972void QGraphicsTextItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)-
5973{-
5974 if (dd->useDefaultImpl
dd->useDefaultImplDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
5975 QGraphicsItem::mouseReleaseEvent(event);-
5976 if (dd->control->textInteractionFlags() == Qt::NoTextInteraction
dd->control->t...extInteractionDescription
TRUEnever evaluated
FALSEnever evaluated
0
5977 && !event->buttons()
!event->buttons()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
5978-
5979 dd->useDefaultImpl = false;-
5980 }
never executed: end of block
else if ((
(event->button...ftButton) == 0Description
TRUEnever evaluated
FALSEnever evaluated
event->buttons() & Qt::LeftButton) == 0
(event->button...ftButton) == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
5981-
5982 dd->useDefaultImpl = false;-
5983 }
never executed: end of block
0
5984 return;
never executed: return;
0
5985 }-
5986-
5987 QWidget *widget = event->widget();-
5988 if (widget
widgetDescription
TRUEnever evaluated
FALSEnever evaluated
&& (
(dd->control->...:TextEditable)Description
TRUEnever evaluated
FALSEnever evaluated
dd->control->textInteractionFlags() & Qt::TextEditable)
(dd->control->...:TextEditable)Description
TRUEnever evaluated
FALSEnever evaluated
&& boundingRect().contains(event->pos())
boundingRect()...(event->pos())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
5989 qt_widget_private(widget)->handleSoftwareInputPanel(event->button(), dd->clickCausedFocus);-
5990 }
never executed: end of block
0
5991 dd->clickCausedFocus = 0;-
5992 dd->sendControlEvent(event);-
5993}
never executed: end of block
0
5994-
5995-
5996-
5997-
5998void QGraphicsTextItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)-
5999{-
6000 if (dd->useDefaultImpl
dd->useDefaultImplDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
6001 QGraphicsItem::mouseDoubleClickEvent(event);-
6002 return;
never executed: return;
0
6003 }-
6004-
6005 if (!hasFocus()
!hasFocus()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
6006 QGraphicsItem::mouseDoubleClickEvent(event);-
6007 return;
never executed: return;
0
6008 }-
6009-
6010 dd->sendControlEvent(event);-
6011}
never executed: end of block
0
6012-
6013-
6014-
6015-
6016void QGraphicsTextItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)-
6017{-
6018 dd->sendControlEvent(event);-
6019}
never executed: end of block
0
6020-
6021-
6022-
6023-
6024void QGraphicsTextItem::keyPressEvent(QKeyEvent *event)-
6025{-
6026 dd->sendControlEvent(event);-
6027}
never executed: end of block
0
6028-
6029-
6030-
6031-
6032void QGraphicsTextItem::keyReleaseEvent(QKeyEvent *event)-
6033{-
6034 dd->sendControlEvent(event);-
6035}
never executed: end of block
0
6036-
6037-
6038-
6039-
6040void QGraphicsTextItem::focusInEvent(QFocusEvent *event)-
6041{-
6042 dd->sendControlEvent(event);-
6043 if (event->reason() == Qt::MouseFocusReason
event->reason(...useFocusReasonDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
6044 dd->clickCausedFocus = 1;-
6045 }
never executed: end of block
0
6046 update();-
6047}
never executed: end of block
0
6048-
6049-
6050-
6051-
6052void QGraphicsTextItem::focusOutEvent(QFocusEvent *event)-
6053{-
6054 dd->sendControlEvent(event);-
6055 update();-
6056}
never executed: end of block
0
6057-
6058-
6059-
6060-
6061void QGraphicsTextItem::dragEnterEvent(QGraphicsSceneDragDropEvent *event)-
6062{-
6063 dd->sendControlEvent(event);-
6064}
never executed: end of block
0
6065-
6066-
6067-
6068-
6069void QGraphicsTextItem::dragLeaveEvent(QGraphicsSceneDragDropEvent *event)-
6070{-
6071 dd->sendControlEvent(event);-
6072}
never executed: end of block
0
6073-
6074-
6075-
6076-
6077void QGraphicsTextItem::dragMoveEvent(QGraphicsSceneDragDropEvent *event)-
6078{-
6079 dd->sendControlEvent(event);-
6080}
never executed: end of block
0
6081-
6082-
6083-
6084-
6085void QGraphicsTextItem::dropEvent(QGraphicsSceneDragDropEvent *event)-
6086{-
6087 dd->sendControlEvent(event);-
6088}
never executed: end of block
0
6089-
6090-
6091-
6092-
6093void QGraphicsTextItem::inputMethodEvent(QInputMethodEvent *event)-
6094{-
6095 dd->sendControlEvent(event);-
6096}
never executed: end of block
0
6097-
6098-
6099-
6100-
6101void QGraphicsTextItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)-
6102{-
6103 dd->sendControlEvent(event);-
6104}
never executed: end of block
0
6105-
6106-
6107-
6108-
6109void QGraphicsTextItem::hoverMoveEvent(QGraphicsSceneHoverEvent *event)-
6110{-
6111 dd->sendControlEvent(event);-
6112}
never executed: end of block
0
6113-
6114-
6115-
6116-
6117void QGraphicsTextItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)-
6118{-
6119 dd->sendControlEvent(event);-
6120}
never executed: end of block
0
6121-
6122-
6123-
6124-
6125QVariant QGraphicsTextItem::inputMethodQuery(Qt::InputMethodQuery query) const-
6126{-
6127 QVariant v;-
6128 if (query == Qt::ImHints
query == Qt::ImHintsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
6129 v = int(inputMethodHints());
never executed: v = int(inputMethodHints());
0
6130 else if (dd->control
dd->controlDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
6131 v = dd->control->inputMethodQuery(query, QVariant());
never executed: v = dd->control->inputMethodQuery(query, QVariant());
0
6132 if (v.type() == QVariant::RectF
v.type() == QVariant::RectFDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
6133 v = v.toRectF().translated(-dd->controlOffset());
never executed: v = v.toRectF().translated(-dd->controlOffset());
0
6134 else if (v.type() == QVariant::PointF
v.type() == QVariant::PointFDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
6135 v = v.toPointF() - dd->controlOffset();
never executed: v = v.toPointF() - dd->controlOffset();
0
6136 else if (v.type() == QVariant::Rect
v.type() == QVariant::RectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
6137 v = v.toRect().translated(-dd->controlOffset().toPoint());
never executed: v = v.toRect().translated(-dd->controlOffset().toPoint());
0
6138 else if (v.type() == QVariant::Point
v.type() == QVariant::PointDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
6139 v = v.toPoint() - dd->controlOffset().toPoint();
never executed: v = v.toPoint() - dd->controlOffset().toPoint();
0
6140 return
never executed: return v;
v;
never executed: return v;
0
6141}-
6142-
6143-
6144-
6145-
6146bool QGraphicsTextItem::supportsExtension(Extension extension) const-
6147{-
6148 (void)extension;;-
6149 return
never executed: return false;
false;
never executed: return false;
0
6150}-
6151-
6152-
6153-
6154-
6155void QGraphicsTextItem::setExtension(Extension extension, const QVariant &variant)-
6156{-
6157 (void)extension;;-
6158 (void)variant;;-
6159}
never executed: end of block
0
6160-
6161-
6162-
6163-
6164QVariant QGraphicsTextItem::extension(const QVariant &variant) const-
6165{-
6166 (void)variant;;-
6167 return
never executed: return QVariant();
QVariant();
never executed: return QVariant();
0
6168}-
6169-
6170-
6171-
6172-
6173void QGraphicsTextItemPrivate::_q_update(QRectF rect)-
6174{-
6175 if (rect.isValid()
rect.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
6176 rect.translate(-controlOffset());-
6177 }
never executed: end of block
else {
0
6178 rect = boundingRect;-
6179 }
never executed: end of block
0
6180 if (rect.intersects(boundingRect)
rect.intersects(boundingRect)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
6181 qq->update(rect);
never executed: qq->update(rect);
0
6182}
never executed: end of block
0
6183-
6184-
6185-
6186-
6187void QGraphicsTextItemPrivate::_q_updateBoundingRect(const QSizeF &size)-
6188{-
6189 if (!control
!controlDescription
TRUEnever evaluated
FALSEnever evaluated
) return;
never executed: return;
0
6190 const QSizeF pageSize = control->document()->pageSize();-
6191-
6192 if (size == boundingRect.size()
size == boundingRect.size()Description
TRUEnever evaluated
FALSEnever evaluated
|| pageSize.height() != -1
pageSize.height() != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
6193 return;
never executed: return;
0
6194 qq->prepareGeometryChange();-
6195 boundingRect.setSize(size);-
6196 qq->update();-
6197}
never executed: end of block
0
6198-
6199-
6200-
6201-
6202void QGraphicsTextItemPrivate::_q_ensureVisible(QRectF rect)-
6203{-
6204 if (qq->hasFocus()
qq->hasFocus()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
6205 rect.translate(-controlOffset());-
6206 qq->ensureVisible(rect, 0, 0);-
6207 }
never executed: end of block
0
6208}
never executed: end of block
0
6209-
6210QWidgetTextControl *QGraphicsTextItemPrivate::textControl() const-
6211{-
6212 if (!control
!controlDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
6213 QGraphicsTextItem *that = const_cast<QGraphicsTextItem *>(qq);-
6214 control = new QWidgetTextControl(that);-
6215 control->setTextInteractionFlags(Qt::NoTextInteraction);-
6216-
6217 QObject::connect(control, qFlagLocation("2""updateRequest(QRectF)" "\0" __FILE__ ":" "10538"),-
6218 qq, qFlagLocation("1""_q_update(QRectF)" "\0" __FILE__ ":" "10539"));-
6219 QObject::connect(control, qFlagLocation("2""documentSizeChanged(QSizeF)" "\0" __FILE__ ":" "10540"),-
6220 qq, qFlagLocation("1""_q_updateBoundingRect(QSizeF)" "\0" __FILE__ ":" "10541"));-
6221 QObject::connect(control, qFlagLocation("2""visibilityRequest(QRectF)" "\0" __FILE__ ":" "10542"),-
6222 qq, qFlagLocation("1""_q_ensureVisible(QRectF)" "\0" __FILE__ ":" "10543"));-
6223 QObject::connect(control, qFlagLocation("2""linkActivated(QString)" "\0" __FILE__ ":" "10544"),-
6224 qq, qFlagLocation("2""linkActivated(QString)" "\0" __FILE__ ":" "10545"));-
6225 QObject::connect(control, qFlagLocation("2""linkHovered(QString)" "\0" __FILE__ ":" "10546"),-
6226 qq, qFlagLocation("2""linkHovered(QString)" "\0" __FILE__ ":" "10547"));-
6227-
6228 const QSizeF pgSize = control->document()->pageSize();-
6229 if (pgSize.height() != -1
pgSize.height() != -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
6230 qq->prepareGeometryChange();-
6231 that->dd->boundingRect.setSize(pgSize);-
6232 qq->update();-
6233 }
never executed: end of block
else {
0
6234 that->dd->_q_updateBoundingRect(control->size());-
6235 }
never executed: end of block
0
6236 }-
6237 return
never executed: return control;
control;
never executed: return control;
0
6238}-
6239-
6240-
6241-
6242-
6243bool QGraphicsTextItemPrivate::_q_mouseOnEdge(QGraphicsSceneMouseEvent *event)-
6244{-
6245 QPainterPath path;-
6246 path.addRect(qq->boundingRect());-
6247-
6248 QPainterPath docPath;-
6249 const QTextFrameFormat format = control->document()->rootFrame()->frameFormat();-
6250 docPath.addRect(-
6251 qq->boundingRect().adjusted(-
6252 format.leftMargin(),-
6253 format.topMargin(),-
6254 -format.rightMargin(),-
6255 -format.bottomMargin()));-
6256-
6257 return
never executed: return path.subtracted(docPath).contains(event->pos());
path.subtracted(docPath).contains(event->pos());
never executed: return path.subtracted(docPath).contains(event->pos());
0
6258}-
6259void QGraphicsTextItem::setTextInteractionFlags(Qt::TextInteractionFlags flags)-
6260{-
6261 if (flags == Qt::NoTextInteraction
flags == Qt::NoTextInteractionDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
6262 setFlags(this->flags() & ~(QGraphicsItem::ItemIsFocusable | QGraphicsItem::ItemAcceptsInputMethod));
never executed: setFlags(this->flags() & ~(QGraphicsItem::ItemIsFocusable | QGraphicsItem::ItemAcceptsInputMethod));
0
6263 else-
6264 setFlags(this->flags() | QGraphicsItem::ItemIsFocusable | QGraphicsItem::ItemAcceptsInputMethod);
never executed: setFlags(this->flags() | QGraphicsItem::ItemIsFocusable | QGraphicsItem::ItemAcceptsInputMethod);
0
6265-
6266 dd->textControl()->setTextInteractionFlags(flags);-
6267}
never executed: end of block
0
6268-
6269-
6270-
6271-
6272-
6273-
6274Qt::TextInteractionFlags QGraphicsTextItem::textInteractionFlags() const-
6275{-
6276 if (!dd->control
!dd->controlDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
6277 return
never executed: return Qt::NoTextInteraction;
Qt::NoTextInteraction;
never executed: return Qt::NoTextInteraction;
0
6278 return
never executed: return dd->control->textInteractionFlags();
dd->control->textInteractionFlags();
never executed: return dd->control->textInteractionFlags();
0
6279}-
6280void QGraphicsTextItem::setTabChangesFocus(bool b)-
6281{-
6282 dd->tabChangesFocus = b;-
6283}
never executed: end of block
0
6284bool QGraphicsTextItem::tabChangesFocus() const-
6285{-
6286 return
never executed: return dd->tabChangesFocus;
dd->tabChangesFocus;
never executed: return dd->tabChangesFocus;
0
6287}-
6288void QGraphicsTextItem::setOpenExternalLinks(bool open)-
6289{-
6290 dd->textControl()->setOpenExternalLinks(open);-
6291}
never executed: end of block
0
6292-
6293bool QGraphicsTextItem::openExternalLinks() const-
6294{-
6295 if (!dd->control
!dd->controlDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
6296 return
never executed: return false;
false;
never executed: return false;
0
6297 return
never executed: return dd->control->openExternalLinks();
dd->control->openExternalLinks();
never executed: return dd->control->openExternalLinks();
0
6298}-
6299void QGraphicsTextItem::setTextCursor(const QTextCursor &cursor)-
6300{-
6301 dd->textControl()->setTextCursor(cursor);-
6302}
never executed: end of block
0
6303-
6304QTextCursor QGraphicsTextItem::textCursor() const-
6305{-
6306 if (!dd->control
!dd->controlDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
6307 return
never executed: return QTextCursor();
QTextCursor();
never executed: return QTextCursor();
0
6308 return
never executed: return dd->control->textCursor();
dd->control->textCursor();
never executed: return dd->control->textCursor();
0
6309}-
6310-
6311class QGraphicsSimpleTextItemPrivate : public QAbstractGraphicsShapeItemPrivate-
6312{-
6313 inline QGraphicsSimpleTextItem* q_func() { return static_cast<QGraphicsSimpleTextItem *>(q_ptr); } inline const QGraphicsSimpleTextItem* q_func() const { return static_cast<const QGraphicsSimpleTextItem *>(q_ptr); } friend class QGraphicsSimpleTextItem;-
6314public:-
6315 inline QGraphicsSimpleTextItemPrivate() {-
6316 pen.setStyle(Qt::NoPen);-
6317 brush.setStyle(Qt::SolidPattern);-
6318 }
never executed: end of block
0
6319 QString text;-
6320 QFont font;-
6321 QRectF boundingRect;-
6322-
6323 void updateBoundingRect();-
6324};-
6325-
6326static QRectF setupTextLayout(QTextLayout *layout)-
6327{-
6328 layout->setCacheEnabled(true);-
6329 layout->beginLayout();-
6330 while (layout->createLine().isValid()
layout->createLine().isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
6331 ;
never executed: ;
0
6332 layout->endLayout();-
6333 qreal maxWidth = 0;-
6334 qreal y = 0;-
6335 for (int i = 0; i < layout->lineCount()
i < layout->lineCount()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
6336 QTextLine line = layout->lineAt(i);-
6337 maxWidth = qMax(maxWidth, line.naturalTextWidth());-
6338 line.setPosition(QPointF(0, y));-
6339 y += line.height();-
6340 }
never executed: end of block
0
6341 return
never executed: return QRectF(0, 0, maxWidth, y);
QRectF(0, 0, maxWidth, y);
never executed: return QRectF(0, 0, maxWidth, y);
0
6342}-
6343-
6344void QGraphicsSimpleTextItemPrivate::updateBoundingRect()-
6345{-
6346 QGraphicsSimpleTextItem * const q = q_func();-
6347 QRectF br;-
6348 if (text.isEmpty()
text.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
6349 br = QRectF();-
6350 }
never executed: end of block
else {
0
6351 QString tmp = text;-
6352 tmp.replace(QLatin1Char('\n'), QChar::LineSeparator);-
6353 QStackTextEngine engine(tmp, font);-
6354 QTextLayout layout(&engine);-
6355 br = setupTextLayout(&layout);-
6356 }
never executed: end of block
0
6357 if (br != boundingRect
br != boundingRectDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
6358 q->prepareGeometryChange();-
6359 boundingRect = br;-
6360 q->update();-
6361 }
never executed: end of block
0
6362}
never executed: end of block
0
6363QGraphicsSimpleTextItem::QGraphicsSimpleTextItem(QGraphicsItem *parent)-
6364 : QAbstractGraphicsShapeItem(*new QGraphicsSimpleTextItemPrivate, parent)-
6365{-
6366}
never executed: end of block
0
6367QGraphicsSimpleTextItem::QGraphicsSimpleTextItem(const QString &text, QGraphicsItem *parent)-
6368 : QAbstractGraphicsShapeItem(*new QGraphicsSimpleTextItemPrivate, parent)-
6369{-
6370 setText(text);-
6371}
never executed: end of block
0
6372-
6373-
6374-
6375-
6376QGraphicsSimpleTextItem::~QGraphicsSimpleTextItem()-
6377{-
6378}-
6379-
6380-
6381-
6382-
6383-
6384-
6385-
6386void QGraphicsSimpleTextItem::setText(const QString &text)-
6387{-
6388 QGraphicsSimpleTextItemPrivate * const d = d_func();-
6389 if (d->text == text
d->text == textDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
6390 return;
never executed: return;
0
6391 d->text = text;-
6392 d->updateBoundingRect();-
6393 update();-
6394}
never executed: end of block
0
6395-
6396-
6397-
6398-
6399QString QGraphicsSimpleTextItem::text() const-
6400{-
6401 const QGraphicsSimpleTextItemPrivate * const d = d_func();-
6402 return
never executed: return d->text;
d->text;
never executed: return d->text;
0
6403}-
6404-
6405-
6406-
6407-
6408void QGraphicsSimpleTextItem::setFont(const QFont &font)-
6409{-
6410 QGraphicsSimpleTextItemPrivate * const d = d_func();-
6411 d->font = font;-
6412 d->updateBoundingRect();-
6413}
never executed: end of block
0
6414-
6415-
6416-
6417-
6418QFont QGraphicsSimpleTextItem::font() const-
6419{-
6420 const QGraphicsSimpleTextItemPrivate * const d = d_func();-
6421 return
never executed: return d->font;
d->font;
never executed: return d->font;
0
6422}-
6423-
6424-
6425-
6426-
6427QRectF QGraphicsSimpleTextItem::boundingRect() const-
6428{-
6429 const QGraphicsSimpleTextItemPrivate * const d = d_func();-
6430 return
never executed: return d->boundingRect;
d->boundingRect;
never executed: return d->boundingRect;
0
6431}-
6432-
6433-
6434-
6435-
6436QPainterPath QGraphicsSimpleTextItem::shape() const-
6437{-
6438 const QGraphicsSimpleTextItemPrivate * const d = d_func();-
6439 QPainterPath path;-
6440 path.addRect(d->boundingRect);-
6441 return
never executed: return path;
path;
never executed: return path;
0
6442}-
6443-
6444-
6445-
6446-
6447bool QGraphicsSimpleTextItem::contains(const QPointF &point) const-
6448{-
6449 const QGraphicsSimpleTextItemPrivate * const d = d_func();-
6450 return
never executed: return d->boundingRect.contains(point);
d->boundingRect.contains(point);
never executed: return d->boundingRect.contains(point);
0
6451}-
6452-
6453-
6454-
6455-
6456void QGraphicsSimpleTextItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)-
6457{-
6458 (void)widget;;-
6459 QGraphicsSimpleTextItemPrivate * const d = d_func();-
6460-
6461 painter->setFont(d->font);-
6462-
6463 QString tmp = d->text;-
6464 tmp.replace(QLatin1Char('\n'), QChar::LineSeparator);-
6465 QStackTextEngine engine(tmp, d->font);-
6466 QTextLayout layout(&engine);-
6467-
6468 QPen p;-
6469 p.setBrush(d->brush);-
6470 painter->setPen(p);-
6471 if (d->pen.style() == Qt::NoPen
d->pen.style() == Qt::NoPenDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->brush.style() == Qt::SolidPattern
d->brush.style...::SolidPatternDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
6472 painter->setBrush(Qt::NoBrush);-
6473 }
never executed: end of block
else {
0
6474 QTextLayout::FormatRange range;-
6475 range.start = 0;-
6476 range.length = layout.text().length();-
6477 range.format.setTextOutline(d->pen);-
6478 layout.setFormats(QVector<QTextLayout::FormatRange>(1, range));-
6479 }
never executed: end of block
0
6480-
6481 setupTextLayout(&layout);-
6482 layout.draw(painter, QPointF(0, 0));-
6483-
6484 if (option->state & (QStyle::State_Selected | QStyle::State_HasFocus)
option->state ...tate_HasFocus)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
6485 qt_graphicsItem_highlightSelected(this, painter, option);
never executed: qt_graphicsItem_highlightSelected(this, painter, option);
0
6486}
never executed: end of block
0
6487-
6488-
6489-
6490-
6491bool QGraphicsSimpleTextItem::isObscuredBy(const QGraphicsItem *item) const-
6492{-
6493 return
never executed: return QAbstractGraphicsShapeItem::isObscuredBy(item);
QAbstractGraphicsShapeItem::isObscuredBy(item);
never executed: return QAbstractGraphicsShapeItem::isObscuredBy(item);
0
6494}-
6495-
6496-
6497-
6498-
6499QPainterPath QGraphicsSimpleTextItem::opaqueArea() const-
6500{-
6501 return
never executed: return QAbstractGraphicsShapeItem::opaqueArea();
QAbstractGraphicsShapeItem::opaqueArea();
never executed: return QAbstractGraphicsShapeItem::opaqueArea();
0
6502}-
6503-
6504-
6505-
6506-
6507int QGraphicsSimpleTextItem::type() const-
6508{-
6509 return
never executed: return Type;
Type;
never executed: return Type;
0
6510}-
6511-
6512-
6513-
6514-
6515bool QGraphicsSimpleTextItem::supportsExtension(Extension extension) const-
6516{-
6517 (void)extension;;-
6518 return
never executed: return false;
false;
never executed: return false;
0
6519}-
6520-
6521-
6522-
6523-
6524void QGraphicsSimpleTextItem::setExtension(Extension extension, const QVariant &variant)-
6525{-
6526 (void)extension;;-
6527 (void)variant;;-
6528}
never executed: end of block
0
6529-
6530-
6531-
6532-
6533QVariant QGraphicsSimpleTextItem::extension(const QVariant &variant) const-
6534{-
6535 (void)variant;;-
6536 return
never executed: return QVariant();
QVariant();
never executed: return QVariant();
0
6537}-
6538class QGraphicsItemGroupPrivate : public QGraphicsItemPrivate-
6539{-
6540public:-
6541 QRectF itemsBoundingRect;-
6542};-
6543-
6544-
6545-
6546-
6547-
6548-
6549-
6550QGraphicsItemGroup::QGraphicsItemGroup(QGraphicsItem *parent)-
6551 : QGraphicsItem(*new QGraphicsItemGroupPrivate, parent)-
6552{-
6553 setHandlesChildEvents(true);-
6554}
never executed: end of block
0
6555-
6556-
6557-
6558-
6559QGraphicsItemGroup::~QGraphicsItemGroup()-
6560{-
6561}-
6562void QGraphicsItemGroup::addToGroup(QGraphicsItem *item)-
6563{-
6564 QGraphicsItemGroupPrivate * const d = d_func();-
6565 if (!item
!itemDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
6566 QMessageLogger(__FILE__, 11081, __PRETTY_FUNCTION__).warning("QGraphicsItemGroup::addToGroup: cannot add null item");-
6567 return;
never executed: return;
0
6568 }-
6569 if (item == this
item == thisDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
6570 QMessageLogger(__FILE__, 11085, __PRETTY_FUNCTION__).warning("QGraphicsItemGroup::addToGroup: cannot add a group to itself");-
6571 return;
never executed: return;
0
6572 }-
6573-
6574-
6575 bool ok;-
6576 QTransform itemTransform = item->itemTransform(this, &ok);-
6577-
6578 if (!ok
!okDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
6579 QMessageLogger(__FILE__, 11094, __PRETTY_FUNCTION__).warning("QGraphicsItemGroup::addToGroup: could not find a valid transformation from item to group coordinates");-
6580 return;
never executed: return;
0
6581 }-
6582-
6583 QTransform newItemTransform(itemTransform);-
6584 item->setPos(mapFromItem(item, 0, 0));-
6585 item->setParentItem(this);-
6586-
6587-
6588 if (!item->pos().isNull()
!item->pos().isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
6589 newItemTransform *= QTransform::fromTranslate(-item->x(), -item->y());
never executed: newItemTransform *= QTransform::fromTranslate(-item->x(), -item->y());
0
6590-
6591-
6592 QPointF origin = item->transformOriginPoint();-
6593 QMatrix4x4 m;-
6594 QList<QGraphicsTransform*> transformList = item->transformations();-
6595 for (int i = 0; i < transformList.size()
i < transformList.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
6596 transformList.at(i)->applyTo(&m);
never executed: transformList.at(i)->applyTo(&m);
0
6597 newItemTransform *= m.toTransform().inverted();-
6598 newItemTransform.translate(origin.x(), origin.y());-
6599 newItemTransform.rotate(-item->rotation());-
6600 newItemTransform.scale(1/item->scale(), 1/item->scale());-
6601 newItemTransform.translate(-origin.x(), -origin.y());-
6602-
6603-
6604-
6605 item->setTransform(newItemTransform);-
6606 item->d_func()->setIsMemberOfGroup(true);-
6607 prepareGeometryChange();-
6608 d->itemsBoundingRect |= itemTransform.mapRect(item->boundingRect() | item->childrenBoundingRect());-
6609 update();-
6610}
never executed: end of block
0
6611void QGraphicsItemGroup::removeFromGroup(QGraphicsItem *item)-
6612{-
6613 QGraphicsItemGroupPrivate * const d = d_func();-
6614 if (!item
!itemDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
6615 QMessageLogger(__FILE__, 11139, __PRETTY_FUNCTION__).warning("QGraphicsItemGroup::removeFromGroup: cannot remove null item");-
6616 return;
never executed: return;
0
6617 }-
6618-
6619 QGraphicsItem *newParent = d_ptr->parent;-
6620-
6621-
6622 bool ok;-
6623 QTransform itemTransform;-
6624 if (newParent
newParentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
6625 itemTransform = item->itemTransform(newParent, &ok);
never executed: itemTransform = item->itemTransform(newParent, &ok);
0
6626 else-
6627 itemTransform = item->sceneTransform();
never executed: itemTransform = item->sceneTransform();
0
6628-
6629 QPointF oldPos = item->mapToItem(newParent, 0, 0);-
6630 item->setParentItem(newParent);-
6631 item->setPos(oldPos);-
6632-
6633-
6634 if (!item->pos().isNull()
!item->pos().isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
6635 itemTransform *= QTransform::fromTranslate(-item->x(), -item->y());
never executed: itemTransform *= QTransform::fromTranslate(-item->x(), -item->y());
0
6636-
6637-
6638-
6639 QPointF origin = item->transformOriginPoint();-
6640 QMatrix4x4 m;-
6641 QList<QGraphicsTransform*> transformList = item->transformations();-
6642 for (int i = 0; i < transformList.size()
i < transformList.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
6643 transformList.at(i)->applyTo(&m);
never executed: transformList.at(i)->applyTo(&m);
0
6644 itemTransform *= m.toTransform().inverted();-
6645 itemTransform.translate(origin.x(), origin.y());-
6646 itemTransform.rotate(-item->rotation());-
6647 itemTransform.scale(1 / item->scale(), 1 / item->scale());-
6648 itemTransform.translate(-origin.x(), -origin.y());-
6649-
6650-
6651-
6652 item->setTransform(itemTransform);-
6653 item->d_func()->setIsMemberOfGroup(item->group() != 0);-
6654-
6655-
6656 prepareGeometryChange();-
6657 d->itemsBoundingRect = childrenBoundingRect();-
6658}
never executed: end of block
0
6659-
6660-
6661-
6662-
6663-
6664-
6665QRectF QGraphicsItemGroup::boundingRect() const-
6666{-
6667 const QGraphicsItemGroupPrivate * const d = d_func();-
6668 return
never executed: return d->itemsBoundingRect;
d->itemsBoundingRect;
never executed: return d->itemsBoundingRect;
0
6669}-
6670-
6671-
6672-
6673-
6674void QGraphicsItemGroup::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,-
6675 QWidget *widget)-
6676{-
6677 (void)widget;;-
6678 if (option->state & QStyle::State_Selected
option->state ...State_SelectedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
6679 QGraphicsItemGroupPrivate * const d = d_func();-
6680 painter->setBrush(Qt::NoBrush);-
6681 painter->drawRect(d->itemsBoundingRect);-
6682 }
never executed: end of block
0
6683}
never executed: end of block
0
6684-
6685-
6686-
6687-
6688bool QGraphicsItemGroup::isObscuredBy(const QGraphicsItem *item) const-
6689{-
6690 return
never executed: return QGraphicsItem::isObscuredBy(item);
QGraphicsItem::isObscuredBy(item);
never executed: return QGraphicsItem::isObscuredBy(item);
0
6691}-
6692-
6693-
6694-
6695-
6696QPainterPath QGraphicsItemGroup::opaqueArea() const-
6697{-
6698 return
never executed: return QGraphicsItem::opaqueArea();
QGraphicsItem::opaqueArea();
never executed: return QGraphicsItem::opaqueArea();
0
6699}-
6700-
6701-
6702-
6703-
6704int QGraphicsItemGroup::type() const-
6705{-
6706 return
never executed: return Type;
Type;
never executed: return Type;
0
6707}-
6708-
6709-
6710QRectF QGraphicsItemEffectSourcePrivate::boundingRect(Qt::CoordinateSystem system) const-
6711{-
6712 const bool deviceCoordinates = (system == Qt::DeviceCoordinates);-
6713 if (!info
!infoDescription
TRUEnever evaluated
FALSEnever evaluated
&& deviceCoordinates
deviceCoordinatesDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
6714-
6715 QMessageLogger(__FILE__, 11239, __PRETTY_FUNCTION__).warning("QGraphicsEffectSource::boundingRect: Not yet implemented, lacking device context");-
6716 return
never executed: return QRectF();
QRectF();
never executed: return QRectF();
0
6717 }-
6718-
6719 QRectF rect = item->boundingRect();-
6720 if (!item->d_ptr->children.isEmpty()
!item->d_ptr->...dren.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
6721 rect |= item->childrenBoundingRect();
never executed: rect |= item->childrenBoundingRect();
0
6722-
6723 if (deviceCoordinates
deviceCoordinatesDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
6724 ((!(info->painter)) ? qt_assert("info->painter",__FILE__,11248) : qt_noop());-
6725 rect = info->painter->worldTransform().mapRect(rect);-
6726 }
never executed: end of block
0
6727-
6728 return
never executed: return rect;
rect;
never executed: return rect;
0
6729}-
6730-
6731void QGraphicsItemEffectSourcePrivate::draw(QPainter *painter)-
6732{-
6733 if (!info
!infoDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
6734 QMessageLogger(__FILE__, 11258, __PRETTY_FUNCTION__).warning("QGraphicsEffectSource::draw: Can only begin as a result of QGraphicsEffect::draw");-
6735 return;
never executed: return;
0
6736 }-
6737-
6738 ((!(item->d_ptr->scene)) ? qt_assert("item->d_ptr->scene",__FILE__,11262) : qt_noop());-
6739 QGraphicsScenePrivate *scened = item->d_ptr->scene->d_func();-
6740 if (painter == info->painter
painter == info->painterDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
6741 scened->draw(item, painter, info->viewTransform, info->transformPtr, info->exposedRegion,-
6742 info->widget, info->opacity, info->effectTransform, info->wasDirtySceneTransform,-
6743 info->drawItem);-
6744 }
never executed: end of block
else {
0
6745 QTransform effectTransform = info->painter->worldTransform().inverted();-
6746 effectTransform *= painter->worldTransform();-
6747 scened->draw(item, painter, info->viewTransform, info->transformPtr, info->exposedRegion,-
6748 info->widget, info->opacity, &effectTransform, info->wasDirtySceneTransform,-
6749 info->drawItem);-
6750 }
never executed: end of block
0
6751}-
6752-
6753-
6754QRect QGraphicsItemEffectSourcePrivate::paddedEffectRect(Qt::CoordinateSystem system, QGraphicsEffect::PixmapPadMode mode, const QRectF &sourceRect, bool *unpadded) const-
6755{-
6756 QRectF effectRectF;-
6757-
6758 if (unpadded
unpaddedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
6759 *
never executed: *unpadded = false;
unpadded = false;
never executed: *unpadded = false;
0
6760-
6761 if (mode == QGraphicsEffect::PadToEffectiveBoundingRect
mode == QGraph...veBoundingRectDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
6762 if (info
infoDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
6763 QRectF deviceRect = system == Qt::DeviceCoordinates
system == Qt::...iceCoordinatesDescription
TRUEnever evaluated
FALSEnever evaluated
? sourceRect : info->painter->worldTransform().mapRect(sourceRect);
0
6764 effectRectF = item->graphicsEffect()->boundingRectFor(deviceRect);-
6765 if (unpadded
unpaddedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
6766 *
never executed: *unpadded = (effectRectF.size() == sourceRect.size());
unpadded = (effectRectF.size() == sourceRect.size());
never executed: *unpadded = (effectRectF.size() == sourceRect.size());
0
6767 if (info
infoDescription
TRUEnever evaluated
FALSEnever evaluated
&& system == Qt::LogicalCoordinates
system == Qt::...calCoordinatesDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
6768 effectRectF = info->painter->worldTransform().inverted().mapRect(effectRectF);
never executed: effectRectF = info->painter->worldTransform().inverted().mapRect(effectRectF);
0
6769 }
never executed: end of block
else {
0
6770-
6771 effectRectF = item->graphicsEffect()->boundingRectFor(sourceRect);-
6772 }
never executed: end of block
0
6773 } else if (mode == QGraphicsEffect::PadToTransparentBorder
mode == QGraph...nsparentBorderDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
6774-
6775 effectRectF = sourceRect.adjusted(-1.5, -1.5, 1.5, 1.5);-
6776 }
never executed: end of block
else {
0
6777 effectRectF = sourceRect;-
6778 if (unpadded
unpaddedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
6779 *
never executed: *unpadded = true;
unpadded = true;
never executed: *unpadded = true;
0
6780 }
never executed: end of block
0
6781-
6782 return
never executed: return effectRectF.toAlignedRect();
effectRectF.toAlignedRect();
never executed: return effectRectF.toAlignedRect();
0
6783}-
6784-
6785QPixmap QGraphicsItemEffectSourcePrivate::pixmap(Qt::CoordinateSystem system, QPoint *offset,-
6786 QGraphicsEffect::PixmapPadMode mode) const-
6787{-
6788 const bool deviceCoordinates = (system == Qt::DeviceCoordinates);-
6789 if (!info
!infoDescription
TRUEnever evaluated
FALSEnever evaluated
&& deviceCoordinates
deviceCoordinatesDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
6790-
6791 QMessageLogger(__FILE__, 11315, __PRETTY_FUNCTION__).warning("QGraphicsEffectSource::pixmap: Not yet implemented, lacking device context");-
6792 return
never executed: return QPixmap();
QPixmap();
never executed: return QPixmap();
0
6793 }-
6794 if (!item->d_ptr->scene
!item->d_ptr->sceneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
6795 return
never executed: return QPixmap();
QPixmap();
never executed: return QPixmap();
0
6796 QGraphicsScenePrivate *scened = item->d_ptr->scene->d_func();-
6797-
6798 bool unpadded;-
6799 const QRectF sourceRect = boundingRect(system);-
6800 QRect effectRect = paddedEffectRect(system, mode, sourceRect, &unpadded);-
6801-
6802 if (offset
offsetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
6803 *
never executed: *offset = effectRect.topLeft();
offset = effectRect.topLeft();
never executed: *offset = effectRect.topLeft();
0
6804-
6805 bool untransformed = !deviceCoordinates
!deviceCoordinatesDescription
TRUEnever evaluated
FALSEnever evaluated
0
6806 || info->painter->worldTransform().type() <= QTransform::TxTranslate
info->painter-...m::TxTranslateDescription
TRUEnever evaluated
FALSEnever evaluated
;
0
6807 if (untransformed
untransformedDescription
TRUEnever evaluated
FALSEnever evaluated
&& unpadded
unpaddedDescription
TRUEnever evaluated
FALSEnever evaluated
&& isPixmap()
isPixmap()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
6808 if (offset
offsetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
6809 *
never executed: *offset = boundingRect(system).topLeft().toPoint();
offset = boundingRect(system).topLeft().toPoint();
never executed: *offset = boundingRect(system).topLeft().toPoint();
0
6810 return
never executed: return static_cast<QGraphicsPixmapItem *>(item)->pixmap();
static_cast<QGraphicsPixmapItem *>(item)->pixmap();
never executed: return static_cast<QGraphicsPixmapItem *>(item)->pixmap();
0
6811 }-
6812-
6813 if (effectRect.isEmpty()
effectRect.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
6814 return
never executed: return QPixmap();
QPixmap();
never executed: return QPixmap();
0
6815-
6816 QPixmap pixmap(effectRect.size());-
6817 pixmap.fill(Qt::transparent);-
6818 QPainter pixmapPainter(&pixmap);-
6819 pixmapPainter.setRenderHints(info ? info->painter->renderHints() : QPainter::TextAntialiasing);-
6820-
6821 QTransform effectTransform = QTransform::fromTranslate(-effectRect.x(), -effectRect.y());-
6822 if (deviceCoordinates
deviceCoordinatesDescription
TRUEnever evaluated
FALSEnever evaluated
&& info->effectTransform
info->effectTransformDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
6823 effectTransform *= *info->effectTransform;
never executed: effectTransform *= *info->effectTransform;
0
6824-
6825 if (!info
!infoDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
6826-
6827 QTransform sceneTransform = item->sceneTransform();-
6828 QTransform newEffectTransform = sceneTransform.inverted();-
6829 newEffectTransform *= effectTransform;-
6830 scened->draw(item, &pixmapPainter, 0, &sceneTransform, 0, 0, qreal(1.0),-
6831 &newEffectTransform, false, true);-
6832 }
never executed: end of block
else if (deviceCoordinates
deviceCoordinatesDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
6833-
6834 scened->draw(item, &pixmapPainter, info->viewTransform, info->transformPtr, 0,-
6835 info->widget, info->opacity, &effectTransform, info->wasDirtySceneTransform,-
6836 info->drawItem);-
6837 }
never executed: end of block
else {
0
6838-
6839 QTransform newEffectTransform = info->transformPtr->inverted();-
6840 newEffectTransform *= effectTransform;-
6841 scened->draw(item, &pixmapPainter, info->viewTransform, info->transformPtr, 0,-
6842 info->widget, info->opacity, &newEffectTransform, info->wasDirtySceneTransform,-
6843 info->drawItem);-
6844 }
never executed: end of block
0
6845-
6846 pixmapPainter.end();-
6847-
6848 return
never executed: return pixmap;
pixmap;
never executed: return pixmap;
0
6849}-
6850-
6851-
6852-
6853static void formatGraphicsItemHelper(QDebug debug, const QGraphicsItem *item)-
6854{-
6855 if (const
const QGraphic...->parentItem()Description
TRUEnever evaluated
FALSEnever evaluated
QGraphicsItem *parent = item->parentItem()
const QGraphic...->parentItem()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
6856 debug << ", parent=" << static_cast<const void *>(parent);
never executed: debug << ", parent=" << static_cast<const void *>(parent);
0
6857 debug << ", pos=";-
6858 QtDebugUtils::formatQPoint(debug, item->pos());-
6859 if (const
const qreal z = item->zValue()Description
TRUEnever evaluated
FALSEnever evaluated
qreal z = item->zValue()
const qreal z = item->zValue()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
6860 debug << ", z=" << z;
never executed: debug << ", z=" << z;
0
6861 if (item->flags()
item->flags()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
6862 debug << ", flags=" << item->flags();
never executed: debug << ", flags=" << item->flags();
0
6863}
never executed: end of block
0
6864-
6865-
6866QDebug operator<<(QDebug debug, QGraphicsItem *item)-
6867{-
6868 QDebugStateSaver saver(debug);-
6869 debug.nospace();-
6870-
6871 if (!item
!itemDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
6872 debug << "QGraphicsItem(0)";-
6873 return
never executed: return debug;
debug;
never executed: return debug;
0
6874 }-
6875-
6876 if (QGraphicsObject *o = item->toGraphicsObject()
QGraphicsObjec...aphicsObject()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
6877 debug << o->metaObject()->className();
never executed: debug << o->metaObject()->className();
0
6878 else-
6879 debug << "QGraphicsItem";
never executed: debug << "QGraphicsItem";
0
6880 debug << '(' << static_cast<const void *>(item);-
6881 if (const
const QGraphic...idget *>(item)Description
TRUEnever evaluated
FALSEnever evaluated
QGraphicsProxyWidget *pw = qgraphicsitem_cast<const QGraphicsProxyWidget *>(item)
const QGraphic...idget *>(item)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
6882 debug << ", widget=";-
6883 if (const
const QWidget ...= pw->widget()Description
TRUEnever evaluated
FALSEnever evaluated
QWidget *w = pw->widget()
const QWidget ...= pw->widget()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
6884 debug << w->metaObject()->className() << '(' << static_cast<const void *>(w);-
6885 if (!w->objectName().isEmpty()
!w->objectName().isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
6886 debug << ", name=" << w->objectName();
never executed: debug << ", name=" << w->objectName();
0
6887 debug << ')';-
6888 }
never executed: end of block
else {
0
6889 debug << "QWidget(0)";-
6890 }
never executed: end of block
0
6891 }-
6892 formatGraphicsItemHelper(debug, item);-
6893 debug << ')';-
6894 return
never executed: return debug;
debug;
never executed: return debug;
0
6895}-
6896-
6897-
6898QDebug operator<<(QDebug debug, QGraphicsObject *item)-
6899{-
6900 QDebugStateSaver saver(debug);-
6901 debug.nospace();-
6902-
6903 if (!item
!itemDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
6904 debug << "QGraphicsObject(0)";-
6905 return
never executed: return debug;
debug;
never executed: return debug;
0
6906 }-
6907-
6908 debug << item->metaObject()->className() << '(' << static_cast<const void *>(item);-
6909 if (!item->objectName().isEmpty()
!item->objectName().isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
6910 debug << ", name=" << item->objectName();
never executed: debug << ", name=" << item->objectName();
0
6911 formatGraphicsItemHelper(debug, item);-
6912 debug << ')';-
6913 return
never executed: return debug;
debug;
never executed: return debug;
0
6914}-
6915-
6916QDebug operator<<(QDebug debug, QGraphicsItem::GraphicsItemChange change)-
6917{-
6918 const char *str = "UnknownChange";-
6919 switch (change) {-
6920 case
never executed: case QGraphicsItem::ItemChildAddedChange:
QGraphicsItem::ItemChildAddedChange:
never executed: case QGraphicsItem::ItemChildAddedChange:
0
6921 str = "ItemChildAddedChange";-
6922 break;
never executed: break;
0
6923 case
never executed: case QGraphicsItem::ItemChildRemovedChange:
QGraphicsItem::ItemChildRemovedChange:
never executed: case QGraphicsItem::ItemChildRemovedChange:
0
6924 str = "ItemChildRemovedChange";-
6925 break;
never executed: break;
0
6926 case
never executed: case QGraphicsItem::ItemCursorChange:
QGraphicsItem::ItemCursorChange:
never executed: case QGraphicsItem::ItemCursorChange:
0
6927 str = "ItemCursorChange";-
6928 break;
never executed: break;
0
6929 case
never executed: case QGraphicsItem::ItemCursorHasChanged:
QGraphicsItem::ItemCursorHasChanged:
never executed: case QGraphicsItem::ItemCursorHasChanged:
0
6930 str = "ItemCursorHasChanged";-
6931 break;
never executed: break;
0
6932 case
never executed: case QGraphicsItem::ItemEnabledChange:
QGraphicsItem::ItemEnabledChange:
never executed: case QGraphicsItem::ItemEnabledChange:
0
6933 str = "ItemEnabledChange";-
6934 break;
never executed: break;
0
6935 case
never executed: case QGraphicsItem::ItemEnabledHasChanged:
QGraphicsItem::ItemEnabledHasChanged:
never executed: case QGraphicsItem::ItemEnabledHasChanged:
0
6936 str = "ItemEnabledHasChanged";-
6937 break;
never executed: break;
0
6938 case
never executed: case QGraphicsItem::ItemFlagsChange:
QGraphicsItem::ItemFlagsChange:
never executed: case QGraphicsItem::ItemFlagsChange:
0
6939 str = "ItemFlagsChange";-
6940 break;
never executed: break;
0
6941 case
never executed: case QGraphicsItem::ItemFlagsHaveChanged:
QGraphicsItem::ItemFlagsHaveChanged:
never executed: case QGraphicsItem::ItemFlagsHaveChanged:
0
6942 str = "ItemFlagsHaveChanged";-
6943 break;
never executed: break;
0
6944 case
never executed: case QGraphicsItem::ItemMatrixChange:
QGraphicsItem::ItemMatrixChange:
never executed: case QGraphicsItem::ItemMatrixChange:
0
6945 str = "ItemMatrixChange";-
6946 break;
never executed: break;
0
6947 case
never executed: case QGraphicsItem::ItemParentChange:
QGraphicsItem::ItemParentChange:
never executed: case QGraphicsItem::ItemParentChange:
0
6948 str = "ItemParentChange";-
6949 break;
never executed: break;
0
6950 case
never executed: case QGraphicsItem::ItemParentHasChanged:
QGraphicsItem::ItemParentHasChanged:
never executed: case QGraphicsItem::ItemParentHasChanged:
0
6951 str = "ItemParentHasChanged";-
6952 break;
never executed: break;
0
6953 case
never executed: case QGraphicsItem::ItemPositionChange:
QGraphicsItem::ItemPositionChange:
never executed: case QGraphicsItem::ItemPositionChange:
0
6954 str = "ItemPositionChange";-
6955 break;
never executed: break;
0
6956 case
never executed: case QGraphicsItem::ItemPositionHasChanged:
QGraphicsItem::ItemPositionHasChanged:
never executed: case QGraphicsItem::ItemPositionHasChanged:
0
6957 str = "ItemPositionHasChanged";-
6958 break;
never executed: break;
0
6959 case
never executed: case QGraphicsItem::ItemSceneChange:
QGraphicsItem::ItemSceneChange:
never executed: case QGraphicsItem::ItemSceneChange:
0
6960 str = "ItemSceneChange";-
6961 break;
never executed: break;
0
6962 case
never executed: case QGraphicsItem::ItemSceneHasChanged:
QGraphicsItem::ItemSceneHasChanged:
never executed: case QGraphicsItem::ItemSceneHasChanged:
0
6963 str = "ItemSceneHasChanged";-
6964 break;
never executed: break;
0
6965 case
never executed: case QGraphicsItem::ItemSelectedChange:
QGraphicsItem::ItemSelectedChange:
never executed: case QGraphicsItem::ItemSelectedChange:
0
6966 str = "ItemSelectedChange";-
6967 break;
never executed: break;
0
6968 case
never executed: case QGraphicsItem::ItemSelectedHasChanged:
QGraphicsItem::ItemSelectedHasChanged:
never executed: case QGraphicsItem::ItemSelectedHasChanged:
0
6969 str = "ItemSelectedHasChanged";-
6970 break;
never executed: break;
0
6971 case
never executed: case QGraphicsItem::ItemToolTipChange:
QGraphicsItem::ItemToolTipChange:
never executed: case QGraphicsItem::ItemToolTipChange:
0
6972 str = "ItemToolTipChange";-
6973 break;
never executed: break;
0
6974 case
never executed: case QGraphicsItem::ItemToolTipHasChanged:
QGraphicsItem::ItemToolTipHasChanged:
never executed: case QGraphicsItem::ItemToolTipHasChanged:
0
6975 str = "ItemToolTipHasChanged";-
6976 break;
never executed: break;
0
6977 case
never executed: case QGraphicsItem::ItemTransformChange:
QGraphicsItem::ItemTransformChange:
never executed: case QGraphicsItem::ItemTransformChange:
0
6978 str = "ItemTransformChange";-
6979 break;
never executed: break;
0
6980 case
never executed: case QGraphicsItem::ItemTransformHasChanged:
QGraphicsItem::ItemTransformHasChanged:
never executed: case QGraphicsItem::ItemTransformHasChanged:
0
6981 str = "ItemTransformHasChanged";-
6982 break;
never executed: break;
0
6983 case
never executed: case QGraphicsItem::ItemVisibleChange:
QGraphicsItem::ItemVisibleChange:
never executed: case QGraphicsItem::ItemVisibleChange:
0
6984 str = "ItemVisibleChange";-
6985 break;
never executed: break;
0
6986 case
never executed: case QGraphicsItem::ItemVisibleHasChanged:
QGraphicsItem::ItemVisibleHasChanged:
never executed: case QGraphicsItem::ItemVisibleHasChanged:
0
6987 str = "ItemVisibleHasChanged";-
6988 break;
never executed: break;
0
6989 case
never executed: case QGraphicsItem::ItemZValueChange:
QGraphicsItem::ItemZValueChange:
never executed: case QGraphicsItem::ItemZValueChange:
0
6990 str = "ItemZValueChange";-
6991 break;
never executed: break;
0
6992 case
never executed: case QGraphicsItem::ItemZValueHasChanged:
QGraphicsItem::ItemZValueHasChanged:
never executed: case QGraphicsItem::ItemZValueHasChanged:
0
6993 str = "ItemZValueHasChanged";-
6994 break;
never executed: break;
0
6995 case
never executed: case QGraphicsItem::ItemOpacityChange:
QGraphicsItem::ItemOpacityChange:
never executed: case QGraphicsItem::ItemOpacityChange:
0
6996 str = "ItemOpacityChange";-
6997 break;
never executed: break;
0
6998 case
never executed: case QGraphicsItem::ItemOpacityHasChanged:
QGraphicsItem::ItemOpacityHasChanged:
never executed: case QGraphicsItem::ItemOpacityHasChanged:
0
6999 str = "ItemOpacityHasChanged";-
7000 break;
never executed: break;
0
7001 case
never executed: case QGraphicsItem::ItemScenePositionHasChanged:
QGraphicsItem::ItemScenePositionHasChanged:
never executed: case QGraphicsItem::ItemScenePositionHasChanged:
0
7002 str = "ItemScenePositionHasChanged";-
7003 break;
never executed: break;
0
7004 case
never executed: case QGraphicsItem::ItemRotationChange:
QGraphicsItem::ItemRotationChange:
never executed: case QGraphicsItem::ItemRotationChange:
0
7005 str = "ItemRotationChange";-
7006 break;
never executed: break;
0
7007 case
never executed: case QGraphicsItem::ItemRotationHasChanged:
QGraphicsItem::ItemRotationHasChanged:
never executed: case QGraphicsItem::ItemRotationHasChanged:
0
7008 str = "ItemRotationHasChanged";-
7009 break;
never executed: break;
0
7010 case
never executed: case QGraphicsItem::ItemScaleChange:
QGraphicsItem::ItemScaleChange:
never executed: case QGraphicsItem::ItemScaleChange:
0
7011 str = "ItemScaleChange";-
7012 break;
never executed: break;
0
7013 case
never executed: case QGraphicsItem::ItemScaleHasChanged:
QGraphicsItem::ItemScaleHasChanged:
never executed: case QGraphicsItem::ItemScaleHasChanged:
0
7014 str = "ItemScaleHasChanged";-
7015 break;
never executed: break;
0
7016 case
never executed: case QGraphicsItem::ItemTransformOriginPointChange:
QGraphicsItem::ItemTransformOriginPointChange:
never executed: case QGraphicsItem::ItemTransformOriginPointChange:
0
7017 str = "ItemTransformOriginPointChange";-
7018 break;
never executed: break;
0
7019 case
never executed: case QGraphicsItem::ItemTransformOriginPointHasChanged:
QGraphicsItem::ItemTransformOriginPointHasChanged:
never executed: case QGraphicsItem::ItemTransformOriginPointHasChanged:
0
7020 str = "ItemTransformOriginPointHasChanged";-
7021 break;
never executed: break;
0
7022 }-
7023 debug << str;-
7024 return
never executed: return debug;
debug;
never executed: return debug;
0
7025}-
7026-
7027QDebug operator<<(QDebug debug, QGraphicsItem::GraphicsItemFlag flag)-
7028{-
7029 const char *str = "UnknownFlag";-
7030 switch (flag) {-
7031 case
never executed: case QGraphicsItem::ItemIsMovable:
QGraphicsItem::ItemIsMovable:
never executed: case QGraphicsItem::ItemIsMovable:
0
7032 str = "ItemIsMovable";-
7033 break;
never executed: break;
0
7034 case
never executed: case QGraphicsItem::ItemIsSelectable:
QGraphicsItem::ItemIsSelectable:
never executed: case QGraphicsItem::ItemIsSelectable:
0
7035 str = "ItemIsSelectable";-
7036 break;
never executed: break;
0
7037 case
never executed: case QGraphicsItem::ItemIsFocusable:
QGraphicsItem::ItemIsFocusable:
never executed: case QGraphicsItem::ItemIsFocusable:
0
7038 str = "ItemIsFocusable";-
7039 break;
never executed: break;
0
7040 case
never executed: case QGraphicsItem::ItemClipsToShape:
QGraphicsItem::ItemClipsToShape:
never executed: case QGraphicsItem::ItemClipsToShape:
0
7041 str = "ItemClipsToShape";-
7042 break;
never executed: break;
0
7043 case
never executed: case QGraphicsItem::ItemClipsChildrenToShape:
QGraphicsItem::ItemClipsChildrenToShape:
never executed: case QGraphicsItem::ItemClipsChildrenToShape:
0
7044 str = "ItemClipsChildrenToShape";-
7045 break;
never executed: break;
0
7046 case
never executed: case QGraphicsItem::ItemIgnoresTransformations:
QGraphicsItem::ItemIgnoresTransformations:
never executed: case QGraphicsItem::ItemIgnoresTransformations:
0
7047 str = "ItemIgnoresTransformations";-
7048 break;
never executed: break;
0
7049 case
never executed: case QGraphicsItem::ItemIgnoresParentOpacity:
QGraphicsItem::ItemIgnoresParentOpacity:
never executed: case QGraphicsItem::ItemIgnoresParentOpacity:
0
7050 str = "ItemIgnoresParentOpacity";-
7051 break;
never executed: break;
0
7052 case
never executed: case QGraphicsItem::ItemDoesntPropagateOpacityToChildren:
QGraphicsItem::ItemDoesntPropagateOpacityToChildren:
never executed: case QGraphicsItem::ItemDoesntPropagateOpacityToChildren:
0
7053 str = "ItemDoesntPropagateOpacityToChildren";-
7054 break;
never executed: break;
0
7055 case
never executed: case QGraphicsItem::ItemStacksBehindParent:
QGraphicsItem::ItemStacksBehindParent:
never executed: case QGraphicsItem::ItemStacksBehindParent:
0
7056 str = "ItemStacksBehindParent";-
7057 break;
never executed: break;
0
7058 case
never executed: case QGraphicsItem::ItemUsesExtendedStyleOption:
QGraphicsItem::ItemUsesExtendedStyleOption:
never executed: case QGraphicsItem::ItemUsesExtendedStyleOption:
0
7059 str = "ItemUsesExtendedStyleOption";-
7060 break;
never executed: break;
0
7061 case
never executed: case QGraphicsItem::ItemHasNoContents:
QGraphicsItem::ItemHasNoContents:
never executed: case QGraphicsItem::ItemHasNoContents:
0
7062 str = "ItemHasNoContents";-
7063 break;
never executed: break;
0
7064 case
never executed: case QGraphicsItem::ItemSendsGeometryChanges:
QGraphicsItem::ItemSendsGeometryChanges:
never executed: case QGraphicsItem::ItemSendsGeometryChanges:
0
7065 str = "ItemSendsGeometryChanges";-
7066 break;
never executed: break;
0
7067 case
never executed: case QGraphicsItem::ItemAcceptsInputMethod:
QGraphicsItem::ItemAcceptsInputMethod:
never executed: case QGraphicsItem::ItemAcceptsInputMethod:
0
7068 str = "ItemAcceptsInputMethod";-
7069 break;
never executed: break;
0
7070 case
never executed: case QGraphicsItem::ItemNegativeZStacksBehindParent:
QGraphicsItem::ItemNegativeZStacksBehindParent:
never executed: case QGraphicsItem::ItemNegativeZStacksBehindParent:
0
7071 str = "ItemNegativeZStacksBehindParent";-
7072 break;
never executed: break;
0
7073 case
never executed: case QGraphicsItem::ItemIsPanel:
QGraphicsItem::ItemIsPanel:
never executed: case QGraphicsItem::ItemIsPanel:
0
7074 str = "ItemIsPanel";-
7075 break;
never executed: break;
0
7076 case
never executed: case QGraphicsItem::ItemIsFocusScope:
QGraphicsItem::ItemIsFocusScope:
never executed: case QGraphicsItem::ItemIsFocusScope:
0
7077 str = "ItemIsFocusScope";-
7078 break;
never executed: break;
0
7079 case
never executed: case QGraphicsItem::ItemSendsScenePositionChanges:
QGraphicsItem::ItemSendsScenePositionChanges:
never executed: case QGraphicsItem::ItemSendsScenePositionChanges:
0
7080 str = "ItemSendsScenePositionChanges";-
7081 break;
never executed: break;
0
7082 case
never executed: case QGraphicsItem::ItemStopsClickFocusPropagation:
QGraphicsItem::ItemStopsClickFocusPropagation:
never executed: case QGraphicsItem::ItemStopsClickFocusPropagation:
0
7083 str = "ItemStopsClickFocusPropagation";-
7084 break;
never executed: break;
0
7085 case
never executed: case QGraphicsItem::ItemStopsFocusHandling:
QGraphicsItem::ItemStopsFocusHandling:
never executed: case QGraphicsItem::ItemStopsFocusHandling:
0
7086 str = "ItemStopsFocusHandling";-
7087 break;
never executed: break;
0
7088 case
never executed: case QGraphicsItem::ItemContainsChildrenInShape:
QGraphicsItem::ItemContainsChildrenInShape:
never executed: case QGraphicsItem::ItemContainsChildrenInShape:
0
7089 str = "ItemContainsChildrenInShape";-
7090 break;
never executed: break;
0
7091 }-
7092 debug << str;-
7093 return
never executed: return debug;
debug;
never executed: return debug;
0
7094}-
7095-
7096QDebug operator<<(QDebug debug, QGraphicsItem::GraphicsItemFlags flags)-
7097{-
7098 debug << '(';-
7099 bool f = false;-
7100 for (int i = 0; i < 17
i < 17Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
7101 if (flags & (1 << i)
flags & (1 << i)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
7102 if (f
fDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
7103 debug << '|';
never executed: debug << '|';
0
7104 f = true;-
7105 debug << QGraphicsItem::GraphicsItemFlag(int(flags & (1 << i)));-
7106 }
never executed: end of block
0
7107 }
never executed: end of block
0
7108 debug << ')';-
7109 return
never executed: return debug;
debug;
never executed: return debug;
0
7110}-
7111-
7112-
7113-
7114-
7115-
Switch to Source codePreprocessed file

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