| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/widgets/graphicsview/qgraphicsitem.cpp | 
| Switch to Source code | Preprocessed file | 
| Line | Source | Count | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||||||||
| 5 | - | |||||||||||||||||||||||||||||||
| 6 | - | |||||||||||||||||||||||||||||||
| 7 | - | |||||||||||||||||||||||||||||||
| 8 | - | |||||||||||||||||||||||||||||||
| 9 | - | |||||||||||||||||||||||||||||||
| 10 | static inline void _q_adjustRect(QRect *rect) | - | ||||||||||||||||||||||||||||||
| 11 | { | - | ||||||||||||||||||||||||||||||
| 12 | ((!(rect)) ? qt_assert("rect",__FILE__,769) : qt_noop()); | - | ||||||||||||||||||||||||||||||
| 13 |     if (!rect->width()
  | 0 | ||||||||||||||||||||||||||||||
| 14 |         rect->adjust(0, 0, 1, 0); never executed:  rect->adjust(0, 0, 1, 0); | 0 | ||||||||||||||||||||||||||||||
| 15 |     if (!rect->height()
  | 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 | - | |||||||||||||||||||||||||||||||
| 22 | class QGraphicsItemCustomDataStore | - | ||||||||||||||||||||||||||||||
| 23 | { | - | ||||||||||||||||||||||||||||||
| 24 | public: | - | ||||||||||||||||||||||||||||||
| 25 | QHash<const QGraphicsItem *, QMap<int, QVariant> > data; | - | ||||||||||||||||||||||||||||||
| 26 | }; | - | ||||||||||||||||||||||||||||||
| 27 | namespace { 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
 never executed:   }guard.store(QtGlobalStatic::Destroyed);never executed:   }; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; returnend of blocknever executed:   &holder.value;return &holder.value;never executed:   } } } static QGlobalStatic<QGraphicsItemCustomDataStore, Q_QGS_qt_dataStore::innerFunction, Q_QGS_qt_dataStore::guard> qt_dataStore;return &holder.value; | 0 | ||||||||||||||||||||||||||||||
| 28 | - | |||||||||||||||||||||||||||||||
| 29 | - | |||||||||||||||||||||||||||||||
| 30 | - | |||||||||||||||||||||||||||||||
| 31 | - | |||||||||||||||||||||||||||||||
| 32 | - | |||||||||||||||||||||||||||||||
| 33 | - | |||||||||||||||||||||||||||||||
| 34 | - | |||||||||||||||||||||||||||||||
| 35 | static 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()
 
  | 0 | ||||||||||||||||||||||||||||||
| 42 |         return never executed:   path;return path;never executed:  return path; | 0 | ||||||||||||||||||||||||||||||
| 43 | QPainterPathStroker ps; | - | ||||||||||||||||||||||||||||||
| 44 | ps.setCapStyle(pen.capStyle()); | - | ||||||||||||||||||||||||||||||
| 45 |     if (pen.widthF() <= 0.0
  | 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:   p;return p;never executed:  return p; | 0 | ||||||||||||||||||||||||||||||
| 54 | } | - | ||||||||||||||||||||||||||||||
| 55 | void QGraphicsItemPrivate::updateAncestorFlag(QGraphicsItem::GraphicsItemFlag childFlag, | - | ||||||||||||||||||||||||||||||
| 56 | AncestorFlag flag, bool enabled, bool root) | - | ||||||||||||||||||||||||||||||
| 57 | { | - | ||||||||||||||||||||||||||||||
| 58 | QGraphicsItem * const q = q_func(); | - | ||||||||||||||||||||||||||||||
| 59 |     if (root
  | 0 | ||||||||||||||||||||||||||||||
| 60 | - | |||||||||||||||||||||||||||||||
| 61 | - | |||||||||||||||||||||||||||||||
| 62 | switch (int(childFlag)) { | - | ||||||||||||||||||||||||||||||
| 63 |         case never executed:   -2:case -2:never executed:  case -2: | 0 | ||||||||||||||||||||||||||||||
| 64 | flag = AncestorFiltersChildEvents; | - | ||||||||||||||||||||||||||||||
| 65 | enabled = q->filtersChildEvents(); | - | ||||||||||||||||||||||||||||||
| 66 |             break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 67 |         case never executed:   -1:case -1:never executed:  case -1: | 0 | ||||||||||||||||||||||||||||||
| 68 | flag = AncestorHandlesChildEvents; | - | ||||||||||||||||||||||||||||||
| 69 | enabled = q->handlesChildEvents(); | - | ||||||||||||||||||||||||||||||
| 70 |             break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 71 |         case never executed:   QGraphicsItem::ItemClipsChildrenToShape:case QGraphicsItem::ItemClipsChildrenToShape:never executed:  case QGraphicsItem::ItemClipsChildrenToShape: | 0 | ||||||||||||||||||||||||||||||
| 72 | flag = AncestorClipsChildren; | - | ||||||||||||||||||||||||||||||
| 73 | enabled = flags & QGraphicsItem::ItemClipsChildrenToShape; | - | ||||||||||||||||||||||||||||||
| 74 |             break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 75 |         case never executed:   QGraphicsItem::ItemIgnoresTransformations:case QGraphicsItem::ItemIgnoresTransformations:never executed:  case QGraphicsItem::ItemIgnoresTransformations: | 0 | ||||||||||||||||||||||||||||||
| 76 | flag = AncestorIgnoresTransformations; | - | ||||||||||||||||||||||||||||||
| 77 | enabled = flags & QGraphicsItem::ItemIgnoresTransformations; | - | ||||||||||||||||||||||||||||||
| 78 |             break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 79 |         case never executed:   QGraphicsItem::ItemContainsChildrenInShape:case QGraphicsItem::ItemContainsChildrenInShape:never executed:  case QGraphicsItem::ItemContainsChildrenInShape: | 0 | ||||||||||||||||||||||||||||||
| 80 | flag = AncestorContainsChildren; | - | ||||||||||||||||||||||||||||||
| 81 | enabled = flags & QGraphicsItem::ItemContainsChildrenInShape; | - | ||||||||||||||||||||||||||||||
| 82 |             break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 83 |         default never executed:  :default:never executed:  default: | 0 | ||||||||||||||||||||||||||||||
| 84 |             return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 85 | } | - | ||||||||||||||||||||||||||||||
| 86 | - | |||||||||||||||||||||||||||||||
| 87 |         if (parent
  | 0 | ||||||||||||||||||||||||||||||
| 88 | - | |||||||||||||||||||||||||||||||
| 89 |             if ((
 
  | 0 | ||||||||||||||||||||||||||||||
| 90 |                     || (
 
  | 0 | ||||||||||||||||||||||||||||||
| 91 |                     || (int(childFlag) == -1
 
  | 0 | ||||||||||||||||||||||||||||||
| 92 |                     || (int(childFlag) == -2
 
  | 0 | ||||||||||||||||||||||||||||||
| 93 | enabled = true; | - | ||||||||||||||||||||||||||||||
| 94 | ancestorFlags |= flag; | - | ||||||||||||||||||||||||||||||
| 95 |             } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||
| 96 | ancestorFlags &= ~flag; | - | ||||||||||||||||||||||||||||||
| 97 |             } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 98 | } else { | - | ||||||||||||||||||||||||||||||
| 99 | - | |||||||||||||||||||||||||||||||
| 100 | - | |||||||||||||||||||||||||||||||
| 101 | ancestorFlags = 0; | - | ||||||||||||||||||||||||||||||
| 102 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 103 | } else { | - | ||||||||||||||||||||||||||||||
| 104 | - | |||||||||||||||||||||||||||||||
| 105 |         if (((
 
 
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 106 |             return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 107 | - | |||||||||||||||||||||||||||||||
| 108 | - | |||||||||||||||||||||||||||||||
| 109 |         if (enabled
  | 0 | ||||||||||||||||||||||||||||||
| 110 |             ancestorFlags |= flag; never executed:  ancestorFlags |= flag; | 0 | ||||||||||||||||||||||||||||||
| 111 | else | - | ||||||||||||||||||||||||||||||
| 112 |             ancestorFlags &= ~flag; never executed:  ancestorFlags &= ~flag; | 0 | ||||||||||||||||||||||||||||||
| 113 | - | |||||||||||||||||||||||||||||||
| 114 | - | |||||||||||||||||||||||||||||||
| 115 |         if ((int(childFlag) != -1
 
  | 0 | ||||||||||||||||||||||||||||||
| 116 |             || (int(childFlag) == -1
 
  | 0 | ||||||||||||||||||||||||||||||
| 117 |             || (int(childFlag) == -2
 
  | 0 | ||||||||||||||||||||||||||||||
| 118 |             return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 119 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 120 | - | |||||||||||||||||||||||||||||||
| 121 |     for (int i = 0; i < children.size()
  | 0 | ||||||||||||||||||||||||||||||
| 122 |         children.at(i)->d_ptr->updateAncestorFlag(childFlag, flag, enabled, false); never executed:  children.at(i)->d_ptr->updateAncestorFlag(childFlag, flag, enabled, false); | 0 | ||||||||||||||||||||||||||||||
| 123 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 124 | - | |||||||||||||||||||||||||||||||
| 125 | void QGraphicsItemPrivate::updateAncestorFlags() | - | ||||||||||||||||||||||||||||||
| 126 | { | - | ||||||||||||||||||||||||||||||
| 127 | int flags = 0; | - | ||||||||||||||||||||||||||||||
| 128 |     if (parent
  | 0 | ||||||||||||||||||||||||||||||
| 129 | - | |||||||||||||||||||||||||||||||
| 130 | QGraphicsItemPrivate *pd = parent->d_ptr.data(); | - | ||||||||||||||||||||||||||||||
| 131 | flags = pd->ancestorFlags; | - | ||||||||||||||||||||||||||||||
| 132 | - | |||||||||||||||||||||||||||||||
| 133 | - | |||||||||||||||||||||||||||||||
| 134 |         if (pd->filtersDescendantEvents
  | 0 | ||||||||||||||||||||||||||||||
| 135 |             flags |= AncestorFiltersChildEvents; never executed:  flags |= AncestorFiltersChildEvents; | 0 | ||||||||||||||||||||||||||||||
| 136 |         if (pd->handlesChildEvents
  | 0 | ||||||||||||||||||||||||||||||
| 137 |             flags |= AncestorHandlesChildEvents; never executed:  flags |= AncestorHandlesChildEvents; | 0 | ||||||||||||||||||||||||||||||
| 138 |         if (pd->flags & QGraphicsItem::ItemClipsChildrenToShape
  | 0 | ||||||||||||||||||||||||||||||
| 139 |             flags |= AncestorClipsChildren; never executed:  flags |= AncestorClipsChildren; | 0 | ||||||||||||||||||||||||||||||
| 140 |         if (pd->flags & QGraphicsItem::ItemIgnoresTransformations
  | 0 | ||||||||||||||||||||||||||||||
| 141 |             flags |= AncestorIgnoresTransformations; never executed:  flags |= AncestorIgnoresTransformations; | 0 | ||||||||||||||||||||||||||||||
| 142 |         if (pd->flags & QGraphicsItem::ItemContainsChildrenInShape
  | 0 | ||||||||||||||||||||||||||||||
| 143 |             flags |= AncestorContainsChildren; never executed:  flags |= AncestorContainsChildren; | 0 | ||||||||||||||||||||||||||||||
| 144 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 145 | - | |||||||||||||||||||||||||||||||
| 146 |     if (ancestorFlags == flags
  | 0 | ||||||||||||||||||||||||||||||
| 147 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 148 | ancestorFlags = flags; | - | ||||||||||||||||||||||||||||||
| 149 | - | |||||||||||||||||||||||||||||||
| 150 | - | |||||||||||||||||||||||||||||||
| 151 |     for (int i = 0; i < children.size()
  | 0 | ||||||||||||||||||||||||||||||
| 152 |         children.at(i)->d_ptr->updateAncestorFlags(); never executed:  children.at(i)->d_ptr->updateAncestorFlags(); | 0 | ||||||||||||||||||||||||||||||
| 153 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 154 | - | |||||||||||||||||||||||||||||||
| 155 | - | |||||||||||||||||||||||||||||||
| 156 | - | |||||||||||||||||||||||||||||||
| 157 | - | |||||||||||||||||||||||||||||||
| 158 | - | |||||||||||||||||||||||||||||||
| 159 | - | |||||||||||||||||||||||||||||||
| 160 | void QGraphicsItemPrivate::setIsMemberOfGroup(bool enabled) | - | ||||||||||||||||||||||||||||||
| 161 | { | - | ||||||||||||||||||||||||||||||
| 162 | QGraphicsItem * const q = q_func(); | - | ||||||||||||||||||||||||||||||
| 163 | isMemberOfGroup = enabled; | - | ||||||||||||||||||||||||||||||
| 164 |     if (!qgraphicsitem_cast<QGraphicsItemGroup *>(q)
  | 0 | ||||||||||||||||||||||||||||||
| 165 | 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) | - | ||||||||||||||||||||||||||||||
| 166 |             child->d_func()->setIsMemberOfGroup(enabled); never executed:  child->d_func()->setIsMemberOfGroup(enabled); | 0 | ||||||||||||||||||||||||||||||
| 167 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 168 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 169 | - | |||||||||||||||||||||||||||||||
| 170 | - | |||||||||||||||||||||||||||||||
| 171 | - | |||||||||||||||||||||||||||||||
| 172 | - | |||||||||||||||||||||||||||||||
| 173 | - | |||||||||||||||||||||||||||||||
| 174 | - | |||||||||||||||||||||||||||||||
| 175 | void QGraphicsItemPrivate::remapItemPos(QEvent *event, QGraphicsItem *item) | - | ||||||||||||||||||||||||||||||
| 176 | { | - | ||||||||||||||||||||||||||||||
| 177 | QGraphicsItem * const q = q_func(); | - | ||||||||||||||||||||||||||||||
| 178 | switch (event->type()) { | - | ||||||||||||||||||||||||||||||
| 179 |     case never executed:   QEvent::GraphicsSceneMouseMove:case QEvent::GraphicsSceneMouseMove:never executed:  case QEvent::GraphicsSceneMouseMove: | 0 | ||||||||||||||||||||||||||||||
| 180 |     case never executed:   QEvent::GraphicsSceneMousePress:case QEvent::GraphicsSceneMousePress:never executed:  case QEvent::GraphicsSceneMousePress: | 0 | ||||||||||||||||||||||||||||||
| 181 |     case never executed:   QEvent::GraphicsSceneMouseRelease:case QEvent::GraphicsSceneMouseRelease:never executed:  case QEvent::GraphicsSceneMouseRelease: | 0 | ||||||||||||||||||||||||||||||
| 182 |     case never executed:   QEvent::GraphicsSceneMouseDoubleClick:case QEvent::GraphicsSceneMouseDoubleClick:never executed:   {case QEvent::GraphicsSceneMouseDoubleClick: | 0 | ||||||||||||||||||||||||||||||
| 183 | QGraphicsSceneMouseEvent *mouseEvent = static_cast<QGraphicsSceneMouseEvent *>(event); | - | ||||||||||||||||||||||||||||||
| 184 | mouseEvent->setPos(item->mapFromItem(q, mouseEvent->pos())); | - | ||||||||||||||||||||||||||||||
| 185 | mouseEvent->setLastPos(item->mapFromItem(q, mouseEvent->pos())); | - | ||||||||||||||||||||||||||||||
| 186 |         for (int i = 0x1; i <= 0x10
  | 0 | ||||||||||||||||||||||||||||||
| 187 |             if (mouseEvent->buttons() & i
  | 0 | ||||||||||||||||||||||||||||||
| 188 | Qt::MouseButton button = Qt::MouseButton(i); | - | ||||||||||||||||||||||||||||||
| 189 | mouseEvent->setButtonDownPos(button, item->mapFromItem(q, mouseEvent->buttonDownPos(button))); | - | ||||||||||||||||||||||||||||||
| 190 |             } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 191 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 192 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 193 | } | - | ||||||||||||||||||||||||||||||
| 194 |     case never executed:   QEvent::GraphicsSceneWheel:case QEvent::GraphicsSceneWheel:never executed:   {case QEvent::GraphicsSceneWheel: | 0 | ||||||||||||||||||||||||||||||
| 195 | QGraphicsSceneWheelEvent *wheelEvent = static_cast<QGraphicsSceneWheelEvent *>(event); | - | ||||||||||||||||||||||||||||||
| 196 | wheelEvent->setPos(item->mapFromItem(q, wheelEvent->pos())); | - | ||||||||||||||||||||||||||||||
| 197 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 198 | } | - | ||||||||||||||||||||||||||||||
| 199 |     case never executed:   QEvent::GraphicsSceneContextMenu:case QEvent::GraphicsSceneContextMenu:never executed:   {case QEvent::GraphicsSceneContextMenu: | 0 | ||||||||||||||||||||||||||||||
| 200 | QGraphicsSceneContextMenuEvent *contextEvent = static_cast<QGraphicsSceneContextMenuEvent *>(event); | - | ||||||||||||||||||||||||||||||
| 201 | contextEvent->setPos(item->mapFromItem(q, contextEvent->pos())); | - | ||||||||||||||||||||||||||||||
| 202 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 203 | } | - | ||||||||||||||||||||||||||||||
| 204 |     case never executed:   QEvent::GraphicsSceneHoverMove:case QEvent::GraphicsSceneHoverMove:never executed:   {case QEvent::GraphicsSceneHoverMove: | 0 | ||||||||||||||||||||||||||||||
| 205 | QGraphicsSceneHoverEvent *hoverEvent = static_cast<QGraphicsSceneHoverEvent *>(event); | - | ||||||||||||||||||||||||||||||
| 206 | hoverEvent->setPos(item->mapFromItem(q, hoverEvent->pos())); | - | ||||||||||||||||||||||||||||||
| 207 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 208 | } | - | ||||||||||||||||||||||||||||||
| 209 |     default never executed:  :default:never executed:  default: | 0 | ||||||||||||||||||||||||||||||
| 210 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 211 | } | - | ||||||||||||||||||||||||||||||
| 212 | } | - | ||||||||||||||||||||||||||||||
| 213 | QPointF QGraphicsItemPrivate::genericMapFromScene(const QPointF &pos, | - | ||||||||||||||||||||||||||||||
| 214 | const QWidget *viewport) const | - | ||||||||||||||||||||||||||||||
| 215 | { | - | ||||||||||||||||||||||||||||||
| 216 | const QGraphicsItem * const q = q_func(); | - | ||||||||||||||||||||||||||||||
| 217 |     if (!itemIsUntransformable()
  | 0 | ||||||||||||||||||||||||||||||
| 218 |         return never executed:   q->mapFromScene(pos);return q->mapFromScene(pos);never executed:  return q->mapFromScene(pos); | 0 | ||||||||||||||||||||||||||||||
| 219 | QGraphicsView *view = 0; | - | ||||||||||||||||||||||||||||||
| 220 |     if (viewport
  | 0 | ||||||||||||||||||||||||||||||
| 221 |         view = qobject_cast<QGraphicsView *>(viewport->parentWidget()); never executed:  view = qobject_cast<QGraphicsView *>(viewport->parentWidget()); | 0 | ||||||||||||||||||||||||||||||
| 222 |     if (!view
  | 0 | ||||||||||||||||||||||||||||||
| 223 |         return never executed:   q->mapFromScene(pos);return q->mapFromScene(pos);never executed:  return q->mapFromScene(pos); | 0 | ||||||||||||||||||||||||||||||
| 224 | - | |||||||||||||||||||||||||||||||
| 225 |     return never executed:   q->deviceTransform(view->viewportTransform()).inverted().map(view->mapFromScene(pos));return q->deviceTransform(view->viewportTransform()).inverted().map(view->mapFromScene(pos));never executed:  return q->deviceTransform(view->viewportTransform()).inverted().map(view->mapFromScene(pos)); | 0 | ||||||||||||||||||||||||||||||
| 226 | } | - | ||||||||||||||||||||||||||||||
| 227 | void QGraphicsItemPrivate::combineTransformToParent(QTransform *x, const QTransform *viewTransform) const | - | ||||||||||||||||||||||||||||||
| 228 | { | - | ||||||||||||||||||||||||||||||
| 229 | - | |||||||||||||||||||||||||||||||
| 230 |     if (viewTransform
 
  | 0 | ||||||||||||||||||||||||||||||
| 231 | *x = q_ptr->deviceTransform(*viewTransform); | - | ||||||||||||||||||||||||||||||
| 232 |     } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||
| 233 |         if (transformData
  | 0 | ||||||||||||||||||||||||||||||
| 234 |             * never executed:  x *= transformData->computedFullTransform();*x *= transformData->computedFullTransform();never executed:  *x *= transformData->computedFullTransform(); | 0 | ||||||||||||||||||||||||||||||
| 235 |         if (!pos.isNull()
  | 0 | ||||||||||||||||||||||||||||||
| 236 |             * 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 | ||||||||||||||||||||||||||||||
| 237 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 238 | } | - | ||||||||||||||||||||||||||||||
| 239 | void QGraphicsItemPrivate::combineTransformFromParent(QTransform *x, const QTransform *viewTransform) const | - | ||||||||||||||||||||||||||||||
| 240 | { | - | ||||||||||||||||||||||||||||||
| 241 | - | |||||||||||||||||||||||||||||||
| 242 |     if (viewTransform
 
  | 0 | ||||||||||||||||||||||||||||||
| 243 | *x = q_ptr->deviceTransform(*viewTransform); | - | ||||||||||||||||||||||||||||||
| 244 |     } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||
| 245 | x->translate(pos.x(), pos.y()); | - | ||||||||||||||||||||||||||||||
| 246 |         if (transformData
  | 0 | ||||||||||||||||||||||||||||||
| 247 |             * never executed:  x = transformData->computedFullTransform(x);*x = transformData->computedFullTransform(x);never executed:  *x = transformData->computedFullTransform(x); | 0 | ||||||||||||||||||||||||||||||
| 248 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 249 | } | - | ||||||||||||||||||||||||||||||
| 250 | - | |||||||||||||||||||||||||||||||
| 251 | void QGraphicsItemPrivate::updateSceneTransformFromParent() | - | ||||||||||||||||||||||||||||||
| 252 | { | - | ||||||||||||||||||||||||||||||
| 253 |     if (parent
  | 0 | ||||||||||||||||||||||||||||||
| 254 | ((!(!parent->d_ptr->dirtySceneTransform)) ? qt_assert("!parent->d_ptr->dirtySceneTransform",__FILE__,1046) : qt_noop()); | - | ||||||||||||||||||||||||||||||
| 255 |         if (parent->d_ptr->sceneTransformTranslateOnly
  | 0 | ||||||||||||||||||||||||||||||
| 256 | sceneTransform = QTransform::fromTranslate(parent->d_ptr->sceneTransform.dx() + pos.x(), | - | ||||||||||||||||||||||||||||||
| 257 | parent->d_ptr->sceneTransform.dy() + pos.y()); | - | ||||||||||||||||||||||||||||||
| 258 |         } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||
| 259 | sceneTransform = parent->d_ptr->sceneTransform; | - | ||||||||||||||||||||||||||||||
| 260 | sceneTransform.translate(pos.x(), pos.y()); | - | ||||||||||||||||||||||||||||||
| 261 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 262 |         if (transformData
  | 0 | ||||||||||||||||||||||||||||||
| 263 | sceneTransform = transformData->computedFullTransform(&sceneTransform); | - | ||||||||||||||||||||||||||||||
| 264 | sceneTransformTranslateOnly = (sceneTransform.type() <= QTransform::TxTranslate); | - | ||||||||||||||||||||||||||||||
| 265 |         } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||
| 266 | sceneTransformTranslateOnly = parent->d_ptr->sceneTransformTranslateOnly; | - | ||||||||||||||||||||||||||||||
| 267 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 268 |     } else if (!transformData
  | 0 | ||||||||||||||||||||||||||||||
| 269 | sceneTransform = QTransform::fromTranslate(pos.x(), pos.y()); | - | ||||||||||||||||||||||||||||||
| 270 | sceneTransformTranslateOnly = 1; | - | ||||||||||||||||||||||||||||||
| 271 |     } never executed:   else if (transformData->onlyTransformend of block
  | 0 | ||||||||||||||||||||||||||||||
| 272 | sceneTransform = transformData->transform; | - | ||||||||||||||||||||||||||||||
| 273 |         if (!pos.isNull()
  | 0 | ||||||||||||||||||||||||||||||
| 274 |             sceneTransform *= QTransform::fromTranslate(pos.x(), pos.y()); never executed:  sceneTransform *= QTransform::fromTranslate(pos.x(), pos.y()); | 0 | ||||||||||||||||||||||||||||||
| 275 | sceneTransformTranslateOnly = (sceneTransform.type() <= QTransform::TxTranslate); | - | ||||||||||||||||||||||||||||||
| 276 |     } never executed:   else if (pos.isNull()end of block
  | 0 | ||||||||||||||||||||||||||||||
| 277 | sceneTransform = transformData->computedFullTransform(); | - | ||||||||||||||||||||||||||||||
| 278 | sceneTransformTranslateOnly = (sceneTransform.type() <= QTransform::TxTranslate); | - | ||||||||||||||||||||||||||||||
| 279 |     } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||
| 280 | sceneTransform = QTransform::fromTranslate(pos.x(), pos.y()); | - | ||||||||||||||||||||||||||||||
| 281 | sceneTransform = transformData->computedFullTransform(&sceneTransform); | - | ||||||||||||||||||||||||||||||
| 282 | sceneTransformTranslateOnly = (sceneTransform.type() <= QTransform::TxTranslate); | - | ||||||||||||||||||||||||||||||
| 283 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 284 | dirtySceneTransform = 0; | - | ||||||||||||||||||||||||||||||
| 285 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 286 | void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent, const QVariant *newParentVariant, | - | ||||||||||||||||||||||||||||||
| 287 | const QVariant *thisPointerVariant) | - | ||||||||||||||||||||||||||||||
| 288 | { | - | ||||||||||||||||||||||||||||||
| 289 | QGraphicsItem * const q = q_func(); | - | ||||||||||||||||||||||||||||||
| 290 |     if (newParent == parent
  | 0 | ||||||||||||||||||||||||||||||
| 291 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 292 | - | |||||||||||||||||||||||||||||||
| 293 |     if (isWidget
  | 0 | ||||||||||||||||||||||||||||||
| 294 |         static_cast< never executed:  QGraphicsWidgetPrivate *>(this)->fixFocusChainBeforeReparenting((newParent &&static_cast<QGraphicsWidgetPrivate *>(this)->fixFocusChainBeforeReparenting((newParent && newParent->isWidget()) ? static_cast<QGraphicsWidget *>(newParent) : 0, scene);never executed:  static_cast<QGraphicsWidgetPrivate *>(this)->fixFocusChainBeforeReparenting((newParent && newParent->isWidget()) ? static_cast<QGraphicsWidget *>(newParent) : 0, scene); | 0 | ||||||||||||||||||||||||||||||
| 295 |                                                         newParent->isWidget()) ? static_cast<QGraphicsWidget *>(newParent) : 0, never executed:  static_cast<QGraphicsWidgetPrivate *>(this)->fixFocusChainBeforeReparenting((newParent && newParent->isWidget()) ? static_cast<QGraphicsWidget *>(newParent) : 0, scene); | 0 | ||||||||||||||||||||||||||||||
| 296 |                                                         scene); never executed:  static_cast<QGraphicsWidgetPrivate *>(this)->fixFocusChainBeforeReparenting((newParent && newParent->isWidget()) ? static_cast<QGraphicsWidget *>(newParent) : 0, scene); | 0 | ||||||||||||||||||||||||||||||
| 297 |     if (scene
  | 0 | ||||||||||||||||||||||||||||||
| 298 | - | |||||||||||||||||||||||||||||||
| 299 |         if (scene->d_func()->indexMethod != QGraphicsScene::NoIndex
  | 0 | ||||||||||||||||||||||||||||||
| 300 |             scene->d_func()->index->itemChange(q, QGraphicsItem::ItemParentChange, newParent); never executed:  scene->d_func()->index->itemChange(q, QGraphicsItem::ItemParentChange, newParent); | 0 | ||||||||||||||||||||||||||||||
| 301 | - | |||||||||||||||||||||||||||||||
| 302 | - | |||||||||||||||||||||||||||||||
| 303 |         if (scenePosDescendants
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 304 |             scene->d_func()->setScenePosItemEnabled(q, false); never executed:  scene->d_func()->setScenePosItemEnabled(q, false); | 0 | ||||||||||||||||||||||||||||||
| 305 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 306 | - | |||||||||||||||||||||||||||||||
| 307 |     if (subFocusItem
 
  | 0 | ||||||||||||||||||||||||||||||
| 308 | - | |||||||||||||||||||||||||||||||
| 309 | subFocusItem->d_ptr->clearSubFocus(parent); | - | ||||||||||||||||||||||||||||||
| 310 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 311 | - | |||||||||||||||||||||||||||||||
| 312 | - | |||||||||||||||||||||||||||||||
| 313 | - | |||||||||||||||||||||||||||||||
| 314 | - | |||||||||||||||||||||||||||||||
| 315 |     if (!inDestructor
  | 0 | ||||||||||||||||||||||||||||||
| 316 |         q_ptr->prepareGeometryChange(); never executed:  q_ptr->prepareGeometryChange(); | 0 | ||||||||||||||||||||||||||||||
| 317 | - | |||||||||||||||||||||||||||||||
| 318 |     if (parent
  | 0 | ||||||||||||||||||||||||||||||
| 319 | - | |||||||||||||||||||||||||||||||
| 320 | parent->d_ptr->removeChild(q); | - | ||||||||||||||||||||||||||||||
| 321 |         if (thisPointerVariant
  | 0 | ||||||||||||||||||||||||||||||
| 322 |             parent->itemChange(QGraphicsItem::ItemChildRemovedChange, *thisPointerVariant); never executed:  parent->itemChange(QGraphicsItem::ItemChildRemovedChange, *thisPointerVariant); | 0 | ||||||||||||||||||||||||||||||
| 323 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 324 | - | |||||||||||||||||||||||||||||||
| 325 | - | |||||||||||||||||||||||||||||||
| 326 | - | |||||||||||||||||||||||||||||||
| 327 |     if (scene
 
  | 0 | ||||||||||||||||||||||||||||||
| 328 |         if (parent
 
  | 0 | ||||||||||||||||||||||||||||||
| 329 | scene->d_func()->registerTopLevelItem(q); | - | ||||||||||||||||||||||||||||||
| 330 |         } never executed:   else if (!parentend of block
 
  | 0 | ||||||||||||||||||||||||||||||
| 331 | scene->d_func()->unregisterTopLevelItem(q); | - | ||||||||||||||||||||||||||||||
| 332 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 333 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 334 | - | |||||||||||||||||||||||||||||||
| 335 | - | |||||||||||||||||||||||||||||||
| 336 | - | |||||||||||||||||||||||||||||||
| 337 | QGraphicsItem *p = parent; | - | ||||||||||||||||||||||||||||||
| 338 | QGraphicsItem *parentFocusScopeItem = 0; | - | ||||||||||||||||||||||||||||||
| 339 |     while (p
  | 0 | ||||||||||||||||||||||||||||||
| 340 |         if (p->d_ptr->flags & QGraphicsItem::ItemIsFocusScope
  | 0 | ||||||||||||||||||||||||||||||
| 341 | - | |||||||||||||||||||||||||||||||
| 342 | - | |||||||||||||||||||||||||||||||
| 343 | QGraphicsItem *fsi = p->d_ptr->focusScopeItem; | - | ||||||||||||||||||||||||||||||
| 344 |             if (q_ptr == fsi
 
  | 0 | ||||||||||||||||||||||||||||||
| 345 | parentFocusScopeItem = fsi; | - | ||||||||||||||||||||||||||||||
| 346 | p->d_ptr->focusScopeItem = 0; | - | ||||||||||||||||||||||||||||||
| 347 | fsi->d_ptr->focusScopeItemChange(false); | - | ||||||||||||||||||||||||||||||
| 348 |             } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 349 |             break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 350 | } | - | ||||||||||||||||||||||||||||||
| 351 | p = p->d_ptr->parent; | - | ||||||||||||||||||||||||||||||
| 352 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 353 | - | |||||||||||||||||||||||||||||||
| 354 | - | |||||||||||||||||||||||||||||||
| 355 |     if (newParent
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 356 |         newParent->d_ptr->updateChildWithGraphicsEffectFlagRecursively(); never executed:  newParent->d_ptr->updateChildWithGraphicsEffectFlagRecursively(); | 0 | ||||||||||||||||||||||||||||||
| 357 | - | |||||||||||||||||||||||||||||||
| 358 | - | |||||||||||||||||||||||||||||||
| 359 |     QGraphicsItem *newFocusScopeItem = subFocusItem
  | 0 | ||||||||||||||||||||||||||||||
| 360 |     if (newFocusScopeItem
 
  | 0 | ||||||||||||||||||||||||||||||
| 361 | QGraphicsItem *p = newParent; | - | ||||||||||||||||||||||||||||||
| 362 |         while (p
  | 0 | ||||||||||||||||||||||||||||||
| 363 |             if (p->d_ptr->flags & QGraphicsItem::ItemIsFocusScope
  | 0 | ||||||||||||||||||||||||||||||
| 364 |                 if (subFocusItem
 
  | 0 | ||||||||||||||||||||||||||||||
| 365 | - | |||||||||||||||||||||||||||||||
| 366 | QGraphicsItem *ancestorScope = 0; | - | ||||||||||||||||||||||||||||||
| 367 | QGraphicsItem *p2 = subFocusItem->d_ptr->parent; | - | ||||||||||||||||||||||||||||||
| 368 |                     while (p2
 
  | 0 | ||||||||||||||||||||||||||||||
| 369 |                         if (p2->d_ptr->flags & QGraphicsItem::ItemIsFocusScope
  | 0 | ||||||||||||||||||||||||||||||
| 370 |                             ancestorScope = p2; never executed:  ancestorScope = p2; | 0 | ||||||||||||||||||||||||||||||
| 371 |                         if (p2->d_ptr->flags & QGraphicsItem::ItemIsPanel
  | 0 | ||||||||||||||||||||||||||||||
| 372 |                             break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 373 |                         if (p2 == q_ptr
  | 0 | ||||||||||||||||||||||||||||||
| 374 |                             break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 375 | p2 = p2->d_ptr->parent; | - | ||||||||||||||||||||||||||||||
| 376 |                     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 377 |                     if (ancestorScope
  | 0 | ||||||||||||||||||||||||||||||
| 378 |                         newFocusScopeItem = ancestorScope; never executed:  newFocusScopeItem = ancestorScope; | 0 | ||||||||||||||||||||||||||||||
| 379 |                 } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 380 | - | |||||||||||||||||||||||||||||||
| 381 | p->d_ptr->focusScopeItem = newFocusScopeItem; | - | ||||||||||||||||||||||||||||||
| 382 | newFocusScopeItem->d_ptr->focusScopeItemChange(true); | - | ||||||||||||||||||||||||||||||
| 383 | - | |||||||||||||||||||||||||||||||
| 384 | - | |||||||||||||||||||||||||||||||
| 385 | - | |||||||||||||||||||||||||||||||
| 386 |                 if (subFocusItem
 
  | 0 | ||||||||||||||||||||||||||||||
| 387 |                     subFocusItem->d_ptr->clearSubFocus(); never executed:  subFocusItem->d_ptr->clearSubFocus(); | 0 | ||||||||||||||||||||||||||||||
| 388 |                 break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 389 | } | - | ||||||||||||||||||||||||||||||
| 390 | p = p->d_ptr->parent; | - | ||||||||||||||||||||||||||||||
| 391 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 392 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 393 | - | |||||||||||||||||||||||||||||||
| 394 | - | |||||||||||||||||||||||||||||||
| 395 | invalidateDepthRecursively(); | - | ||||||||||||||||||||||||||||||
| 396 | - | |||||||||||||||||||||||||||||||
| 397 |     if ((
 
  | 0 | ||||||||||||||||||||||||||||||
| 398 |         if (parent->d_func()->scene
 
  | 0 | ||||||||||||||||||||||||||||||
| 399 | - | |||||||||||||||||||||||||||||||
| 400 | parent->d_func()->scene->addItem(q); | - | ||||||||||||||||||||||||||||||
| 401 |         } never executed:   else if (!parent->d_func()->sceneend of block
 
  | 0 | ||||||||||||||||||||||||||||||
| 402 | - | |||||||||||||||||||||||||||||||
| 403 | scene->removeItem(q); | - | ||||||||||||||||||||||||||||||
| 404 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 405 | - | |||||||||||||||||||||||||||||||
| 406 | parent->d_ptr->addChild(q); | - | ||||||||||||||||||||||||||||||
| 407 |         if (thisPointerVariant
  | 0 | ||||||||||||||||||||||||||||||
| 408 |             parent->itemChange(QGraphicsItem::ItemChildAddedChange, *thisPointerVariant); never executed:  parent->itemChange(QGraphicsItem::ItemChildAddedChange, *thisPointerVariant); | 0 | ||||||||||||||||||||||||||||||
| 409 |         if (scene
  | 0 | ||||||||||||||||||||||||||||||
| 410 | - | |||||||||||||||||||||||||||||||
| 411 |             if (scenePosDescendants
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 412 |                 scene->d_func()->setScenePosItemEnabled(q, true); never executed:  scene->d_func()->setScenePosItemEnabled(q, true); | 0 | ||||||||||||||||||||||||||||||
| 413 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 414 | - | |||||||||||||||||||||||||||||||
| 415 | - | |||||||||||||||||||||||||||||||
| 416 | markParentDirty( true); | - | ||||||||||||||||||||||||||||||
| 417 | - | |||||||||||||||||||||||||||||||
| 418 | - | |||||||||||||||||||||||||||||||
| 419 | updateAncestorFlags(); | - | ||||||||||||||||||||||||||||||
| 420 | - | |||||||||||||||||||||||||||||||
| 421 | - | |||||||||||||||||||||||||||||||
| 422 |         if (parent->d_ptr->visible != visible
  | 0 | ||||||||||||||||||||||||||||||
| 423 |             if (!parent->d_ptr->visible
 
  | 0 | ||||||||||||||||||||||||||||||
| 424 |                 setVisibleHelper(parent->d_ptr->visible, false, false); never executed:  setVisibleHelper(parent->d_ptr->visible, false, false); | 0 | ||||||||||||||||||||||||||||||
| 425 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 426 |         if (parent->isEnabled() != enabled
  | 0 | ||||||||||||||||||||||||||||||
| 427 |             if (!parent->d_ptr->enabled
 
  | 0 | ||||||||||||||||||||||||||||||
| 428 |                 setEnabledHelper(parent->d_ptr->enabled, false, false); never executed:  setEnabledHelper(parent->d_ptr->enabled, false, false); | 0 | ||||||||||||||||||||||||||||||
| 429 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 430 | - | |||||||||||||||||||||||||||||||
| 431 | - | |||||||||||||||||||||||||||||||
| 432 |         if (visible
 
  | 0 | ||||||||||||||||||||||||||||||
| 433 |             q->setActive(true); never executed:  q->setActive(true); | 0 | ||||||||||||||||||||||||||||||
| 434 |     } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||
| 435 | - | |||||||||||||||||||||||||||||||
| 436 | updateAncestorFlags(); | - | ||||||||||||||||||||||||||||||
| 437 | - | |||||||||||||||||||||||||||||||
| 438 |         if (!inDestructor
  | 0 | ||||||||||||||||||||||||||||||
| 439 | - | |||||||||||||||||||||||||||||||
| 440 |             if (!visible
 
  | 0 | ||||||||||||||||||||||||||||||
| 441 |                 setVisibleHelper(true, false); never executed:  setVisibleHelper(true, false); | 0 | ||||||||||||||||||||||||||||||
| 442 |             if (!enabled
 
  | 0 | ||||||||||||||||||||||||||||||
| 443 |                 setEnabledHelper(true, false); never executed:  setEnabledHelper(true, false); | 0 | ||||||||||||||||||||||||||||||
| 444 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 445 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 446 | - | |||||||||||||||||||||||||||||||
| 447 | dirtySceneTransform = 1; | - | ||||||||||||||||||||||||||||||
| 448 |     if (!inDestructor
 
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 449 |         transformChanged(); never executed:  transformChanged(); | 0 | ||||||||||||||||||||||||||||||
| 450 | - | |||||||||||||||||||||||||||||||
| 451 | - | |||||||||||||||||||||||||||||||
| 452 |     if (subFocusItem
  | 0 | ||||||||||||||||||||||||||||||
| 453 | subFocusItem->d_ptr->setSubFocus(newParent); | - | ||||||||||||||||||||||||||||||
| 454 |         if (parent
 
  | 0 | ||||||||||||||||||||||||||||||
| 455 |             subFocusItem->setFocus(); never executed:  subFocusItem->setFocus(); | 0 | ||||||||||||||||||||||||||||||
| 456 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 457 | - | |||||||||||||||||||||||||||||||
| 458 | - | |||||||||||||||||||||||||||||||
| 459 |     if (newParentVariant
  | 0 | ||||||||||||||||||||||||||||||
| 460 |         q->itemChange(QGraphicsItem::ItemParentHasChanged, *newParentVariant); never executed:  q->itemChange(QGraphicsItem::ItemParentHasChanged, *newParentVariant); | 0 | ||||||||||||||||||||||||||||||
| 461 | - | |||||||||||||||||||||||||||||||
| 462 |     if (isObject
  | 0 | ||||||||||||||||||||||||||||||
| 463 |         static_cast< never executed:  QGraphicsObject *>(q)->parentChanged();static_cast<QGraphicsObject *>(q)->parentChanged();never executed:  static_cast<QGraphicsObject *>(q)->parentChanged(); | 0 | ||||||||||||||||||||||||||||||
| 464 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 465 | - | |||||||||||||||||||||||||||||||
| 466 | - | |||||||||||||||||||||||||||||||
| 467 | - | |||||||||||||||||||||||||||||||
| 468 | - | |||||||||||||||||||||||||||||||
| 469 | - | |||||||||||||||||||||||||||||||
| 470 | - | |||||||||||||||||||||||||||||||
| 471 | void QGraphicsItemPrivate::childrenBoundingRectHelper(QTransform *x, QRectF *rect, QGraphicsItem *topMostEffectItem) | - | ||||||||||||||||||||||||||||||
| 472 | { | - | ||||||||||||||||||||||||||||||
| 473 | QGraphicsItem * const q = q_func(); | - | ||||||||||||||||||||||||||||||
| 474 | - | |||||||||||||||||||||||||||||||
| 475 | QRectF childrenRect; | - | ||||||||||||||||||||||||||||||
| 476 | QRectF *result = rect; | - | ||||||||||||||||||||||||||||||
| 477 | rect = &childrenRect; | - | ||||||||||||||||||||||||||||||
| 478 | const bool setTopMostEffectItem = !topMostEffectItem; | - | ||||||||||||||||||||||||||||||
| 479 | - | |||||||||||||||||||||||||||||||
| 480 |     for (int i = 0; i < children.size()
  | 0 | ||||||||||||||||||||||||||||||
| 481 | QGraphicsItem *child = children.at(i); | - | ||||||||||||||||||||||||||||||
| 482 | QGraphicsItemPrivate *childd = child->d_ptr.data(); | - | ||||||||||||||||||||||||||||||
| 483 |         if (setTopMostEffectItem
  | 0 | ||||||||||||||||||||||||||||||
| 484 |             topMostEffectItem = child; never executed:  topMostEffectItem = child; | 0 | ||||||||||||||||||||||||||||||
| 485 | bool hasPos = !childd->pos.isNull(); | - | ||||||||||||||||||||||||||||||
| 486 |         if (hasPos
 
  | 0 | ||||||||||||||||||||||||||||||
| 487 | - | |||||||||||||||||||||||||||||||
| 488 | QTransform matrix = childd->transformToParent(); | - | ||||||||||||||||||||||||||||||
| 489 |             if (x
  | 0 | ||||||||||||||||||||||||||||||
| 490 |                 matrix *= *x; never executed:  matrix *= *x; | 0 | ||||||||||||||||||||||||||||||
| 491 | *rect |= matrix.mapRect(child->d_ptr->effectiveBoundingRect(topMostEffectItem)); | - | ||||||||||||||||||||||||||||||
| 492 |             if (!childd->children.isEmpty()
  | 0 | ||||||||||||||||||||||||||||||
| 493 |                 childd->childrenBoundingRectHelper(&matrix, rect, topMostEffectItem); never executed:  childd->childrenBoundingRectHelper(&matrix, rect, topMostEffectItem); | 0 | ||||||||||||||||||||||||||||||
| 494 |         } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||
| 495 |             if (x
  | 0 | ||||||||||||||||||||||||||||||
| 496 |                 * 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 | ||||||||||||||||||||||||||||||
| 497 | else | - | ||||||||||||||||||||||||||||||
| 498 |                 * never executed:  rect |= child->d_ptr->effectiveBoundingRect(topMostEffectItem);*rect |= child->d_ptr->effectiveBoundingRect(topMostEffectItem);never executed:  *rect |= child->d_ptr->effectiveBoundingRect(topMostEffectItem); | 0 | ||||||||||||||||||||||||||||||
| 499 |             if (!childd->children.isEmpty()
  | 0 | ||||||||||||||||||||||||||||||
| 500 |                 childd->childrenBoundingRectHelper(x, rect, topMostEffectItem); never executed:  childd->childrenBoundingRectHelper(x, rect, topMostEffectItem); | 0 | ||||||||||||||||||||||||||||||
| 501 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 502 | } | - | ||||||||||||||||||||||||||||||
| 503 | - | |||||||||||||||||||||||||||||||
| 504 |     if (flags & QGraphicsItem::ItemClipsChildrenToShape
  | 0 | ||||||||||||||||||||||||||||||
| 505 |         if (x
  | 0 | ||||||||||||||||||||||||||||||
| 506 |             * never executed:  rect &= x->mapRect(q->boundingRect());*rect &= x->mapRect(q->boundingRect());never executed:  *rect &= x->mapRect(q->boundingRect()); | 0 | ||||||||||||||||||||||||||||||
| 507 | else | - | ||||||||||||||||||||||||||||||
| 508 |             * never executed:  rect &= q->boundingRect();*rect &= q->boundingRect();never executed:  *rect &= q->boundingRect(); | 0 | ||||||||||||||||||||||||||||||
| 509 | } | - | ||||||||||||||||||||||||||||||
| 510 | - | |||||||||||||||||||||||||||||||
| 511 | *result |= *rect; | - | ||||||||||||||||||||||||||||||
| 512 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 513 | - | |||||||||||||||||||||||||||||||
| 514 | void QGraphicsItemPrivate::initStyleOption(QStyleOptionGraphicsItem *option, const QTransform &worldTransform, | - | ||||||||||||||||||||||||||||||
| 515 | const QRegion &exposedRegion, bool allItems) const | - | ||||||||||||||||||||||||||||||
| 516 | { | - | ||||||||||||||||||||||||||||||
| 517 | ((!(option)) ? qt_assert("option",__FILE__,1317) : qt_noop()); | - | ||||||||||||||||||||||||||||||
| 518 | const QGraphicsItem * const q = q_func(); | - | ||||||||||||||||||||||||||||||
| 519 | - | |||||||||||||||||||||||||||||||
| 520 | - | |||||||||||||||||||||||||||||||
| 521 | const QRectF brect = q->boundingRect(); | - | ||||||||||||||||||||||||||||||
| 522 | option->state = QStyle::State_None; | - | ||||||||||||||||||||||||||||||
| 523 | option->rect = brect.toRect(); | - | ||||||||||||||||||||||||||||||
| 524 | option->levelOfDetail = 1; | - | ||||||||||||||||||||||||||||||
| 525 | option->exposedRect = brect; | - | ||||||||||||||||||||||||||||||
| 526 | - | |||||||||||||||||||||||||||||||
| 527 | - | |||||||||||||||||||||||||||||||
| 528 | - | |||||||||||||||||||||||||||||||
| 529 | - | |||||||||||||||||||||||||||||||
| 530 | option->styleObject = q_ptr->toGraphicsObject(); | - | ||||||||||||||||||||||||||||||
| 531 |     if (!option->styleObject
  | 0 | ||||||||||||||||||||||||||||||
| 532 |         option->styleObject = scene; never executed:  option->styleObject = scene; | 0 | ||||||||||||||||||||||||||||||
| 533 | - | |||||||||||||||||||||||||||||||
| 534 |     if (selected
  | 0 | ||||||||||||||||||||||||||||||
| 535 |         option->state |= QStyle::State_Selected; never executed:  option->state |= QStyle::State_Selected; | 0 | ||||||||||||||||||||||||||||||
| 536 |     if (enabled
  | 0 | ||||||||||||||||||||||||||||||
| 537 |         option->state |= QStyle::State_Enabled; never executed:  option->state |= QStyle::State_Enabled; | 0 | ||||||||||||||||||||||||||||||
| 538 |     if (q->hasFocus()
  | 0 | ||||||||||||||||||||||||||||||
| 539 |         option->state |= QStyle::State_HasFocus; never executed:  option->state |= QStyle::State_HasFocus; | 0 | ||||||||||||||||||||||||||||||
| 540 |     if (scene
  | 0 | ||||||||||||||||||||||||||||||
| 541 |         if (scene->d_func()->hoverItems.contains(q_ptr)
  | 0 | ||||||||||||||||||||||||||||||
| 542 |             option->state |= QStyle::State_MouseOver; never executed:  option->state |= QStyle::State_MouseOver; | 0 | ||||||||||||||||||||||||||||||
| 543 |         if (q == scene->mouseGrabberItem()
  | 0 | ||||||||||||||||||||||||||||||
| 544 |             option->state |= QStyle::State_Sunken; never executed:  option->state |= QStyle::State_Sunken; | 0 | ||||||||||||||||||||||||||||||
| 545 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 546 | - | |||||||||||||||||||||||||||||||
| 547 |     if (!(flags & QGraphicsItem::ItemUsesExtendedStyleOption)
  | 0 | ||||||||||||||||||||||||||||||
| 548 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 549 | - | |||||||||||||||||||||||||||||||
| 550 | - | |||||||||||||||||||||||||||||||
| 551 | option->matrix = worldTransform.toAffine(); | - | ||||||||||||||||||||||||||||||
| 552 | - | |||||||||||||||||||||||||||||||
| 553 |     if (!allItems
  | 0 | ||||||||||||||||||||||||||||||
| 554 | - | |||||||||||||||||||||||||||||||
| 555 | option->exposedRect = QRectF(); | - | ||||||||||||||||||||||||||||||
| 556 | const QTransform reverseMap = worldTransform.inverted(); | - | ||||||||||||||||||||||||||||||
| 557 | const QVector<QRect> exposedRects(exposedRegion.rects()); | - | ||||||||||||||||||||||||||||||
| 558 |         for (int i = 0; i < exposedRects.size()
  | 0 | ||||||||||||||||||||||||||||||
| 559 | option->exposedRect |= reverseMap.mapRect(QRectF(exposedRects.at(i))); | - | ||||||||||||||||||||||||||||||
| 560 |             if (option->exposedRect.contains(brect)
  | 0 | ||||||||||||||||||||||||||||||
| 561 |                 break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 562 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 563 | option->exposedRect &= brect; | - | ||||||||||||||||||||||||||||||
| 564 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 565 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 566 | - | |||||||||||||||||||||||||||||||
| 567 | - | |||||||||||||||||||||||||||||||
| 568 | - | |||||||||||||||||||||||||||||||
| 569 | - | |||||||||||||||||||||||||||||||
| 570 | - | |||||||||||||||||||||||||||||||
| 571 | - | |||||||||||||||||||||||||||||||
| 572 | void QGraphicsItemCache::purge() | - | ||||||||||||||||||||||||||||||
| 573 | { | - | ||||||||||||||||||||||||||||||
| 574 | QPixmapCache::remove(key); | - | ||||||||||||||||||||||||||||||
| 575 | key = QPixmapCache::Key(); | - | ||||||||||||||||||||||||||||||
| 576 | QMutableHashIterator<QPaintDevice *, DeviceData> it(deviceData); | - | ||||||||||||||||||||||||||||||
| 577 |     while (it.hasNext()
  | 0 | ||||||||||||||||||||||||||||||
| 578 | DeviceData &data = it.next().value(); | - | ||||||||||||||||||||||||||||||
| 579 | QPixmapCache::remove(data.key); | - | ||||||||||||||||||||||||||||||
| 580 | data.cacheIndent = QPoint(); | - | ||||||||||||||||||||||||||||||
| 581 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 582 | deviceData.clear(); | - | ||||||||||||||||||||||||||||||
| 583 | allExposed = true; | - | ||||||||||||||||||||||||||||||
| 584 | exposed.clear(); | - | ||||||||||||||||||||||||||||||
| 585 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 586 | QGraphicsItem::QGraphicsItem(QGraphicsItem *parent) | - | ||||||||||||||||||||||||||||||
| 587 | : d_ptr(new QGraphicsItemPrivate) | - | ||||||||||||||||||||||||||||||
| 588 | { | - | ||||||||||||||||||||||||||||||
| 589 | d_ptr->q_ptr = this; | - | ||||||||||||||||||||||||||||||
| 590 | setParentItem(parent); | - | ||||||||||||||||||||||||||||||
| 591 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 592 | - | |||||||||||||||||||||||||||||||
| 593 | - | |||||||||||||||||||||||||||||||
| 594 | - | |||||||||||||||||||||||||||||||
| 595 | - | |||||||||||||||||||||||||||||||
| 596 | QGraphicsItem::QGraphicsItem(QGraphicsItemPrivate &dd, QGraphicsItem *parent) | - | ||||||||||||||||||||||||||||||
| 597 | : d_ptr(&dd) | - | ||||||||||||||||||||||||||||||
| 598 | { | - | ||||||||||||||||||||||||||||||
| 599 | d_ptr->q_ptr = this; | - | ||||||||||||||||||||||||||||||
| 600 | setParentItem(parent); | - | ||||||||||||||||||||||||||||||
| 601 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 602 | QGraphicsItem::~QGraphicsItem() | - | ||||||||||||||||||||||||||||||
| 603 | { | - | ||||||||||||||||||||||||||||||
| 604 |     if (d_ptr->isObject
  | 0 | ||||||||||||||||||||||||||||||
| 605 | QGraphicsObject *o = static_cast<QGraphicsObject *>(this); | - | ||||||||||||||||||||||||||||||
| 606 | QObjectPrivate *p = QObjectPrivate::get(o); | - | ||||||||||||||||||||||||||||||
| 607 | p->wasDeleted = true; | - | ||||||||||||||||||||||||||||||
| 608 |         if (p->declarativeData
  | 0 | ||||||||||||||||||||||||||||||
| 609 |             if (static_cast<
 
  | 0 | ||||||||||||||||||||||||||||||
| 610 |                 if (QAbstractDeclarativeData::destroyed_qml1
  | 0 | ||||||||||||||||||||||||||||||
| 611 |                     QAbstractDeclarativeData::destroyed_qml1(p->declarativeData, o); never executed:  QAbstractDeclarativeData::destroyed_qml1(p->declarativeData, o); | 0 | ||||||||||||||||||||||||||||||
| 612 |             } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||
| 613 |                 if (QAbstractDeclarativeData::destroyed
  | 0 | ||||||||||||||||||||||||||||||
| 614 |                     QAbstractDeclarativeData::destroyed(p->declarativeData, o); never executed:  QAbstractDeclarativeData::destroyed(p->declarativeData, o); | 0 | ||||||||||||||||||||||||||||||
| 615 |             } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 616 | p->declarativeData = 0; | - | ||||||||||||||||||||||||||||||
| 617 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 618 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 619 | - | |||||||||||||||||||||||||||||||
| 620 | d_ptr->inDestructor = 1; | - | ||||||||||||||||||||||||||||||
| 621 | d_ptr->removeExtraItemCache(); | - | ||||||||||||||||||||||||||||||
| 622 | - | |||||||||||||||||||||||||||||||
| 623 | - | |||||||||||||||||||||||||||||||
| 624 |     if (d_ptr->isObject
 
  | 0 | ||||||||||||||||||||||||||||||
| 625 | QGraphicsObject *o = static_cast<QGraphicsObject *>(this); | - | ||||||||||||||||||||||||||||||
| 626 |         if (QGestureManager *manager = QGestureManager::instance()
  | 0 | ||||||||||||||||||||||||||||||
| 627 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(d_ptr->gestureContext.keys())>::type> _container_((d_ptr->gestureContext.keys())); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (Qt::GestureType type = *_container_.i; _container_.control; _container_.control = 0) | - | ||||||||||||||||||||||||||||||
| 628 |                 manager->cleanupCachedGestures(o, type); never executed:  manager->cleanupCachedGestures(o, type); | 0 | ||||||||||||||||||||||||||||||
| 629 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 630 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 631 | - | |||||||||||||||||||||||||||||||
| 632 | - | |||||||||||||||||||||||||||||||
| 633 | clearFocus(); | - | ||||||||||||||||||||||||||||||
| 634 | setFocusProxy(0); | - | ||||||||||||||||||||||||||||||
| 635 | - | |||||||||||||||||||||||||||||||
| 636 | - | |||||||||||||||||||||||||||||||
| 637 | QGraphicsItem *p = d_ptr->parent; | - | ||||||||||||||||||||||||||||||
| 638 |     while (p
  | 0 | ||||||||||||||||||||||||||||||
| 639 |         if (p->flags() & ItemIsFocusScope
  | 0 | ||||||||||||||||||||||||||||||
| 640 |             if (p->d_ptr->focusScopeItem == this
  | 0 | ||||||||||||||||||||||||||||||
| 641 |                 p->d_ptr->focusScopeItem = 0; never executed:  p->d_ptr->focusScopeItem = 0; | 0 | ||||||||||||||||||||||||||||||
| 642 |             break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 643 | } | - | ||||||||||||||||||||||||||||||
| 644 | p = p->d_ptr->parent; | - | ||||||||||||||||||||||||||||||
| 645 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 646 | - | |||||||||||||||||||||||||||||||
| 647 |     if (!d_ptr->children.isEmpty()
  | 0 | ||||||||||||||||||||||||||||||
| 648 |         while (!d_ptr->children.isEmpty()
  | 0 | ||||||||||||||||||||||||||||||
| 649 |             delete d_ptr->children.first(); never executed:  delete d_ptr->children.first(); | 0 | ||||||||||||||||||||||||||||||
| 650 | ((!(d_ptr->children.isEmpty())) ? qt_assert("d_ptr->children.isEmpty()",__FILE__,1469) : qt_noop()); | - | ||||||||||||||||||||||||||||||
| 651 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 652 | - | |||||||||||||||||||||||||||||||
| 653 |     if (d_ptr->scene
  | 0 | ||||||||||||||||||||||||||||||
| 654 | d_ptr->scene->d_func()->removeItemHelper(this); | - | ||||||||||||||||||||||||||||||
| 655 |     } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||
| 656 | d_ptr->resetFocusProxy(); | - | ||||||||||||||||||||||||||||||
| 657 | setParentItem(0); | - | ||||||||||||||||||||||||||||||
| 658 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 659 | - | |||||||||||||||||||||||||||||||
| 660 | - | |||||||||||||||||||||||||||||||
| 661 | delete d_ptr->graphicsEffect; | - | ||||||||||||||||||||||||||||||
| 662 | - | |||||||||||||||||||||||||||||||
| 663 |     if (d_ptr->transformData
  | 0 | ||||||||||||||||||||||||||||||
| 664 |         for(int i = 0; i < d_ptr->transformData->graphicsTransforms.size()
  | 0 | ||||||||||||||||||||||||||||||
| 665 | QGraphicsTransform *t = d_ptr->transformData->graphicsTransforms.at(i); | - | ||||||||||||||||||||||||||||||
| 666 | static_cast<QGraphicsTransformPrivate *>(t->d_ptr.data())->item = 0; | - | ||||||||||||||||||||||||||||||
| 667 | delete t; | - | ||||||||||||||||||||||||||||||
| 668 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 669 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 670 | delete d_ptr->transformData; | - | ||||||||||||||||||||||||||||||
| 671 | - | |||||||||||||||||||||||||||||||
| 672 |     if (QGraphicsItemCustomDataStore *dataStore = qt_dataStore()
  | 0 | ||||||||||||||||||||||||||||||
| 673 |         dataStore->data.remove(this); never executed:  dataStore->data.remove(this); | 0 | ||||||||||||||||||||||||||||||
| 674 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 675 | - | |||||||||||||||||||||||||||||||
| 676 | - | |||||||||||||||||||||||||||||||
| 677 | - | |||||||||||||||||||||||||||||||
| 678 | - | |||||||||||||||||||||||||||||||
| 679 | - | |||||||||||||||||||||||||||||||
| 680 | - | |||||||||||||||||||||||||||||||
| 681 | - | |||||||||||||||||||||||||||||||
| 682 | QGraphicsScene *QGraphicsItem::scene() const | - | ||||||||||||||||||||||||||||||
| 683 | { | - | ||||||||||||||||||||||||||||||
| 684 |     return never executed:   d_ptr->scene;return d_ptr->scene;never executed:  return d_ptr->scene; | 0 | ||||||||||||||||||||||||||||||
| 685 | } | - | ||||||||||||||||||||||||||||||
| 686 | - | |||||||||||||||||||||||||||||||
| 687 | - | |||||||||||||||||||||||||||||||
| 688 | - | |||||||||||||||||||||||||||||||
| 689 | - | |||||||||||||||||||||||||||||||
| 690 | - | |||||||||||||||||||||||||||||||
| 691 | - | |||||||||||||||||||||||||||||||
| 692 | - | |||||||||||||||||||||||||||||||
| 693 | QGraphicsItemGroup *QGraphicsItem::group() const | - | ||||||||||||||||||||||||||||||
| 694 | { | - | ||||||||||||||||||||||||||||||
| 695 |     if (!d_ptr->isMemberOfGroup
  | 0 | ||||||||||||||||||||||||||||||
| 696 |         return never executed:   0;return 0;never executed:  return 0; | 0 | ||||||||||||||||||||||||||||||
| 697 | QGraphicsItem *parent = const_cast<QGraphicsItem *>(this); | - | ||||||||||||||||||||||||||||||
| 698 |     while ((
 
  | 0 | ||||||||||||||||||||||||||||||
| 699 |         if (QGraphicsItemGroup *group = qgraphicsitem_cast<QGraphicsItemGroup *>(parent)
  | 0 | ||||||||||||||||||||||||||||||
| 700 |             return never executed:   group;return group;never executed:  return group; | 0 | ||||||||||||||||||||||||||||||
| 701 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 702 | - | |||||||||||||||||||||||||||||||
| 703 | - | |||||||||||||||||||||||||||||||
| 704 |     return never executed:   0;return 0;never executed:  return 0; | 0 | ||||||||||||||||||||||||||||||
| 705 | } | - | ||||||||||||||||||||||||||||||
| 706 | void QGraphicsItem::setGroup(QGraphicsItemGroup *group) | - | ||||||||||||||||||||||||||||||
| 707 | { | - | ||||||||||||||||||||||||||||||
| 708 |     if (!group
  | 0 | ||||||||||||||||||||||||||||||
| 709 |         if (QGraphicsItemGroup *group = this->group()
  | 0 | ||||||||||||||||||||||||||||||
| 710 |             group->removeFromGroup(this); never executed:  group->removeFromGroup(this); | 0 | ||||||||||||||||||||||||||||||
| 711 |     } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||
| 712 | group->addToGroup(this); | - | ||||||||||||||||||||||||||||||
| 713 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 714 | } | - | ||||||||||||||||||||||||||||||
| 715 | - | |||||||||||||||||||||||||||||||
| 716 | - | |||||||||||||||||||||||||||||||
| 717 | - | |||||||||||||||||||||||||||||||
| 718 | - | |||||||||||||||||||||||||||||||
| 719 | - | |||||||||||||||||||||||||||||||
| 720 | - | |||||||||||||||||||||||||||||||
| 721 | - | |||||||||||||||||||||||||||||||
| 722 | QGraphicsItem *QGraphicsItem::parentItem() const | - | ||||||||||||||||||||||||||||||
| 723 | { | - | ||||||||||||||||||||||||||||||
| 724 |     return never executed:   d_ptr->parent;return d_ptr->parent;never executed:  return d_ptr->parent; | 0 | ||||||||||||||||||||||||||||||
| 725 | } | - | ||||||||||||||||||||||||||||||
| 726 | QGraphicsItem *QGraphicsItem::topLevelItem() const | - | ||||||||||||||||||||||||||||||
| 727 | { | - | ||||||||||||||||||||||||||||||
| 728 | QGraphicsItem *parent = const_cast<QGraphicsItem *>(this); | - | ||||||||||||||||||||||||||||||
| 729 |     while (QGraphicsItem *grandPa = parent->parentItem()
  | 0 | ||||||||||||||||||||||||||||||
| 730 |         parent = grandPa; never executed:  parent = grandPa; | 0 | ||||||||||||||||||||||||||||||
| 731 |     return never executed:   parent;return parent;never executed:  return parent; | 0 | ||||||||||||||||||||||||||||||
| 732 | } | - | ||||||||||||||||||||||||||||||
| 733 | QGraphicsObject *QGraphicsItem::parentObject() const | - | ||||||||||||||||||||||||||||||
| 734 | { | - | ||||||||||||||||||||||||||||||
| 735 | QGraphicsItem *p = d_ptr->parent; | - | ||||||||||||||||||||||||||||||
| 736 |     return never executed:   (preturn (p && p->d_ptr->isObject) ? static_cast<QGraphicsObject *>(p) : 0;
 
 never executed:  return (p && p->d_ptr->isObject) ? static_cast<QGraphicsObject *>(p) : 0; | 0 | ||||||||||||||||||||||||||||||
| 737 | } | - | ||||||||||||||||||||||||||||||
| 738 | QGraphicsWidget *QGraphicsItem::parentWidget() const | - | ||||||||||||||||||||||||||||||
| 739 | { | - | ||||||||||||||||||||||||||||||
| 740 | QGraphicsItem *p = parentItem(); | - | ||||||||||||||||||||||||||||||
| 741 |     while (p
 
  | 0 | ||||||||||||||||||||||||||||||
| 742 |         p = p->parentItem(); never executed:  p = p->parentItem(); | 0 | ||||||||||||||||||||||||||||||
| 743 |     return never executed:   (preturn (p && p->isWidget()) ? static_cast<QGraphicsWidget *>(p) : 0;
 
 never executed:  return (p && p->isWidget()) ? static_cast<QGraphicsWidget *>(p) : 0; | 0 | ||||||||||||||||||||||||||||||
| 744 | } | - | ||||||||||||||||||||||||||||||
| 745 | QGraphicsWidget *QGraphicsItem::topLevelWidget() const | - | ||||||||||||||||||||||||||||||
| 746 | { | - | ||||||||||||||||||||||||||||||
| 747 |     if (const
 
  | 0 | ||||||||||||||||||||||||||||||
| 748 |         return never executed:   p->topLevelWidget();return p->topLevelWidget();never executed:  return p->topLevelWidget(); | 0 | ||||||||||||||||||||||||||||||
| 749 |     return never executed:   isWidget()return isWidget() ? static_cast<QGraphicsWidget *>(const_cast<QGraphicsItem *>(this)) : 0;
 never executed:  return isWidget() ? static_cast<QGraphicsWidget *>(const_cast<QGraphicsItem *>(this)) : 0; | 0 | ||||||||||||||||||||||||||||||
| 750 | } | - | ||||||||||||||||||||||||||||||
| 751 | QGraphicsWidget *QGraphicsItem::window() const | - | ||||||||||||||||||||||||||||||
| 752 | { | - | ||||||||||||||||||||||||||||||
| 753 | QGraphicsItem *p = panel(); | - | ||||||||||||||||||||||||||||||
| 754 |     if (p
 
  | 0 | ||||||||||||||||||||||||||||||
| 755 |         return never executed:   static_cast<QGraphicsWidget *>(p);return static_cast<QGraphicsWidget *>(p);never executed:  return static_cast<QGraphicsWidget *>(p); | 0 | ||||||||||||||||||||||||||||||
| 756 |     return never executed:   0;return 0;never executed:  return 0; | 0 | ||||||||||||||||||||||||||||||
| 757 | } | - | ||||||||||||||||||||||||||||||
| 758 | QGraphicsItem *QGraphicsItem::panel() const | - | ||||||||||||||||||||||||||||||
| 759 | { | - | ||||||||||||||||||||||||||||||
| 760 |     if (d_ptr->flags & ItemIsPanel
  | 0 | ||||||||||||||||||||||||||||||
| 761 |         return never executed:   const_cast<QGraphicsItem *>(this);return const_cast<QGraphicsItem *>(this);never executed:  return const_cast<QGraphicsItem *>(this); | 0 | ||||||||||||||||||||||||||||||
| 762 |     return never executed:   d_ptr->parentreturn d_ptr->parent ? d_ptr->parent->panel() : 0;
 never executed:  return d_ptr->parent ? d_ptr->parent->panel() : 0; | 0 | ||||||||||||||||||||||||||||||
| 763 | } | - | ||||||||||||||||||||||||||||||
| 764 | - | |||||||||||||||||||||||||||||||
| 765 | - | |||||||||||||||||||||||||||||||
| 766 | - | |||||||||||||||||||||||||||||||
| 767 | - | |||||||||||||||||||||||||||||||
| 768 | - | |||||||||||||||||||||||||||||||
| 769 | - | |||||||||||||||||||||||||||||||
| 770 | - | |||||||||||||||||||||||||||||||
| 771 | QGraphicsObject *QGraphicsItem::toGraphicsObject() | - | ||||||||||||||||||||||||||||||
| 772 | { | - | ||||||||||||||||||||||||||||||
| 773 |     return never executed:   d_ptr->isObjectreturn d_ptr->isObject ? static_cast<QGraphicsObject *>(this) : 0;
 never executed:  return d_ptr->isObject ? static_cast<QGraphicsObject *>(this) : 0; | 0 | ||||||||||||||||||||||||||||||
| 774 | } | - | ||||||||||||||||||||||||||||||
| 775 | - | |||||||||||||||||||||||||||||||
| 776 | - | |||||||||||||||||||||||||||||||
| 777 | - | |||||||||||||||||||||||||||||||
| 778 | - | |||||||||||||||||||||||||||||||
| 779 | - | |||||||||||||||||||||||||||||||
| 780 | - | |||||||||||||||||||||||||||||||
| 781 | - | |||||||||||||||||||||||||||||||
| 782 | const QGraphicsObject *QGraphicsItem::toGraphicsObject() const | - | ||||||||||||||||||||||||||||||
| 783 | { | - | ||||||||||||||||||||||||||||||
| 784 |     return never executed:   d_ptr->isObjectreturn d_ptr->isObject ? static_cast<const QGraphicsObject *>(this) : 0;
 never executed:  return d_ptr->isObject ? static_cast<const QGraphicsObject *>(this) : 0; | 0 | ||||||||||||||||||||||||||||||
| 785 | } | - | ||||||||||||||||||||||||||||||
| 786 | void QGraphicsItem::setParentItem(QGraphicsItem *newParent) | - | ||||||||||||||||||||||||||||||
| 787 | { | - | ||||||||||||||||||||||||||||||
| 788 |     if (newParent == this
  | 0 | ||||||||||||||||||||||||||||||
| 789 | QMessageLogger(__FILE__, 1686, __PRETTY_FUNCTION__).warning("QGraphicsItem::setParentItem: cannot assign %p as a parent of itself", this); | - | ||||||||||||||||||||||||||||||
| 790 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 791 | } | - | ||||||||||||||||||||||||||||||
| 792 |     if (newParent == d_ptr->parent
  | 0 | ||||||||||||||||||||||||||||||
| 793 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 794 | - | |||||||||||||||||||||||||||||||
| 795 | const QVariant newParentVariant(itemChange(QGraphicsItem::ItemParentChange, | - | ||||||||||||||||||||||||||||||
| 796 | QVariant::fromValue<QGraphicsItem *>(newParent))); | - | ||||||||||||||||||||||||||||||
| 797 | newParent = qvariant_cast<QGraphicsItem *>(newParentVariant); | - | ||||||||||||||||||||||||||||||
| 798 |     if (newParent == d_ptr->parent
  | 0 | ||||||||||||||||||||||||||||||
| 799 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 800 | - | |||||||||||||||||||||||||||||||
| 801 | const QVariant thisPointerVariant(QVariant::fromValue<QGraphicsItem *>(this)); | - | ||||||||||||||||||||||||||||||
| 802 | d_ptr->setParentItemHelper(newParent, &newParentVariant, &thisPointerVariant); | - | ||||||||||||||||||||||||||||||
| 803 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 804 | QList<QGraphicsItem *> QGraphicsItem::childItems() const | - | ||||||||||||||||||||||||||||||
| 805 | { | - | ||||||||||||||||||||||||||||||
| 806 | const_cast<QGraphicsItem *>(this)->d_ptr->ensureSortedChildren(); | - | ||||||||||||||||||||||||||||||
| 807 |     return never executed:   d_ptr->children;return d_ptr->children;never executed:  return d_ptr->children; | 0 | ||||||||||||||||||||||||||||||
| 808 | } | - | ||||||||||||||||||||||||||||||
| 809 | - | |||||||||||||||||||||||||||||||
| 810 | - | |||||||||||||||||||||||||||||||
| 811 | - | |||||||||||||||||||||||||||||||
| 812 | - | |||||||||||||||||||||||||||||||
| 813 | - | |||||||||||||||||||||||||||||||
| 814 | - | |||||||||||||||||||||||||||||||
| 815 | bool QGraphicsItem::isWidget() const | - | ||||||||||||||||||||||||||||||
| 816 | { | - | ||||||||||||||||||||||||||||||
| 817 |     return never executed:   d_ptr->isWidget;return d_ptr->isWidget;never executed:  return d_ptr->isWidget; | 0 | ||||||||||||||||||||||||||||||
| 818 | } | - | ||||||||||||||||||||||||||||||
| 819 | bool QGraphicsItem::isWindow() const | - | ||||||||||||||||||||||||||||||
| 820 | { | - | ||||||||||||||||||||||||||||||
| 821 |     return never executed:   d_ptr->isWidgetreturn 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 | ||||||||||||||||||||||||||||||
| 822 | } | - | ||||||||||||||||||||||||||||||
| 823 | - | |||||||||||||||||||||||||||||||
| 824 | - | |||||||||||||||||||||||||||||||
| 825 | - | |||||||||||||||||||||||||||||||
| 826 | - | |||||||||||||||||||||||||||||||
| 827 | - | |||||||||||||||||||||||||||||||
| 828 | - | |||||||||||||||||||||||||||||||
| 829 | - | |||||||||||||||||||||||||||||||
| 830 | bool QGraphicsItem::isPanel() const | - | ||||||||||||||||||||||||||||||
| 831 | { | - | ||||||||||||||||||||||||||||||
| 832 |     return never executed:   d_ptr->flags & ItemIsPanel;return d_ptr->flags & ItemIsPanel;never executed:  return d_ptr->flags & ItemIsPanel; | 0 | ||||||||||||||||||||||||||||||
| 833 | } | - | ||||||||||||||||||||||||||||||
| 834 | QGraphicsItem::GraphicsItemFlags QGraphicsItem::flags() const | - | ||||||||||||||||||||||||||||||
| 835 | { | - | ||||||||||||||||||||||||||||||
| 836 |     return never executed:   GraphicsItemFlags(d_ptr->flags);return GraphicsItemFlags(d_ptr->flags);never executed:  return GraphicsItemFlags(d_ptr->flags); | 0 | ||||||||||||||||||||||||||||||
| 837 | } | - | ||||||||||||||||||||||||||||||
| 838 | - | |||||||||||||||||||||||||||||||
| 839 | - | |||||||||||||||||||||||||||||||
| 840 | - | |||||||||||||||||||||||||||||||
| 841 | - | |||||||||||||||||||||||||||||||
| 842 | - | |||||||||||||||||||||||||||||||
| 843 | - | |||||||||||||||||||||||||||||||
| 844 | - | |||||||||||||||||||||||||||||||
| 845 | void QGraphicsItem::setFlag(GraphicsItemFlag flag, bool enabled) | - | ||||||||||||||||||||||||||||||
| 846 | { | - | ||||||||||||||||||||||||||||||
| 847 |     if (enabled
  | 0 | ||||||||||||||||||||||||||||||
| 848 |         setFlags(GraphicsItemFlags(d_ptr->flags) | flag); never executed:  setFlags(GraphicsItemFlags(d_ptr->flags) | flag); | 0 | ||||||||||||||||||||||||||||||
| 849 | else | - | ||||||||||||||||||||||||||||||
| 850 |         setFlags(GraphicsItemFlags(d_ptr->flags) & ~flag); never executed:  setFlags(GraphicsItemFlags(d_ptr->flags) & ~flag); | 0 | ||||||||||||||||||||||||||||||
| 851 | } | - | ||||||||||||||||||||||||||||||
| 852 | void QGraphicsItem::setFlags(GraphicsItemFlags flags) | - | ||||||||||||||||||||||||||||||
| 853 | { | - | ||||||||||||||||||||||||||||||
| 854 | - | |||||||||||||||||||||||||||||||
| 855 |     if (quint32(d_ptr->flags) == quint32(flags)
  | 0 | ||||||||||||||||||||||||||||||
| 856 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 857 | flags = GraphicsItemFlags(itemChange(ItemFlagsChange, quint32(flags)).toUInt()); | - | ||||||||||||||||||||||||||||||
| 858 |     if (quint32(d_ptr->flags) == quint32(flags)
  | 0 | ||||||||||||||||||||||||||||||
| 859 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 860 |     if (d_ptr->scene
 
  | 0 | ||||||||||||||||||||||||||||||
| 861 |         d_ptr->scene->d_func()->index->itemChange(this, ItemFlagsChange, &flags); never executed:  d_ptr->scene->d_func()->index->itemChange(this, ItemFlagsChange, &flags); | 0 | ||||||||||||||||||||||||||||||
| 862 | - | |||||||||||||||||||||||||||||||
| 863 | - | |||||||||||||||||||||||||||||||
| 864 | const quint32 geomChangeFlagsMask = (ItemClipsChildrenToShape | ItemClipsToShape | ItemIgnoresTransformations | ItemIsSelectable); | - | ||||||||||||||||||||||||||||||
| 865 | bool fullUpdate = (quint32(flags) & geomChangeFlagsMask) != (d_ptr->flags & geomChangeFlagsMask); | - | ||||||||||||||||||||||||||||||
| 866 |     if (fullUpdate
  | 0 | ||||||||||||||||||||||||||||||
| 867 |         d_ptr->updatePaintedViewBoundingRects( true); never executed:  d_ptr->updatePaintedViewBoundingRects( true); | 0 | ||||||||||||||||||||||||||||||
| 868 | - | |||||||||||||||||||||||||||||||
| 869 | - | |||||||||||||||||||||||||||||||
| 870 | GraphicsItemFlags oldFlags = GraphicsItemFlags(d_ptr->flags); | - | ||||||||||||||||||||||||||||||
| 871 | - | |||||||||||||||||||||||||||||||
| 872 | - | |||||||||||||||||||||||||||||||
| 873 | d_ptr->flags = flags; | - | ||||||||||||||||||||||||||||||
| 874 | - | |||||||||||||||||||||||||||||||
| 875 |     if (!(d_ptr->flags & ItemIsFocusable)
 
  | 0 | ||||||||||||||||||||||||||||||
| 876 | - | |||||||||||||||||||||||||||||||
| 877 | - | |||||||||||||||||||||||||||||||
| 878 | clearFocus(); | - | ||||||||||||||||||||||||||||||
| 879 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 880 | - | |||||||||||||||||||||||||||||||
| 881 |     if (!(d_ptr->flags & ItemIsSelectable)
 
  | 0 | ||||||||||||||||||||||||||||||
| 882 | - | |||||||||||||||||||||||||||||||
| 883 | - | |||||||||||||||||||||||||||||||
| 884 | setSelected(false); | - | ||||||||||||||||||||||||||||||
| 885 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 886 | - | |||||||||||||||||||||||||||||||
| 887 |     if ((
 
  | 0 | ||||||||||||||||||||||||||||||
| 888 | - | |||||||||||||||||||||||||||||||
| 889 | - | |||||||||||||||||||||||||||||||
| 890 | d_ptr->updateAncestorFlag(ItemClipsChildrenToShape); | - | ||||||||||||||||||||||||||||||
| 891 | - | |||||||||||||||||||||||||||||||
| 892 | - | |||||||||||||||||||||||||||||||
| 893 | d_ptr->dirtyChildrenBoundingRect = 1; | - | ||||||||||||||||||||||||||||||
| 894 | d_ptr->markParentDirty(true); | - | ||||||||||||||||||||||||||||||
| 895 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 896 | - | |||||||||||||||||||||||||||||||
| 897 |     if ((
 
  | 0 | ||||||||||||||||||||||||||||||
| 898 | - | |||||||||||||||||||||||||||||||
| 899 | d_ptr->updateAncestorFlag(ItemContainsChildrenInShape); | - | ||||||||||||||||||||||||||||||
| 900 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 901 | - | |||||||||||||||||||||||||||||||
| 902 |     if ((
 
  | 0 | ||||||||||||||||||||||||||||||
| 903 | - | |||||||||||||||||||||||||||||||
| 904 | - | |||||||||||||||||||||||||||||||
| 905 | d_ptr->updateAncestorFlag(ItemIgnoresTransformations); | - | ||||||||||||||||||||||||||||||
| 906 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 907 | - | |||||||||||||||||||||||||||||||
| 908 |     if ((
 
  | 0 | ||||||||||||||||||||||||||||||
| 909 | - | |||||||||||||||||||||||||||||||
| 910 | - | |||||||||||||||||||||||||||||||
| 911 | - | |||||||||||||||||||||||||||||||
| 912 | - | |||||||||||||||||||||||||||||||
| 913 | - | |||||||||||||||||||||||||||||||
| 914 |         if (d_ptr->z < qreal(0.0)
  | 0 | ||||||||||||||||||||||||||||||
| 915 |             flags |= ItemStacksBehindParent; never executed:  flags |= ItemStacksBehindParent; | 0 | ||||||||||||||||||||||||||||||
| 916 | else | - | ||||||||||||||||||||||||||||||
| 917 |             flags &= ~ItemStacksBehindParent; never executed:  flags &= ~ItemStacksBehindParent; | 0 | ||||||||||||||||||||||||||||||
| 918 | d_ptr->flags = flags; | - | ||||||||||||||||||||||||||||||
| 919 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 920 | - | |||||||||||||||||||||||||||||||
| 921 |     if ((
 
  | 0 | ||||||||||||||||||||||||||||||
| 922 | - | |||||||||||||||||||||||||||||||
| 923 | - | |||||||||||||||||||||||||||||||
| 924 | - | |||||||||||||||||||||||||||||||
| 925 | - | |||||||||||||||||||||||||||||||
| 926 |         if (d_ptr->parent
  | 0 | ||||||||||||||||||||||||||||||
| 927 |             d_ptr->parent->d_ptr->needSortChildren = 1; never executed:  d_ptr->parent->d_ptr->needSortChildren = 1; | 0 | ||||||||||||||||||||||||||||||
| 928 |         else if (d_ptr->scene
  | 0 | ||||||||||||||||||||||||||||||
| 929 |             d_ptr->scene->d_func()->needSortTopLevelItems = 1; never executed:  d_ptr->scene->d_func()->needSortTopLevelItems = 1; | 0 | ||||||||||||||||||||||||||||||
| 930 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 931 | - | |||||||||||||||||||||||||||||||
| 932 |     if ((
 
  | 0 | ||||||||||||||||||||||||||||||
| 933 | - | |||||||||||||||||||||||||||||||
| 934 |         if (d_ptr->scene
  | 0 | ||||||||||||||||||||||||||||||
| 935 |             d_ptr->scene->d_func()->updateInputMethodSensitivityInViews(); never executed:  d_ptr->scene->d_func()->updateInputMethodSensitivityInViews(); | 0 | ||||||||||||||||||||||||||||||
| 936 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 937 | - | |||||||||||||||||||||||||||||||
| 938 |     if ((
 
  | 0 | ||||||||||||||||||||||||||||||
| 939 | bool becomesPanel = (flags & ItemIsPanel); | - | ||||||||||||||||||||||||||||||
| 940 |         if ((
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 941 | - | |||||||||||||||||||||||||||||||
| 942 |             if (becomesPanel
  | 0 | ||||||||||||||||||||||||||||||
| 943 |                 d_ptr->scene->d_func()->enterModal(this); never executed:  d_ptr->scene->d_func()->enterModal(this); | 0 | ||||||||||||||||||||||||||||||
| 944 | else | - | ||||||||||||||||||||||||||||||
| 945 |                 d_ptr->scene->d_func()->leaveModal(this); never executed:  d_ptr->scene->d_func()->leaveModal(this); | 0 | ||||||||||||||||||||||||||||||
| 946 | } | - | ||||||||||||||||||||||||||||||
| 947 |         if (d_ptr->isWidget
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 948 | QGraphicsWidget *w = static_cast<QGraphicsWidget *>(this); | - | ||||||||||||||||||||||||||||||
| 949 | QGraphicsWidget *focusFirst = w; | - | ||||||||||||||||||||||||||||||
| 950 | QGraphicsWidget *focusLast = w; | - | ||||||||||||||||||||||||||||||
| 951 | for (;;) { | - | ||||||||||||||||||||||||||||||
| 952 | QGraphicsWidget *test = focusLast->d_func()->focusNext; | - | ||||||||||||||||||||||||||||||
| 953 |                 if (!w->isAncestorOf(test)
 
  | 0 | ||||||||||||||||||||||||||||||
| 954 |                     break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 955 | focusLast = test; | - | ||||||||||||||||||||||||||||||
| 956 |             } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 957 | - | |||||||||||||||||||||||||||||||
| 958 |             if (becomesPanel
  | 0 | ||||||||||||||||||||||||||||||
| 959 | - | |||||||||||||||||||||||||||||||
| 960 | QGraphicsWidget *beforeMe = w->d_func()->focusPrev; | - | ||||||||||||||||||||||||||||||
| 961 | QGraphicsWidget *afterMe = focusLast->d_func()->focusNext; | - | ||||||||||||||||||||||||||||||
| 962 | beforeMe->d_func()->focusNext = afterMe; | - | ||||||||||||||||||||||||||||||
| 963 | afterMe->d_func()->focusPrev = beforeMe; | - | ||||||||||||||||||||||||||||||
| 964 | focusFirst->d_func()->focusPrev = focusLast; | - | ||||||||||||||||||||||||||||||
| 965 | focusLast->d_func()->focusNext = focusFirst; | - | ||||||||||||||||||||||||||||||
| 966 |                 if (!isAncestorOf(focusFirst->d_func()->focusNext)
  | 0 | ||||||||||||||||||||||||||||||
| 967 |                     focusFirst->d_func()->focusNext = w; never executed:  focusFirst->d_func()->focusNext = w; | 0 | ||||||||||||||||||||||||||||||
| 968 |             } never executed:   else if (QGraphicsWidget *pw = parentWidget()end of block
  | 0 | ||||||||||||||||||||||||||||||
| 969 | - | |||||||||||||||||||||||||||||||
| 970 | QGraphicsWidget *beforeMe = pw; | - | ||||||||||||||||||||||||||||||
| 971 | QGraphicsWidget *afterMe = pw->d_func()->focusNext; | - | ||||||||||||||||||||||||||||||
| 972 | beforeMe->d_func()->focusNext = w; | - | ||||||||||||||||||||||||||||||
| 973 | afterMe->d_func()->focusPrev = focusLast; | - | ||||||||||||||||||||||||||||||
| 974 | w->d_func()->focusPrev = beforeMe; | - | ||||||||||||||||||||||||||||||
| 975 | focusLast->d_func()->focusNext = afterMe; | - | ||||||||||||||||||||||||||||||
| 976 |             } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 977 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 978 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 979 | - | |||||||||||||||||||||||||||||||
| 980 |     if (d_ptr->scene
  | 0 | ||||||||||||||||||||||||||||||
| 981 |         if ((
 
  | 0 | ||||||||||||||||||||||||||||||
| 982 |             if (flags & ItemSendsScenePositionChanges
  | 0 | ||||||||||||||||||||||||||||||
| 983 |                 d_ptr->scene->d_func()->registerScenePosItem(this); never executed:  d_ptr->scene->d_func()->registerScenePosItem(this); | 0 | ||||||||||||||||||||||||||||||
| 984 | else | - | ||||||||||||||||||||||||||||||
| 985 |                 d_ptr->scene->d_func()->unregisterScenePosItem(this); never executed:  d_ptr->scene->d_func()->unregisterScenePosItem(this); | 0 | ||||||||||||||||||||||||||||||
| 986 | } | - | ||||||||||||||||||||||||||||||
| 987 | d_ptr->scene->d_func()->markDirty(this, QRectF(), true); | - | ||||||||||||||||||||||||||||||
| 988 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 989 | - | |||||||||||||||||||||||||||||||
| 990 | - | |||||||||||||||||||||||||||||||
| 991 | itemChange(ItemFlagsHaveChanged, quint32(flags)); | - | ||||||||||||||||||||||||||||||
| 992 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 993 | QGraphicsItem::CacheMode QGraphicsItem::cacheMode() const | - | ||||||||||||||||||||||||||||||
| 994 | { | - | ||||||||||||||||||||||||||||||
| 995 |     return never executed:   QGraphicsItem::CacheMode(d_ptr->cacheMode);return QGraphicsItem::CacheMode(d_ptr->cacheMode);never executed:  return QGraphicsItem::CacheMode(d_ptr->cacheMode); | 0 | ||||||||||||||||||||||||||||||
| 996 | } | - | ||||||||||||||||||||||||||||||
| 997 | void QGraphicsItem::setCacheMode(CacheMode mode, const QSize &logicalCacheSize) | - | ||||||||||||||||||||||||||||||
| 998 | { | - | ||||||||||||||||||||||||||||||
| 999 | CacheMode lastMode = CacheMode(d_ptr->cacheMode); | - | ||||||||||||||||||||||||||||||
| 1000 | d_ptr->cacheMode = mode; | - | ||||||||||||||||||||||||||||||
| 1001 |     bool noVisualChange = (mode == NoCache
 
  | 0 | ||||||||||||||||||||||||||||||
| 1002 |                           || (mode == NoCache
 
  | 0 | ||||||||||||||||||||||||||||||
| 1003 |                           || (mode == DeviceCoordinateCache
 
  | 0 | ||||||||||||||||||||||||||||||
| 1004 |                           || (mode == DeviceCoordinateCache
 
  | 0 | ||||||||||||||||||||||||||||||
| 1005 |     if (mode == NoCache
  | 0 | ||||||||||||||||||||||||||||||
| 1006 | d_ptr->removeExtraItemCache(); | - | ||||||||||||||||||||||||||||||
| 1007 |     } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||
| 1008 | QGraphicsItemCache *cache = d_ptr->extraItemCache(); | - | ||||||||||||||||||||||||||||||
| 1009 | - | |||||||||||||||||||||||||||||||
| 1010 | - | |||||||||||||||||||||||||||||||
| 1011 | cache->purge(); | - | ||||||||||||||||||||||||||||||
| 1012 | - | |||||||||||||||||||||||||||||||
| 1013 |         if (mode == ItemCoordinateCache
  | 0 | ||||||||||||||||||||||||||||||
| 1014 |             if (lastMode == mode
 
  | 0 | ||||||||||||||||||||||||||||||
| 1015 |                 noVisualChange = true; never executed:  noVisualChange = true; | 0 | ||||||||||||||||||||||||||||||
| 1016 | cache->fixedSize = logicalCacheSize; | - | ||||||||||||||||||||||||||||||
| 1017 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1018 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1019 |     if (!noVisualChange
  | 0 | ||||||||||||||||||||||||||||||
| 1020 |         update(); never executed:  update(); | 0 | ||||||||||||||||||||||||||||||
| 1021 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1022 | - | |||||||||||||||||||||||||||||||
| 1023 | - | |||||||||||||||||||||||||||||||
| 1024 | - | |||||||||||||||||||||||||||||||
| 1025 | - | |||||||||||||||||||||||||||||||
| 1026 | - | |||||||||||||||||||||||||||||||
| 1027 | - | |||||||||||||||||||||||||||||||
| 1028 | QGraphicsItem::PanelModality QGraphicsItem::panelModality() const | - | ||||||||||||||||||||||||||||||
| 1029 | { | - | ||||||||||||||||||||||||||||||
| 1030 |     return never executed:   d_ptr->panelModality;return d_ptr->panelModality;never executed:  return d_ptr->panelModality; | 0 | ||||||||||||||||||||||||||||||
| 1031 | } | - | ||||||||||||||||||||||||||||||
| 1032 | void QGraphicsItem::setPanelModality(PanelModality panelModality) | - | ||||||||||||||||||||||||||||||
| 1033 | { | - | ||||||||||||||||||||||||||||||
| 1034 |     if (d_ptr->panelModality == panelModality
  | 0 | ||||||||||||||||||||||||||||||
| 1035 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 1036 | - | |||||||||||||||||||||||||||||||
| 1037 | PanelModality previousModality = d_ptr->panelModality; | - | ||||||||||||||||||||||||||||||
| 1038 |     bool enterLeaveModal = (isPanel()
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 1039 |     if (enterLeaveModal
 
  | 0 | ||||||||||||||||||||||||||||||
| 1040 |         d_ptr->scene->d_func()->leaveModal(this); never executed:  d_ptr->scene->d_func()->leaveModal(this); | 0 | ||||||||||||||||||||||||||||||
| 1041 | d_ptr->panelModality = panelModality; | - | ||||||||||||||||||||||||||||||
| 1042 |     if (enterLeaveModal
 
  | 0 | ||||||||||||||||||||||||||||||
| 1043 |         d_ptr->scene->d_func()->enterModal(this, previousModality); never executed:  d_ptr->scene->d_func()->enterModal(this, previousModality); | 0 | ||||||||||||||||||||||||||||||
| 1044 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1045 | bool QGraphicsItem::isBlockedByModalPanel(QGraphicsItem **blockingPanel) const | - | ||||||||||||||||||||||||||||||
| 1046 | { | - | ||||||||||||||||||||||||||||||
| 1047 |     if (!d_ptr->scene
  | 0 | ||||||||||||||||||||||||||||||
| 1048 |         return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||
| 1049 | - | |||||||||||||||||||||||||||||||
| 1050 | - | |||||||||||||||||||||||||||||||
| 1051 | QGraphicsItem *dummy = 0; | - | ||||||||||||||||||||||||||||||
| 1052 |     if (!blockingPanel
  | 0 | ||||||||||||||||||||||||||||||
| 1053 |         blockingPanel = &dummy; never executed:  blockingPanel = &dummy; | 0 | ||||||||||||||||||||||||||||||
| 1054 | - | |||||||||||||||||||||||||||||||
| 1055 | QGraphicsScenePrivate *scene_d = d_ptr->scene->d_func(); | - | ||||||||||||||||||||||||||||||
| 1056 |     if (scene_d->modalPanels.isEmpty()
  | 0 | ||||||||||||||||||||||||||||||
| 1057 |         return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||
| 1058 | - | |||||||||||||||||||||||||||||||
| 1059 | - | |||||||||||||||||||||||||||||||
| 1060 |     if (!scene_d->popupWidgets.isEmpty()
 
  | 0 | ||||||||||||||||||||||||||||||
| 1061 |         return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||
| 1062 | - | |||||||||||||||||||||||||||||||
| 1063 |     for (int i = 0; i < scene_d->modalPanels.count()
  | 0 | ||||||||||||||||||||||||||||||
| 1064 | QGraphicsItem *modalPanel = scene_d->modalPanels.at(i); | - | ||||||||||||||||||||||||||||||
| 1065 |         if (modalPanel->panelModality() == QGraphicsItem::SceneModal
  | 0 | ||||||||||||||||||||||||||||||
| 1066 | - | |||||||||||||||||||||||||||||||
| 1067 |             if (modalPanel != this
 
  | 0 | ||||||||||||||||||||||||||||||
| 1068 | *blockingPanel = modalPanel; | - | ||||||||||||||||||||||||||||||
| 1069 |                 return never executed:   true;return true;never executed:  return true; | 0 | ||||||||||||||||||||||||||||||
| 1070 | } | - | ||||||||||||||||||||||||||||||
| 1071 |         } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||
| 1072 | - | |||||||||||||||||||||||||||||||
| 1073 |             if (modalPanel != this
  | 0 | ||||||||||||||||||||||||||||||
| 1074 |                 && !modalPanel->isAncestorOf(this)
  | 0 | ||||||||||||||||||||||||||||||
| 1075 |                 && commonAncestorItem(modalPanel)
  | 0 | ||||||||||||||||||||||||||||||
| 1076 | *blockingPanel = modalPanel; | - | ||||||||||||||||||||||||||||||
| 1077 |                 return never executed:   true;return true;never executed:  return true; | 0 | ||||||||||||||||||||||||||||||
| 1078 | } | - | ||||||||||||||||||||||||||||||
| 1079 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1080 | } | - | ||||||||||||||||||||||||||||||
| 1081 |     return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||
| 1082 | } | - | ||||||||||||||||||||||||||||||
| 1083 | QString QGraphicsItem::toolTip() const | - | ||||||||||||||||||||||||||||||
| 1084 | { | - | ||||||||||||||||||||||||||||||
| 1085 |     return never executed:   d_ptr->extra(QGraphicsItemPrivate::ExtraToolTip).toString();return d_ptr->extra(QGraphicsItemPrivate::ExtraToolTip).toString();never executed:  return d_ptr->extra(QGraphicsItemPrivate::ExtraToolTip).toString(); | 0 | ||||||||||||||||||||||||||||||
| 1086 | } | - | ||||||||||||||||||||||||||||||
| 1087 | - | |||||||||||||||||||||||||||||||
| 1088 | - | |||||||||||||||||||||||||||||||
| 1089 | - | |||||||||||||||||||||||||||||||
| 1090 | - | |||||||||||||||||||||||||||||||
| 1091 | - | |||||||||||||||||||||||||||||||
| 1092 | - | |||||||||||||||||||||||||||||||
| 1093 | - | |||||||||||||||||||||||||||||||
| 1094 | void QGraphicsItem::setToolTip(const QString &toolTip) | - | ||||||||||||||||||||||||||||||
| 1095 | { | - | ||||||||||||||||||||||||||||||
| 1096 | const QVariant toolTipVariant(itemChange(ItemToolTipChange, toolTip)); | - | ||||||||||||||||||||||||||||||
| 1097 | d_ptr->setExtra(QGraphicsItemPrivate::ExtraToolTip, toolTipVariant.toString()); | - | ||||||||||||||||||||||||||||||
| 1098 | itemChange(ItemToolTipHasChanged, toolTipVariant); | - | ||||||||||||||||||||||||||||||
| 1099 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1100 | QCursor QGraphicsItem::cursor() const | - | ||||||||||||||||||||||||||||||
| 1101 | { | - | ||||||||||||||||||||||||||||||
| 1102 |     return never executed:   qvariant_cast<QCursor>(d_ptr->extra(QGraphicsItemPrivate::ExtraCursor));return qvariant_cast<QCursor>(d_ptr->extra(QGraphicsItemPrivate::ExtraCursor));never executed:  return qvariant_cast<QCursor>(d_ptr->extra(QGraphicsItemPrivate::ExtraCursor)); | 0 | ||||||||||||||||||||||||||||||
| 1103 | } | - | ||||||||||||||||||||||||||||||
| 1104 | void QGraphicsItem::setCursor(const QCursor &cursor) | - | ||||||||||||||||||||||||||||||
| 1105 | { | - | ||||||||||||||||||||||||||||||
| 1106 | const QVariant cursorVariant(itemChange(ItemCursorChange, QVariant::fromValue<QCursor>(cursor))); | - | ||||||||||||||||||||||||||||||
| 1107 | d_ptr->setExtra(QGraphicsItemPrivate::ExtraCursor, qvariant_cast<QCursor>(cursorVariant)); | - | ||||||||||||||||||||||||||||||
| 1108 | d_ptr->hasCursor = 1; | - | ||||||||||||||||||||||||||||||
| 1109 |     if (d_ptr->scene
  | 0 | ||||||||||||||||||||||||||||||
| 1110 | d_ptr->scene->d_func()->allItemsUseDefaultCursor = false; | - | ||||||||||||||||||||||||||||||
| 1111 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(d_ptr->scene->views())>::type> _container_((d_ptr->scene->views())); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QGraphicsView *view = *_container_.i; _container_.control; _container_.control = 0) { | - | ||||||||||||||||||||||||||||||
| 1112 | view->viewport()->setMouseTracking(true); | - | ||||||||||||||||||||||||||||||
| 1113 | - | |||||||||||||||||||||||||||||||
| 1114 |             if (view->underMouse()
  | 0 | ||||||||||||||||||||||||||||||
| 1115 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(view->items(view->mapFromGlobal(QCursor::pos())))>::type> _container_((view->items(view->mapFromGlobal(QCursor::pos())))); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QGraphicsItem *itemUnderCursor = *_container_.i; _container_.control; _container_.control = 0) { | - | ||||||||||||||||||||||||||||||
| 1116 |                     if (itemUnderCursor->hasCursor()
  | 0 | ||||||||||||||||||||||||||||||
| 1117 | QMetaObject::invokeMethod(view, "_q_setViewportCursor", | - | ||||||||||||||||||||||||||||||
| 1118 | QArgument<QCursor >("QCursor", itemUnderCursor->cursor())); | - | ||||||||||||||||||||||||||||||
| 1119 |                         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 1120 | } | - | ||||||||||||||||||||||||||||||
| 1121 |                 } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1122 |                 break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 1123 | } | - | ||||||||||||||||||||||||||||||
| 1124 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1125 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1126 | itemChange(ItemCursorHasChanged, cursorVariant); | - | ||||||||||||||||||||||||||||||
| 1127 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1128 | bool QGraphicsItem::hasCursor() const | - | ||||||||||||||||||||||||||||||
| 1129 | { | - | ||||||||||||||||||||||||||||||
| 1130 |     return never executed:   d_ptr->hasCursor;return d_ptr->hasCursor;never executed:  return d_ptr->hasCursor; | 0 | ||||||||||||||||||||||||||||||
| 1131 | } | - | ||||||||||||||||||||||||||||||
| 1132 | - | |||||||||||||||||||||||||||||||
| 1133 | - | |||||||||||||||||||||||||||||||
| 1134 | - | |||||||||||||||||||||||||||||||
| 1135 | - | |||||||||||||||||||||||||||||||
| 1136 | - | |||||||||||||||||||||||||||||||
| 1137 | - | |||||||||||||||||||||||||||||||
| 1138 | void QGraphicsItem::unsetCursor() | - | ||||||||||||||||||||||||||||||
| 1139 | { | - | ||||||||||||||||||||||||||||||
| 1140 |     if (!d_ptr->hasCursor
  | 0 | ||||||||||||||||||||||||||||||
| 1141 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 1142 | d_ptr->unsetExtra(QGraphicsItemPrivate::ExtraCursor); | - | ||||||||||||||||||||||||||||||
| 1143 | d_ptr->hasCursor = 0; | - | ||||||||||||||||||||||||||||||
| 1144 |     if (d_ptr->scene
  | 0 | ||||||||||||||||||||||||||||||
| 1145 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(d_ptr->scene->views())>::type> _container_((d_ptr->scene->views())); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QGraphicsView *view = *_container_.i; _container_.control; _container_.control = 0) { | - | ||||||||||||||||||||||||||||||
| 1146 |             if (view->underMouse()
 
  | 0 | ||||||||||||||||||||||||||||||
| 1147 | QMetaObject::invokeMethod(view, "_q_unsetViewportCursor"); | - | ||||||||||||||||||||||||||||||
| 1148 |                 break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 1149 | } | - | ||||||||||||||||||||||||||||||
| 1150 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1151 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1152 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1153 | bool QGraphicsItem::isVisible() const | - | ||||||||||||||||||||||||||||||
| 1154 | { | - | ||||||||||||||||||||||||||||||
| 1155 |     return never executed:   d_ptr->visible;return d_ptr->visible;never executed:  return d_ptr->visible; | 0 | ||||||||||||||||||||||||||||||
| 1156 | } | - | ||||||||||||||||||||||||||||||
| 1157 | bool QGraphicsItem::isVisibleTo(const QGraphicsItem *parent) const | - | ||||||||||||||||||||||||||||||
| 1158 | { | - | ||||||||||||||||||||||||||||||
| 1159 | const QGraphicsItem *p = this; | - | ||||||||||||||||||||||||||||||
| 1160 |     if (d_ptr->explicitlyHidden
  | 0 | ||||||||||||||||||||||||||||||
| 1161 |         return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||
| 1162 | do { | - | ||||||||||||||||||||||||||||||
| 1163 |         if (p == parent
  | 0 | ||||||||||||||||||||||||||||||
| 1164 |             return never executed:   true;return true;never executed:  return true; | 0 | ||||||||||||||||||||||||||||||
| 1165 |         if (p->d_ptr->explicitlyHidden
  | 0 | ||||||||||||||||||||||||||||||
| 1166 |             return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||
| 1167 |     } never executed:   while ((end of block
 
  | 0 | ||||||||||||||||||||||||||||||
| 1168 |     return never executed:   parent == 0;return parent == 0;never executed:  return parent == 0; | 0 | ||||||||||||||||||||||||||||||
| 1169 | } | - | ||||||||||||||||||||||||||||||
| 1170 | - | |||||||||||||||||||||||||||||||
| 1171 | - | |||||||||||||||||||||||||||||||
| 1172 | - | |||||||||||||||||||||||||||||||
| 1173 | - | |||||||||||||||||||||||||||||||
| 1174 | - | |||||||||||||||||||||||||||||||
| 1175 | - | |||||||||||||||||||||||||||||||
| 1176 | - | |||||||||||||||||||||||||||||||
| 1177 | void QGraphicsItemPrivate::setVisibleHelper(bool newVisible, bool explicitly, | - | ||||||||||||||||||||||||||||||
| 1178 | bool update, bool hiddenByPanel) | - | ||||||||||||||||||||||||||||||
| 1179 | { | - | ||||||||||||||||||||||||||||||
| 1180 | QGraphicsItem * const q = q_func(); | - | ||||||||||||||||||||||||||||||
| 1181 | - | |||||||||||||||||||||||||||||||
| 1182 | - | |||||||||||||||||||||||||||||||
| 1183 |     if (explicitly
  | 0 | ||||||||||||||||||||||||||||||
| 1184 |         explicitlyHidden = newVisible
 never executed:  explicitlyHidden = newVisible ? 0 : 1; | 0 | ||||||||||||||||||||||||||||||
| 1185 | - | |||||||||||||||||||||||||||||||
| 1186 | - | |||||||||||||||||||||||||||||||
| 1187 |     if (visible == quint32(newVisible)
  | 0 | ||||||||||||||||||||||||||||||
| 1188 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 1189 | - | |||||||||||||||||||||||||||||||
| 1190 | - | |||||||||||||||||||||||||||||||
| 1191 |     if (parent
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 1192 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 1193 | - | |||||||||||||||||||||||||||||||
| 1194 | - | |||||||||||||||||||||||||||||||
| 1195 | const QVariant newVisibleVariant(q_ptr->itemChange(QGraphicsItem::ItemVisibleChange, | - | ||||||||||||||||||||||||||||||
| 1196 | quint32(newVisible))); | - | ||||||||||||||||||||||||||||||
| 1197 | newVisible = newVisibleVariant.toBool(); | - | ||||||||||||||||||||||||||||||
| 1198 |     if (visible == quint32(newVisible)
  | 0 | ||||||||||||||||||||||||||||||
| 1199 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 1200 | visible = newVisible; | - | ||||||||||||||||||||||||||||||
| 1201 | - | |||||||||||||||||||||||||||||||
| 1202 | - | |||||||||||||||||||||||||||||||
| 1203 |     if (update
  | 0 | ||||||||||||||||||||||||||||||
| 1204 | QGraphicsItemCache *c = (QGraphicsItemCache *)qvariant_cast<void *>(extra(ExtraCacheData)); | - | ||||||||||||||||||||||||||||||
| 1205 |         if (c
  | 0 | ||||||||||||||||||||||||||||||
| 1206 |             c->purge(); never executed:  c->purge(); | 0 | ||||||||||||||||||||||||||||||
| 1207 |         if (scene
  | 0 | ||||||||||||||||||||||||||||||
| 1208 | - | |||||||||||||||||||||||||||||||
| 1209 | invalidateParentGraphicsEffectsRecursively(); | - | ||||||||||||||||||||||||||||||
| 1210 | - | |||||||||||||||||||||||||||||||
| 1211 | scene->d_func()->markDirty(q_ptr, QRectF(), false, true); | - | ||||||||||||||||||||||||||||||
| 1212 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1213 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1214 | - | |||||||||||||||||||||||||||||||
| 1215 | - | |||||||||||||||||||||||||||||||
| 1216 | bool hasFocus = q_ptr->hasFocus(); | - | ||||||||||||||||||||||||||||||
| 1217 |     if (!newVisible
  | 0 | ||||||||||||||||||||||||||||||
| 1218 |         if (scene
  | 0 | ||||||||||||||||||||||||||||||
| 1219 |             if (scene->d_func()->mouseGrabberItems.contains(q)
  | 0 | ||||||||||||||||||||||||||||||
| 1220 |                 q->ungrabMouse(); never executed:  q->ungrabMouse(); | 0 | ||||||||||||||||||||||||||||||
| 1221 |             if (scene->d_func()->keyboardGrabberItems.contains(q)
  | 0 | ||||||||||||||||||||||||||||||
| 1222 |                 q->ungrabKeyboard(); never executed:  q->ungrabKeyboard(); | 0 | ||||||||||||||||||||||||||||||
| 1223 |             if (q->isPanel()
 
  | 0 | ||||||||||||||||||||||||||||||
| 1224 |                 scene->d_func()->leaveModal(q_ptr); never executed:  scene->d_func()->leaveModal(q_ptr); | 0 | ||||||||||||||||||||||||||||||
| 1225 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1226 |         if (hasFocus
 
  | 0 | ||||||||||||||||||||||||||||||
| 1227 | - | |||||||||||||||||||||||||||||||
| 1228 | QGraphicsItem *focusItem = scene->focusItem(); | - | ||||||||||||||||||||||||||||||
| 1229 | bool clear = true; | - | ||||||||||||||||||||||||||||||
| 1230 |             if (isWidget
 
  | 0 | ||||||||||||||||||||||||||||||
| 1231 | do { | - | ||||||||||||||||||||||||||||||
| 1232 |                     if (focusItem == q_ptr
  | 0 | ||||||||||||||||||||||||||||||
| 1233 | clear = !static_cast<QGraphicsWidget *>(q_ptr)->focusNextPrevChild(true); | - | ||||||||||||||||||||||||||||||
| 1234 |                         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 1235 | } | - | ||||||||||||||||||||||||||||||
| 1236 |                 } never executed:   while ((end of block
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 1237 |             } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1238 |             if (clear
  | 0 | ||||||||||||||||||||||||||||||
| 1239 |                 clearFocusHelper( false, hiddenByPanel); never executed:  clearFocusHelper( false, hiddenByPanel); | 0 | ||||||||||||||||||||||||||||||
| 1240 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1241 |         if (q_ptr->isSelected()
  | 0 | ||||||||||||||||||||||||||||||
| 1242 |             q_ptr->setSelected(false); never executed:  q_ptr->setSelected(false); | 0 | ||||||||||||||||||||||||||||||
| 1243 |     } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||
| 1244 | geometryChanged = 1; | - | ||||||||||||||||||||||||||||||
| 1245 | paintedViewBoundingRectsNeedRepaint = 1; | - | ||||||||||||||||||||||||||||||
| 1246 |         if (scene
  | 0 | ||||||||||||||||||||||||||||||
| 1247 |             if (isWidget
  | 0 | ||||||||||||||||||||||||||||||
| 1248 | QGraphicsWidget *widget = static_cast<QGraphicsWidget *>(q_ptr); | - | ||||||||||||||||||||||||||||||
| 1249 |                 if (widget->windowType() == Qt::Popup
  | 0 | ||||||||||||||||||||||||||||||
| 1250 |                     scene->d_func()->addPopup(widget); never executed:  scene->d_func()->addPopup(widget); | 0 | ||||||||||||||||||||||||||||||
| 1251 |             } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1252 |             if (q->isPanel()
 
  | 0 | ||||||||||||||||||||||||||||||
| 1253 | scene->d_func()->enterModal(q_ptr); | - | ||||||||||||||||||||||||||||||
| 1254 |             } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1255 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1256 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1257 | - | |||||||||||||||||||||||||||||||
| 1258 | - | |||||||||||||||||||||||||||||||
| 1259 |     const bool updateChildren = update
 
  | 0 | ||||||||||||||||||||||||||||||
| 1260 |                                              || flags & QGraphicsItem::ItemContainsChildrenInShape
  | 0 | ||||||||||||||||||||||||||||||
| 1261 |                                             && !(flags & QGraphicsItem::ItemHasNoContents)
  | 0 | ||||||||||||||||||||||||||||||
| 1262 | 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) { | - | ||||||||||||||||||||||||||||||
| 1263 |         if (!newVisible
 
  | 0 | ||||||||||||||||||||||||||||||
| 1264 |             child->d_ptr->setVisibleHelper(newVisible, false, updateChildren, hiddenByPanel); never executed:  child->d_ptr->setVisibleHelper(newVisible, false, updateChildren, hiddenByPanel); | 0 | ||||||||||||||||||||||||||||||
| 1265 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1266 | - | |||||||||||||||||||||||||||||||
| 1267 | - | |||||||||||||||||||||||||||||||
| 1268 |     if (scene
 
  | 0 | ||||||||||||||||||||||||||||||
| 1269 |         if (newVisible
  | 0 | ||||||||||||||||||||||||||||||
| 1270 |             if (parent
 
  | 0 | ||||||||||||||||||||||||||||||
| 1271 |                 q->setActive(true); never executed:  q->setActive(true); | 0 | ||||||||||||||||||||||||||||||
| 1272 |         } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||
| 1273 |             if (q->isActive()
  | 0 | ||||||||||||||||||||||||||||||
| 1274 |                 scene->setActivePanel(parent); never executed:  scene->setActivePanel(parent); | 0 | ||||||||||||||||||||||||||||||
| 1275 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1276 | } | - | ||||||||||||||||||||||||||||||
| 1277 | - | |||||||||||||||||||||||||||||||
| 1278 | - | |||||||||||||||||||||||||||||||
| 1279 |     if (scene
  | 0 | ||||||||||||||||||||||||||||||
| 1280 |         if (newVisible
  | 0 | ||||||||||||||||||||||||||||||
| 1281 | - | |||||||||||||||||||||||||||||||
| 1282 | QGraphicsItem *p = parent; | - | ||||||||||||||||||||||||||||||
| 1283 | bool done = false; | - | ||||||||||||||||||||||||||||||
| 1284 |             while (p
  | 0 | ||||||||||||||||||||||||||||||
| 1285 |                 if (p->flags() & QGraphicsItem::ItemIsFocusScope
  | 0 | ||||||||||||||||||||||||||||||
| 1286 | QGraphicsItem *fsi = p->d_ptr->focusScopeItem; | - | ||||||||||||||||||||||||||||||
| 1287 |                     if (q_ptr == fsi
 
  | 0 | ||||||||||||||||||||||||||||||
| 1288 | done = true; | - | ||||||||||||||||||||||||||||||
| 1289 |                         while (fsi->d_ptr->focusScopeItem
 
  | 0 | ||||||||||||||||||||||||||||||
| 1290 |                             fsi = fsi->d_ptr->focusScopeItem; never executed:  fsi = fsi->d_ptr->focusScopeItem; | 0 | ||||||||||||||||||||||||||||||
| 1291 | fsi->d_ptr->setFocusHelper(Qt::OtherFocusReason, true, | - | ||||||||||||||||||||||||||||||
| 1292 | false); | - | ||||||||||||||||||||||||||||||
| 1293 |                     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1294 |                     break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 1295 | } | - | ||||||||||||||||||||||||||||||
| 1296 | p = p->d_ptr->parent; | - | ||||||||||||||||||||||||||||||
| 1297 |             } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1298 |             if (!done
  | 0 | ||||||||||||||||||||||||||||||
| 1299 | QGraphicsItem *fi = subFocusItem; | - | ||||||||||||||||||||||||||||||
| 1300 |                 if (fi
 
  | 0 | ||||||||||||||||||||||||||||||
| 1301 | scene->setFocusItem(fi); | - | ||||||||||||||||||||||||||||||
| 1302 |                 } never executed:   else if (flags & QGraphicsItem::ItemIsFocusScopeend of block
  | 0 | ||||||||||||||||||||||||||||||
| 1303 |                            !scene->focusItem()
  | 0 | ||||||||||||||||||||||||||||||
| 1304 |                            q->isAncestorOf(scene->d_func()->lastFocusItem)
  | 0 | ||||||||||||||||||||||||||||||
| 1305 | q_ptr->setFocus(); | - | ||||||||||||||||||||||||||||||
| 1306 |                 } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1307 |             } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1308 |         } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||
| 1309 | - | |||||||||||||||||||||||||||||||
| 1310 |             if (hasFocus
  | 0 | ||||||||||||||||||||||||||||||
| 1311 | QGraphicsItem *p = parent; | - | ||||||||||||||||||||||||||||||
| 1312 |                 while (p
  | 0 | ||||||||||||||||||||||||||||||
| 1313 |                     if (p->flags() & QGraphicsItem::ItemIsFocusScope
  | 0 | ||||||||||||||||||||||||||||||
| 1314 |                         if (p->d_ptr->visible
  | 0 | ||||||||||||||||||||||||||||||
| 1315 | p->d_ptr->setFocusHelper(Qt::OtherFocusReason, true, | - | ||||||||||||||||||||||||||||||
| 1316 | true); | - | ||||||||||||||||||||||||||||||
| 1317 |                         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1318 |                         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 1319 | } | - | ||||||||||||||||||||||||||||||
| 1320 | p = p->d_ptr->parent; | - | ||||||||||||||||||||||||||||||
| 1321 |                 } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1322 |             } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1323 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1324 | } | - | ||||||||||||||||||||||||||||||
| 1325 | - | |||||||||||||||||||||||||||||||
| 1326 | - | |||||||||||||||||||||||||||||||
| 1327 | q_ptr->itemChange(QGraphicsItem::ItemVisibleHasChanged, newVisibleVariant); | - | ||||||||||||||||||||||||||||||
| 1328 | - | |||||||||||||||||||||||||||||||
| 1329 |     if (isObject
  | 0 | ||||||||||||||||||||||||||||||
| 1330 |         static_cast< never executed:  QGraphicsObject *>(q_ptr)->visibleChanged();static_cast<QGraphicsObject *>(q_ptr)->visibleChanged();never executed:  static_cast<QGraphicsObject *>(q_ptr)->visibleChanged(); | 0 | ||||||||||||||||||||||||||||||
| 1331 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1332 | void QGraphicsItem::setVisible(bool visible) | - | ||||||||||||||||||||||||||||||
| 1333 | { | - | ||||||||||||||||||||||||||||||
| 1334 | d_ptr->setVisibleHelper(visible, | - | ||||||||||||||||||||||||||||||
| 1335 | true, | - | ||||||||||||||||||||||||||||||
| 1336 | true, | - | ||||||||||||||||||||||||||||||
| 1337 | isPanel()); | - | ||||||||||||||||||||||||||||||
| 1338 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1339 | bool QGraphicsItem::isEnabled() const | - | ||||||||||||||||||||||||||||||
| 1340 | { | - | ||||||||||||||||||||||||||||||
| 1341 |     return never executed:   d_ptr->enabled;return d_ptr->enabled;never executed:  return d_ptr->enabled; | 0 | ||||||||||||||||||||||||||||||
| 1342 | } | - | ||||||||||||||||||||||||||||||
| 1343 | - | |||||||||||||||||||||||||||||||
| 1344 | - | |||||||||||||||||||||||||||||||
| 1345 | - | |||||||||||||||||||||||||||||||
| 1346 | - | |||||||||||||||||||||||||||||||
| 1347 | - | |||||||||||||||||||||||||||||||
| 1348 | - | |||||||||||||||||||||||||||||||
| 1349 | - | |||||||||||||||||||||||||||||||
| 1350 | void QGraphicsItemPrivate::setEnabledHelper(bool newEnabled, bool explicitly, bool update) | - | ||||||||||||||||||||||||||||||
| 1351 | { | - | ||||||||||||||||||||||||||||||
| 1352 | - | |||||||||||||||||||||||||||||||
| 1353 |     if (explicitly
  | 0 | ||||||||||||||||||||||||||||||
| 1354 |         explicitlyDisabled = newEnabled
 never executed:  explicitlyDisabled = newEnabled ? 0 : 1; | 0 | ||||||||||||||||||||||||||||||
| 1355 | - | |||||||||||||||||||||||||||||||
| 1356 | - | |||||||||||||||||||||||||||||||
| 1357 |     if (enabled == quint32(newEnabled)
  | 0 | ||||||||||||||||||||||||||||||
| 1358 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 1359 | - | |||||||||||||||||||||||||||||||
| 1360 | - | |||||||||||||||||||||||||||||||
| 1361 |     if (!newEnabled
  | 0 | ||||||||||||||||||||||||||||||
| 1362 |         if (scene
 
  | 0 | ||||||||||||||||||||||||||||||
| 1363 |             q_ptr->ungrabMouse(); never executed:  q_ptr->ungrabMouse(); | 0 | ||||||||||||||||||||||||||||||
| 1364 |         if (q_ptr->hasFocus()
  | 0 | ||||||||||||||||||||||||||||||
| 1365 | - | |||||||||||||||||||||||||||||||
| 1366 | - | |||||||||||||||||||||||||||||||
| 1367 | QGraphicsItem *focusItem = scene->focusItem(); | - | ||||||||||||||||||||||||||||||
| 1368 | bool clear = true; | - | ||||||||||||||||||||||||||||||
| 1369 |             if (isWidget
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 1370 | do { | - | ||||||||||||||||||||||||||||||
| 1371 |                     if (focusItem == q_ptr
  | 0 | ||||||||||||||||||||||||||||||
| 1372 | clear = !static_cast<QGraphicsWidget *>(q_ptr)->focusNextPrevChild(true); | - | ||||||||||||||||||||||||||||||
| 1373 |                         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 1374 | } | - | ||||||||||||||||||||||||||||||
| 1375 |                 } never executed:   while ((end of block
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 1376 |             } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1377 |             if (clear
  | 0 | ||||||||||||||||||||||||||||||
| 1378 |                 q_ptr->clearFocus(); never executed:  q_ptr->clearFocus(); | 0 | ||||||||||||||||||||||||||||||
| 1379 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1380 |         if (q_ptr->isSelected()
  | 0 | ||||||||||||||||||||||||||||||
| 1381 |             q_ptr->setSelected(false); never executed:  q_ptr->setSelected(false); | 0 | ||||||||||||||||||||||||||||||
| 1382 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1383 | - | |||||||||||||||||||||||||||||||
| 1384 | - | |||||||||||||||||||||||||||||||
| 1385 | const QVariant newEnabledVariant(q_ptr->itemChange(QGraphicsItem::ItemEnabledChange, | - | ||||||||||||||||||||||||||||||
| 1386 | quint32(newEnabled))); | - | ||||||||||||||||||||||||||||||
| 1387 | enabled = newEnabledVariant.toBool(); | - | ||||||||||||||||||||||||||||||
| 1388 | - | |||||||||||||||||||||||||||||||
| 1389 | - | |||||||||||||||||||||||||||||||
| 1390 |     if (update
  | 0 | ||||||||||||||||||||||||||||||
| 1391 |         q_ptr->update(); never executed:  q_ptr->update(); | 0 | ||||||||||||||||||||||||||||||
| 1392 | - | |||||||||||||||||||||||||||||||
| 1393 | 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) { | - | ||||||||||||||||||||||||||||||
| 1394 |         if (!newEnabled
 
  | 0 | ||||||||||||||||||||||||||||||
| 1395 |             child->d_ptr->setEnabledHelper(newEnabled, false); never executed:  child->d_ptr->setEnabledHelper(newEnabled, false); | 0 | ||||||||||||||||||||||||||||||
| 1396 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1397 | - | |||||||||||||||||||||||||||||||
| 1398 | - | |||||||||||||||||||||||||||||||
| 1399 | q_ptr->itemChange(QGraphicsItem::ItemEnabledHasChanged, newEnabledVariant); | - | ||||||||||||||||||||||||||||||
| 1400 | - | |||||||||||||||||||||||||||||||
| 1401 |     if (isObject
  | 0 | ||||||||||||||||||||||||||||||
| 1402 |         static_cast< never executed:  QGraphicsObject *>(q_ptr)->enabledChanged();static_cast<QGraphicsObject *>(q_ptr)->enabledChanged();never executed:  static_cast<QGraphicsObject *>(q_ptr)->enabledChanged(); | 0 | ||||||||||||||||||||||||||||||
| 1403 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1404 | void QGraphicsItem::setEnabled(bool enabled) | - | ||||||||||||||||||||||||||||||
| 1405 | { | - | ||||||||||||||||||||||||||||||
| 1406 | d_ptr->setEnabledHelper(enabled, true); | - | ||||||||||||||||||||||||||||||
| 1407 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1408 | bool QGraphicsItem::isSelected() const | - | ||||||||||||||||||||||||||||||
| 1409 | { | - | ||||||||||||||||||||||||||||||
| 1410 |     if (QGraphicsItemGroup *group = this->group()
  | 0 | ||||||||||||||||||||||||||||||
| 1411 |         return never executed:   group->isSelected();return group->isSelected();never executed:  return group->isSelected(); | 0 | ||||||||||||||||||||||||||||||
| 1412 |     return never executed:   d_ptr->selected;return d_ptr->selected;never executed:  return d_ptr->selected; | 0 | ||||||||||||||||||||||||||||||
| 1413 | } | - | ||||||||||||||||||||||||||||||
| 1414 | void QGraphicsItem::setSelected(bool selected) | - | ||||||||||||||||||||||||||||||
| 1415 | { | - | ||||||||||||||||||||||||||||||
| 1416 |     if (QGraphicsItemGroup *group = this->group()
  | 0 | ||||||||||||||||||||||||||||||
| 1417 | group->setSelected(selected); | - | ||||||||||||||||||||||||||||||
| 1418 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 1419 | } | - | ||||||||||||||||||||||||||||||
| 1420 | - | |||||||||||||||||||||||||||||||
| 1421 |     if (!(d_ptr->flags & ItemIsSelectable)
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 1422 |         selected = false; never executed:  selected = false; | 0 | ||||||||||||||||||||||||||||||
| 1423 |     if (d_ptr->selected == selected
  | 0 | ||||||||||||||||||||||||||||||
| 1424 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 1425 | const QVariant newSelectedVariant(itemChange(ItemSelectedChange, quint32(selected))); | - | ||||||||||||||||||||||||||||||
| 1426 | bool newSelected = newSelectedVariant.toBool(); | - | ||||||||||||||||||||||||||||||
| 1427 |     if (d_ptr->selected == newSelected
  | 0 | ||||||||||||||||||||||||||||||
| 1428 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 1429 | d_ptr->selected = newSelected; | - | ||||||||||||||||||||||||||||||
| 1430 | - | |||||||||||||||||||||||||||||||
| 1431 | update(); | - | ||||||||||||||||||||||||||||||
| 1432 |     if (d_ptr->scene
  | 0 | ||||||||||||||||||||||||||||||
| 1433 | QGraphicsScenePrivate *sceneD = d_ptr->scene->d_func(); | - | ||||||||||||||||||||||||||||||
| 1434 |         if (selected
  | 0 | ||||||||||||||||||||||||||||||
| 1435 | sceneD->selectedItems << this; | - | ||||||||||||||||||||||||||||||
| 1436 |         } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||
| 1437 | - | |||||||||||||||||||||||||||||||
| 1438 | - | |||||||||||||||||||||||||||||||
| 1439 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1440 |         if (!sceneD->selectionChanging
  | 0 | ||||||||||||||||||||||||||||||
| 1441 |             d_ptr->scene->selectionChanged(); never executed:  d_ptr->scene->selectionChanged(); | 0 | ||||||||||||||||||||||||||||||
| 1442 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1443 | - | |||||||||||||||||||||||||||||||
| 1444 | - | |||||||||||||||||||||||||||||||
| 1445 | itemChange(QGraphicsItem::ItemSelectedHasChanged, newSelectedVariant); | - | ||||||||||||||||||||||||||||||
| 1446 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1447 | qreal QGraphicsItem::opacity() const | - | ||||||||||||||||||||||||||||||
| 1448 | { | - | ||||||||||||||||||||||||||||||
| 1449 |     return never executed:   d_ptr->opacity;return d_ptr->opacity;never executed:  return d_ptr->opacity; | 0 | ||||||||||||||||||||||||||||||
| 1450 | } | - | ||||||||||||||||||||||||||||||
| 1451 | qreal QGraphicsItem::effectiveOpacity() const | - | ||||||||||||||||||||||||||||||
| 1452 | { | - | ||||||||||||||||||||||||||||||
| 1453 |     return never executed:   d_ptr->effectiveOpacity();return d_ptr->effectiveOpacity();never executed:  return d_ptr->effectiveOpacity(); | 0 | ||||||||||||||||||||||||||||||
| 1454 | } | - | ||||||||||||||||||||||||||||||
| 1455 | void QGraphicsItem::setOpacity(qreal opacity) | - | ||||||||||||||||||||||||||||||
| 1456 | { | - | ||||||||||||||||||||||||||||||
| 1457 | - | |||||||||||||||||||||||||||||||
| 1458 | const QVariant newOpacityVariant(itemChange(ItemOpacityChange, opacity)); | - | ||||||||||||||||||||||||||||||
| 1459 | - | |||||||||||||||||||||||||||||||
| 1460 | - | |||||||||||||||||||||||||||||||
| 1461 | qreal newOpacity = qBound(qreal(0), newOpacityVariant.toReal(), qreal(1)); | - | ||||||||||||||||||||||||||||||
| 1462 | - | |||||||||||||||||||||||||||||||
| 1463 | - | |||||||||||||||||||||||||||||||
| 1464 |     if (newOpacity == d_ptr->opacity
  | 0 | ||||||||||||||||||||||||||||||
| 1465 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 1466 | - | |||||||||||||||||||||||||||||||
| 1467 | bool wasFullyTransparent = d_ptr->isOpacityNull(); | - | ||||||||||||||||||||||||||||||
| 1468 | d_ptr->opacity = newOpacity; | - | ||||||||||||||||||||||||||||||
| 1469 | - | |||||||||||||||||||||||||||||||
| 1470 | - | |||||||||||||||||||||||||||||||
| 1471 | itemChange(ItemOpacityHasChanged, newOpacityVariant); | - | ||||||||||||||||||||||||||||||
| 1472 | - | |||||||||||||||||||||||||||||||
| 1473 | - | |||||||||||||||||||||||||||||||
| 1474 |     if (d_ptr->scene
  | 0 | ||||||||||||||||||||||||||||||
| 1475 | - | |||||||||||||||||||||||||||||||
| 1476 | d_ptr->invalidateParentGraphicsEffectsRecursively(); | - | ||||||||||||||||||||||||||||||
| 1477 |         if (!(d_ptr->flags & ItemDoesntPropagateOpacityToChildren)
  | 0 | ||||||||||||||||||||||||||||||
| 1478 |             d_ptr->invalidateChildGraphicsEffectsRecursively(QGraphicsItemPrivate::OpacityChanged); never executed:  d_ptr->invalidateChildGraphicsEffectsRecursively(QGraphicsItemPrivate::OpacityChanged); | 0 | ||||||||||||||||||||||||||||||
| 1479 | - | |||||||||||||||||||||||||||||||
| 1480 | d_ptr->scene->d_func()->markDirty(this, QRectF(), | - | ||||||||||||||||||||||||||||||
| 1481 | true, | - | ||||||||||||||||||||||||||||||
| 1482 | false, | - | ||||||||||||||||||||||||||||||
| 1483 | d_ptr->isOpacityNull()); | - | ||||||||||||||||||||||||||||||
| 1484 |         if (wasFullyTransparent
  | 0 | ||||||||||||||||||||||||||||||
| 1485 |             d_ptr->paintedViewBoundingRectsNeedRepaint = 1; never executed:  d_ptr->paintedViewBoundingRectsNeedRepaint = 1; | 0 | ||||||||||||||||||||||||||||||
| 1486 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1487 | - | |||||||||||||||||||||||||||||||
| 1488 |     if (d_ptr->isObject
  | 0 | ||||||||||||||||||||||||||||||
| 1489 |         static_cast< never executed:  QGraphicsObject *>(this)->opacityChanged();static_cast<QGraphicsObject *>(this)->opacityChanged();never executed:  static_cast<QGraphicsObject *>(this)->opacityChanged(); | 0 | ||||||||||||||||||||||||||||||
| 1490 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1491 | - | |||||||||||||||||||||||||||||||
| 1492 | - | |||||||||||||||||||||||||||||||
| 1493 | - | |||||||||||||||||||||||||||||||
| 1494 | - | |||||||||||||||||||||||||||||||
| 1495 | - | |||||||||||||||||||||||||||||||
| 1496 | - | |||||||||||||||||||||||||||||||
| 1497 | - | |||||||||||||||||||||||||||||||
| 1498 | QGraphicsEffect *QGraphicsItem::graphicsEffect() const | - | ||||||||||||||||||||||||||||||
| 1499 | { | - | ||||||||||||||||||||||||||||||
| 1500 |     return never executed:   d_ptr->graphicsEffect;return d_ptr->graphicsEffect;never executed:  return d_ptr->graphicsEffect; | 0 | ||||||||||||||||||||||||||||||
| 1501 | } | - | ||||||||||||||||||||||||||||||
| 1502 | void QGraphicsItem::setGraphicsEffect(QGraphicsEffect *effect) | - | ||||||||||||||||||||||||||||||
| 1503 | { | - | ||||||||||||||||||||||||||||||
| 1504 |     if (d_ptr->graphicsEffect == effect
  | 0 | ||||||||||||||||||||||||||||||
| 1505 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 1506 | - | |||||||||||||||||||||||||||||||
| 1507 |     if (d_ptr->graphicsEffect
  | 0 | ||||||||||||||||||||||||||||||
| 1508 | delete d_ptr->graphicsEffect; | - | ||||||||||||||||||||||||||||||
| 1509 | d_ptr->graphicsEffect = 0; | - | ||||||||||||||||||||||||||||||
| 1510 |     } never executed:   else if (d_ptr->parentend of block
  | 0 | ||||||||||||||||||||||||||||||
| 1511 | d_ptr->parent->d_ptr->updateChildWithGraphicsEffectFlagRecursively(); | - | ||||||||||||||||||||||||||||||
| 1512 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1513 | - | |||||||||||||||||||||||||||||||
| 1514 |     if (effect
  | 0 | ||||||||||||||||||||||||||||||
| 1515 | - | |||||||||||||||||||||||||||||||
| 1516 | QGraphicsEffectSourcePrivate *sourced = new QGraphicsItemEffectSourcePrivate(this); | - | ||||||||||||||||||||||||||||||
| 1517 | QGraphicsEffectSource *source = new QGraphicsEffectSource(*sourced); | - | ||||||||||||||||||||||||||||||
| 1518 | d_ptr->graphicsEffect = effect; | - | ||||||||||||||||||||||||||||||
| 1519 | effect->d_func()->setGraphicsEffectSource(source); | - | ||||||||||||||||||||||||||||||
| 1520 | prepareGeometryChange(); | - | ||||||||||||||||||||||||||||||
| 1521 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1522 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1523 | - | |||||||||||||||||||||||||||||||
| 1524 | - | |||||||||||||||||||||||||||||||
| 1525 | void QGraphicsItemPrivate::updateChildWithGraphicsEffectFlagRecursively() | - | ||||||||||||||||||||||||||||||
| 1526 | { | - | ||||||||||||||||||||||||||||||
| 1527 | - | |||||||||||||||||||||||||||||||
| 1528 | QGraphicsItemPrivate *itemPrivate = this; | - | ||||||||||||||||||||||||||||||
| 1529 | do { | - | ||||||||||||||||||||||||||||||
| 1530 | - | |||||||||||||||||||||||||||||||
| 1531 |         if (itemPrivate->mayHaveChildWithGraphicsEffect
  | 0 | ||||||||||||||||||||||||||||||
| 1532 |             return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 1533 | itemPrivate->mayHaveChildWithGraphicsEffect = 1; | - | ||||||||||||||||||||||||||||||
| 1534 |     } never executed:   while ((end of block
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 1535 | - | |||||||||||||||||||||||||||||||
| 1536 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1537 | QRectF QGraphicsItemPrivate::effectiveBoundingRect(const QRectF &rect) const | - | ||||||||||||||||||||||||||||||
| 1538 | { | - | ||||||||||||||||||||||||||||||
| 1539 | - | |||||||||||||||||||||||||||||||
| 1540 | const QGraphicsItem * const q = q_func(); | - | ||||||||||||||||||||||||||||||
| 1541 | QGraphicsEffect *effect = graphicsEffect; | - | ||||||||||||||||||||||||||||||
| 1542 |     if (scene
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 1543 |         if (scene->d_func()->views.isEmpty()
  | 0 | ||||||||||||||||||||||||||||||
| 1544 |             return never executed:   effect->boundingRectFor(rect);return effect->boundingRectFor(rect);never executed:  return effect->boundingRectFor(rect); | 0 | ||||||||||||||||||||||||||||||
| 1545 | QRectF sceneRect = q->mapRectToScene(rect); | - | ||||||||||||||||||||||||||||||
| 1546 | QRectF sceneEffectRect; | - | ||||||||||||||||||||||||||||||
| 1547 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(scene->views())>::type> _container_((scene->views())); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QGraphicsView *view = *_container_.i; _container_.control; _container_.control = 0) { | - | ||||||||||||||||||||||||||||||
| 1548 | QRectF deviceRect = view->d_func()->mapRectFromScene(sceneRect); | - | ||||||||||||||||||||||||||||||
| 1549 | QRect deviceEffectRect = effect->boundingRectFor(deviceRect).toAlignedRect(); | - | ||||||||||||||||||||||||||||||
| 1550 | sceneEffectRect |= view->d_func()->mapRectToScene(deviceEffectRect); | - | ||||||||||||||||||||||||||||||
| 1551 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1552 |         return never executed:   q->mapRectFromScene(sceneEffectRect);return q->mapRectFromScene(sceneEffectRect);never executed:  return q->mapRectFromScene(sceneEffectRect); | 0 | ||||||||||||||||||||||||||||||
| 1553 | } | - | ||||||||||||||||||||||||||||||
| 1554 | - | |||||||||||||||||||||||||||||||
| 1555 |     return never executed:   rect;return rect;never executed:  return rect; | 0 | ||||||||||||||||||||||||||||||
| 1556 | } | - | ||||||||||||||||||||||||||||||
| 1557 | QRectF QGraphicsItemPrivate::effectiveBoundingRect(QGraphicsItem *topMostEffectItem) const | - | ||||||||||||||||||||||||||||||
| 1558 | { | - | ||||||||||||||||||||||||||||||
| 1559 | - | |||||||||||||||||||||||||||||||
| 1560 | const QGraphicsItem * const q = q_func(); | - | ||||||||||||||||||||||||||||||
| 1561 | QRectF brect = effectiveBoundingRect(q_ptr->boundingRect()); | - | ||||||||||||||||||||||||||||||
| 1562 |     if (ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren
  | 0 | ||||||||||||||||||||||||||||||
| 1563 |         || ancestorFlags & QGraphicsItemPrivate::AncestorContainsChildren
  | 0 | ||||||||||||||||||||||||||||||
| 1564 |         || topMostEffectItem == q
  | 0 | ||||||||||||||||||||||||||||||
| 1565 |         return never executed:   brect;return brect;never executed:  return brect; | 0 | ||||||||||||||||||||||||||||||
| 1566 | - | |||||||||||||||||||||||||||||||
| 1567 | const QGraphicsItem *effectParent = parent; | - | ||||||||||||||||||||||||||||||
| 1568 |     while (effectParent
  | 0 | ||||||||||||||||||||||||||||||
| 1569 | QGraphicsEffect *effect = effectParent->d_ptr->graphicsEffect; | - | ||||||||||||||||||||||||||||||
| 1570 |         if (scene
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 1571 | const QRectF brectInParentSpace = q->mapRectToItem(effectParent, brect); | - | ||||||||||||||||||||||||||||||
| 1572 | const QRectF effectRectInParentSpace = effectParent->d_ptr->effectiveBoundingRect(brectInParentSpace); | - | ||||||||||||||||||||||||||||||
| 1573 | brect = effectParent->mapRectToItem(q, effectRectInParentSpace); | - | ||||||||||||||||||||||||||||||
| 1574 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1575 |         if (effectParent->d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren
  | 0 | ||||||||||||||||||||||||||||||
| 1576 |             || effectParent->d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorContainsChildren
  | 0 | ||||||||||||||||||||||||||||||
| 1577 |             || topMostEffectItem == effectParent
  | 0 | ||||||||||||||||||||||||||||||
| 1578 |             return never executed:   brect;return brect;never executed:  return brect; | 0 | ||||||||||||||||||||||||||||||
| 1579 | } | - | ||||||||||||||||||||||||||||||
| 1580 | effectParent = effectParent->d_ptr->parent; | - | ||||||||||||||||||||||||||||||
| 1581 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1582 | - | |||||||||||||||||||||||||||||||
| 1583 |     return never executed:   brect;return brect;never executed:  return brect; | 0 | ||||||||||||||||||||||||||||||
| 1584 | - | |||||||||||||||||||||||||||||||
| 1585 | - | |||||||||||||||||||||||||||||||
| 1586 | - | |||||||||||||||||||||||||||||||
| 1587 | - | |||||||||||||||||||||||||||||||
| 1588 | } | - | ||||||||||||||||||||||||||||||
| 1589 | QRectF QGraphicsItemPrivate::sceneEffectiveBoundingRect() const | - | ||||||||||||||||||||||||||||||
| 1590 | { | - | ||||||||||||||||||||||||||||||
| 1591 | - | |||||||||||||||||||||||||||||||
| 1592 | - | |||||||||||||||||||||||||||||||
| 1593 | QPointF offset; | - | ||||||||||||||||||||||||||||||
| 1594 | const QGraphicsItem *parentItem = q_ptr; | - | ||||||||||||||||||||||||||||||
| 1595 | const QGraphicsItemPrivate *itemd; | - | ||||||||||||||||||||||||||||||
| 1596 | do { | - | ||||||||||||||||||||||||||||||
| 1597 | itemd = parentItem->d_ptr.data(); | - | ||||||||||||||||||||||||||||||
| 1598 |         if (itemd->transformData
  | 0 | ||||||||||||||||||||||||||||||
| 1599 |             break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 1600 | offset += itemd->pos; | - | ||||||||||||||||||||||||||||||
| 1601 |     } never executed:   while ((end of block
 
  | 0 | ||||||||||||||||||||||||||||||
| 1602 | - | |||||||||||||||||||||||||||||||
| 1603 | QRectF br = effectiveBoundingRect(); | - | ||||||||||||||||||||||||||||||
| 1604 | br.translate(offset); | - | ||||||||||||||||||||||||||||||
| 1605 |     return never executed:   !parentItemreturn !parentItem ? br : parentItem->sceneTransform().mapRect(br);
 never executed:  return !parentItem ? br : parentItem->sceneTransform().mapRect(br); | 0 | ||||||||||||||||||||||||||||||
| 1606 | } | - | ||||||||||||||||||||||||||||||
| 1607 | bool QGraphicsItem::acceptDrops() const | - | ||||||||||||||||||||||||||||||
| 1608 | { | - | ||||||||||||||||||||||||||||||
| 1609 |     return never executed:   d_ptr->acceptDrops;return d_ptr->acceptDrops;never executed:  return d_ptr->acceptDrops; | 0 | ||||||||||||||||||||||||||||||
| 1610 | } | - | ||||||||||||||||||||||||||||||
| 1611 | void QGraphicsItem::setAcceptDrops(bool on) | - | ||||||||||||||||||||||||||||||
| 1612 | { | - | ||||||||||||||||||||||||||||||
| 1613 | d_ptr->acceptDrops = on; | - | ||||||||||||||||||||||||||||||
| 1614 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1615 | Qt::MouseButtons QGraphicsItem::acceptedMouseButtons() const | - | ||||||||||||||||||||||||||||||
| 1616 | { | - | ||||||||||||||||||||||||||||||
| 1617 |     return never executed:   Qt::MouseButtons(d_ptr->acceptedMouseButtons);return Qt::MouseButtons(d_ptr->acceptedMouseButtons);never executed:  return Qt::MouseButtons(d_ptr->acceptedMouseButtons); | 0 | ||||||||||||||||||||||||||||||
| 1618 | } | - | ||||||||||||||||||||||||||||||
| 1619 | void QGraphicsItem::setAcceptedMouseButtons(Qt::MouseButtons buttons) | - | ||||||||||||||||||||||||||||||
| 1620 | { | - | ||||||||||||||||||||||||||||||
| 1621 |     if (Qt::MouseButtons(d_ptr->acceptedMouseButtons) != buttons
  | 0 | ||||||||||||||||||||||||||||||
| 1622 |         if (buttons == 0
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 1623 |             && d_ptr->scene->d_func()->lastMouseGrabberItemHasImplicitMouseGrab
  | 0 | ||||||||||||||||||||||||||||||
| 1624 | ungrabMouse(); | - | ||||||||||||||||||||||||||||||
| 1625 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1626 | d_ptr->acceptedMouseButtons = quint32(buttons); | - | ||||||||||||||||||||||||||||||
| 1627 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1628 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1629 | bool QGraphicsItem::acceptHoverEvents() const | - | ||||||||||||||||||||||||||||||
| 1630 | { | - | ||||||||||||||||||||||||||||||
| 1631 |     return never executed:   d_ptr->acceptsHover;return d_ptr->acceptsHover;never executed:  return d_ptr->acceptsHover; | 0 | ||||||||||||||||||||||||||||||
| 1632 | } | - | ||||||||||||||||||||||||||||||
| 1633 | void QGraphicsItem::setAcceptHoverEvents(bool enabled) | - | ||||||||||||||||||||||||||||||
| 1634 | { | - | ||||||||||||||||||||||||||||||
| 1635 |     if (d_ptr->acceptsHover == quint32(enabled)
  | 0 | ||||||||||||||||||||||||||||||
| 1636 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 1637 | d_ptr->acceptsHover = quint32(enabled); | - | ||||||||||||||||||||||||||||||
| 1638 |     if (d_ptr->acceptsHover
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 1639 | d_ptr->scene->d_func()->allItemsIgnoreHoverEvents = false; | - | ||||||||||||||||||||||||||||||
| 1640 | d_ptr->scene->d_func()->enableMouseTrackingOnViews(); | - | ||||||||||||||||||||||||||||||
| 1641 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1642 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1643 | bool QGraphicsItem::acceptTouchEvents() const | - | ||||||||||||||||||||||||||||||
| 1644 | { | - | ||||||||||||||||||||||||||||||
| 1645 |     return never executed:   d_ptr->acceptTouchEvents;return d_ptr->acceptTouchEvents;never executed:  return d_ptr->acceptTouchEvents; | 0 | ||||||||||||||||||||||||||||||
| 1646 | } | - | ||||||||||||||||||||||||||||||
| 1647 | void QGraphicsItem::setAcceptTouchEvents(bool enabled) | - | ||||||||||||||||||||||||||||||
| 1648 | { | - | ||||||||||||||||||||||||||||||
| 1649 |     if (d_ptr->acceptTouchEvents == quint32(enabled)
  | 0 | ||||||||||||||||||||||||||||||
| 1650 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 1651 | d_ptr->acceptTouchEvents = quint32(enabled); | - | ||||||||||||||||||||||||||||||
| 1652 |     if (d_ptr->acceptTouchEvents
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 1653 | d_ptr->scene->d_func()->allItemsIgnoreTouchEvents = false; | - | ||||||||||||||||||||||||||||||
| 1654 | d_ptr->scene->d_func()->enableTouchEventsOnViews(); | - | ||||||||||||||||||||||||||||||
| 1655 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1656 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1657 | bool QGraphicsItem::filtersChildEvents() const | - | ||||||||||||||||||||||||||||||
| 1658 | { | - | ||||||||||||||||||||||||||||||
| 1659 |     return never executed:   d_ptr->filtersDescendantEvents;return d_ptr->filtersDescendantEvents;never executed:  return d_ptr->filtersDescendantEvents; | 0 | ||||||||||||||||||||||||||||||
| 1660 | } | - | ||||||||||||||||||||||||||||||
| 1661 | void QGraphicsItem::setFiltersChildEvents(bool enabled) | - | ||||||||||||||||||||||||||||||
| 1662 | { | - | ||||||||||||||||||||||||||||||
| 1663 |     if (d_ptr->filtersDescendantEvents == enabled
  | 0 | ||||||||||||||||||||||||||||||
| 1664 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 1665 | - | |||||||||||||||||||||||||||||||
| 1666 | d_ptr->filtersDescendantEvents = enabled; | - | ||||||||||||||||||||||||||||||
| 1667 | d_ptr->updateAncestorFlag(QGraphicsItem::GraphicsItemFlag(-2)); | - | ||||||||||||||||||||||||||||||
| 1668 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1669 | bool QGraphicsItem::handlesChildEvents() const | - | ||||||||||||||||||||||||||||||
| 1670 | { | - | ||||||||||||||||||||||||||||||
| 1671 |     return never executed:   d_ptr->handlesChildEvents;return d_ptr->handlesChildEvents;never executed:  return d_ptr->handlesChildEvents; | 0 | ||||||||||||||||||||||||||||||
| 1672 | } | - | ||||||||||||||||||||||||||||||
| 1673 | void QGraphicsItem::setHandlesChildEvents(bool enabled) | - | ||||||||||||||||||||||||||||||
| 1674 | { | - | ||||||||||||||||||||||||||||||
| 1675 |     if (d_ptr->handlesChildEvents == enabled
  | 0 | ||||||||||||||||||||||||||||||
| 1676 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 1677 | - | |||||||||||||||||||||||||||||||
| 1678 | d_ptr->handlesChildEvents = enabled; | - | ||||||||||||||||||||||||||||||
| 1679 | d_ptr->updateAncestorFlag(QGraphicsItem::GraphicsItemFlag(-1)); | - | ||||||||||||||||||||||||||||||
| 1680 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1681 | bool QGraphicsItem::isActive() const | - | ||||||||||||||||||||||||||||||
| 1682 | { | - | ||||||||||||||||||||||||||||||
| 1683 |     if (!d_ptr->scene
 
  | 0 | ||||||||||||||||||||||||||||||
| 1684 |         return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||
| 1685 |     return never executed:   panel() == d_ptr->scene->activePanel();return panel() == d_ptr->scene->activePanel();never executed:  return panel() == d_ptr->scene->activePanel(); | 0 | ||||||||||||||||||||||||||||||
| 1686 | } | - | ||||||||||||||||||||||||||||||
| 1687 | void QGraphicsItem::setActive(bool active) | - | ||||||||||||||||||||||||||||||
| 1688 | { | - | ||||||||||||||||||||||||||||||
| 1689 | d_ptr->explicitActivate = 1; | - | ||||||||||||||||||||||||||||||
| 1690 | d_ptr->wantsActive = active; | - | ||||||||||||||||||||||||||||||
| 1691 |     if (d_ptr->scene
  | 0 | ||||||||||||||||||||||||||||||
| 1692 |         if (active
  | 0 | ||||||||||||||||||||||||||||||
| 1693 | - | |||||||||||||||||||||||||||||||
| 1694 | d_ptr->scene->setActivePanel(this); | - | ||||||||||||||||||||||||||||||
| 1695 |         } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||
| 1696 | QGraphicsItem *activePanel = d_ptr->scene->activePanel(); | - | ||||||||||||||||||||||||||||||
| 1697 | QGraphicsItem *thisPanel = panel(); | - | ||||||||||||||||||||||||||||||
| 1698 |             if (!activePanel
 
  | 0 | ||||||||||||||||||||||||||||||
| 1699 | - | |||||||||||||||||||||||||||||||
| 1700 | - | |||||||||||||||||||||||||||||||
| 1701 | QGraphicsItem *nextToActivate = 0; | - | ||||||||||||||||||||||||||||||
| 1702 |                 if (d_ptr->parent
  | 0 | ||||||||||||||||||||||||||||||
| 1703 |                     nextToActivate = d_ptr->parent->panel(); never executed:  nextToActivate = d_ptr->parent->panel(); | 0 | ||||||||||||||||||||||||||||||
| 1704 |                 if (!nextToActivate
  | 0 | ||||||||||||||||||||||||||||||
| 1705 |                     nextToActivate = d_ptr->scene->d_func()->lastActivePanel; never executed:  nextToActivate = d_ptr->scene->d_func()->lastActivePanel; | 0 | ||||||||||||||||||||||||||||||
| 1706 |                 if (nextToActivate == this
 
  | 0 | ||||||||||||||||||||||||||||||
| 1707 |                     nextToActivate = 0; never executed:  nextToActivate = 0; | 0 | ||||||||||||||||||||||||||||||
| 1708 | d_ptr->scene->setActivePanel(nextToActivate); | - | ||||||||||||||||||||||||||||||
| 1709 |             } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1710 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1711 | } | - | ||||||||||||||||||||||||||||||
| 1712 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1713 | - | |||||||||||||||||||||||||||||||
| 1714 | - | |||||||||||||||||||||||||||||||
| 1715 | - | |||||||||||||||||||||||||||||||
| 1716 | - | |||||||||||||||||||||||||||||||
| 1717 | - | |||||||||||||||||||||||||||||||
| 1718 | - | |||||||||||||||||||||||||||||||
| 1719 | - | |||||||||||||||||||||||||||||||
| 1720 | bool QGraphicsItem::hasFocus() const | - | ||||||||||||||||||||||||||||||
| 1721 | { | - | ||||||||||||||||||||||||||||||
| 1722 |     if (!d_ptr->scene
 
  | 0 | ||||||||||||||||||||||||||||||
| 1723 |         return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||
| 1724 | - | |||||||||||||||||||||||||||||||
| 1725 |     if (d_ptr->focusProxy
  | 0 | ||||||||||||||||||||||||||||||
| 1726 |         return never executed:   d_ptr->focusProxy->hasFocus();return d_ptr->focusProxy->hasFocus();never executed:  return d_ptr->focusProxy->hasFocus(); | 0 | ||||||||||||||||||||||||||||||
| 1727 | - | |||||||||||||||||||||||||||||||
| 1728 |     if (d_ptr->scene->d_func()->focusItem != this
  | 0 | ||||||||||||||||||||||||||||||
| 1729 |         return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||
| 1730 | - | |||||||||||||||||||||||||||||||
| 1731 |     return never executed:   panel() == d_ptr->scene->d_func()->activePanel;return panel() == d_ptr->scene->d_func()->activePanel;never executed:  return panel() == d_ptr->scene->d_func()->activePanel; | 0 | ||||||||||||||||||||||||||||||
| 1732 | } | - | ||||||||||||||||||||||||||||||
| 1733 | void QGraphicsItem::setFocus(Qt::FocusReason focusReason) | - | ||||||||||||||||||||||||||||||
| 1734 | { | - | ||||||||||||||||||||||||||||||
| 1735 | d_ptr->setFocusHelper(focusReason, true, false); | - | ||||||||||||||||||||||||||||||
| 1736 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1737 | - | |||||||||||||||||||||||||||||||
| 1738 | - | |||||||||||||||||||||||||||||||
| 1739 | - | |||||||||||||||||||||||||||||||
| 1740 | - | |||||||||||||||||||||||||||||||
| 1741 | void QGraphicsItemPrivate::setFocusHelper(Qt::FocusReason focusReason, bool climb, bool focusFromHide) | - | ||||||||||||||||||||||||||||||
| 1742 | { | - | ||||||||||||||||||||||||||||||
| 1743 | - | |||||||||||||||||||||||||||||||
| 1744 |     if (!q_ptr->isEnabled()
 
  | 0 | ||||||||||||||||||||||||||||||
| 1745 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 1746 | - | |||||||||||||||||||||||||||||||
| 1747 | - | |||||||||||||||||||||||||||||||
| 1748 | QGraphicsItem *f = q_ptr; | - | ||||||||||||||||||||||||||||||
| 1749 |     while (f->d_ptr->focusProxy
  | 0 | ||||||||||||||||||||||||||||||
| 1750 |         f = f->d_ptr->focusProxy; never executed:  f = f->d_ptr->focusProxy; | 0 | ||||||||||||||||||||||||||||||
| 1751 | - | |||||||||||||||||||||||||||||||
| 1752 | - | |||||||||||||||||||||||||||||||
| 1753 |     if (scene
 
  | 0 | ||||||||||||||||||||||||||||||
| 1754 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 1755 | - | |||||||||||||||||||||||||||||||
| 1756 | - | |||||||||||||||||||||||||||||||
| 1757 | QGraphicsItem *p = parent; | - | ||||||||||||||||||||||||||||||
| 1758 |     while (p
  | 0 | ||||||||||||||||||||||||||||||
| 1759 |         if (p->flags() & QGraphicsItem::ItemIsFocusScope
  | 0 | ||||||||||||||||||||||||||||||
| 1760 | QGraphicsItem *oldFocusScopeItem = p->d_ptr->focusScopeItem; | - | ||||||||||||||||||||||||||||||
| 1761 | p->d_ptr->focusScopeItem = q_ptr; | - | ||||||||||||||||||||||||||||||
| 1762 |             if (oldFocusScopeItem
  | 0 | ||||||||||||||||||||||||||||||
| 1763 |                 oldFocusScopeItem->d_ptr->focusScopeItemChange(false); never executed:  oldFocusScopeItem->d_ptr->focusScopeItemChange(false); | 0 | ||||||||||||||||||||||||||||||
| 1764 | focusScopeItemChange(true); | - | ||||||||||||||||||||||||||||||
| 1765 |             if (!p->focusItem()
 
  | 0 | ||||||||||||||||||||||||||||||
| 1766 | - | |||||||||||||||||||||||||||||||
| 1767 | - | |||||||||||||||||||||||||||||||
| 1768 | - | |||||||||||||||||||||||||||||||
| 1769 | - | |||||||||||||||||||||||||||||||
| 1770 |                 return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 1771 | } | - | ||||||||||||||||||||||||||||||
| 1772 |             break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 1773 | } | - | ||||||||||||||||||||||||||||||
| 1774 | p = p->d_ptr->parent; | - | ||||||||||||||||||||||||||||||
| 1775 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1776 | - | |||||||||||||||||||||||||||||||
| 1777 |     if (climb
  | 0 | ||||||||||||||||||||||||||||||
| 1778 |         while (f->d_ptr->focusScopeItem
 
  | 0 | ||||||||||||||||||||||||||||||
| 1779 |             f = f->d_ptr->focusScopeItem; never executed:  f = f->d_ptr->focusScopeItem; | 0 | ||||||||||||||||||||||||||||||
| 1780 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1781 | - | |||||||||||||||||||||||||||||||
| 1782 | - | |||||||||||||||||||||||||||||||
| 1783 | QGraphicsItem *commonAncestor = 0; | - | ||||||||||||||||||||||||||||||
| 1784 |     if (scene
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 1785 | commonAncestor = scene->focusItem()->commonAncestorItem(f); | - | ||||||||||||||||||||||||||||||
| 1786 | scene->focusItem()->d_ptr->clearSubFocus(scene->focusItem(), commonAncestor); | - | ||||||||||||||||||||||||||||||
| 1787 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1788 | - | |||||||||||||||||||||||||||||||
| 1789 | f->d_ptr->setSubFocus(f, commonAncestor); | - | ||||||||||||||||||||||||||||||
| 1790 | - | |||||||||||||||||||||||||||||||
| 1791 | - | |||||||||||||||||||||||||||||||
| 1792 |     if (scene
  | 0 | ||||||||||||||||||||||||||||||
| 1793 | QGraphicsItem *p = q_ptr->panel(); | - | ||||||||||||||||||||||||||||||
| 1794 |         if ((!p
 
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 1795 | - | |||||||||||||||||||||||||||||||
| 1796 | scene->d_func()->setFocusItemHelper(f, focusReason); | - | ||||||||||||||||||||||||||||||
| 1797 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1798 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1799 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1800 | void QGraphicsItem::clearFocus() | - | ||||||||||||||||||||||||||||||
| 1801 | { | - | ||||||||||||||||||||||||||||||
| 1802 | d_ptr->clearFocusHelper( true, | - | ||||||||||||||||||||||||||||||
| 1803 | false); | - | ||||||||||||||||||||||||||||||
| 1804 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1805 | - | |||||||||||||||||||||||||||||||
| 1806 | - | |||||||||||||||||||||||||||||||
| 1807 | - | |||||||||||||||||||||||||||||||
| 1808 | - | |||||||||||||||||||||||||||||||
| 1809 | void QGraphicsItemPrivate::clearFocusHelper(bool giveFocusToParent, bool hiddenByParentPanel) | - | ||||||||||||||||||||||||||||||
| 1810 | { | - | ||||||||||||||||||||||||||||||
| 1811 | QGraphicsItem *subFocusItem = q_ptr; | - | ||||||||||||||||||||||||||||||
| 1812 |     if (flags & QGraphicsItem::ItemIsFocusScope
  | 0 | ||||||||||||||||||||||||||||||
| 1813 |         while (subFocusItem->d_ptr->focusScopeItem
  | 0 | ||||||||||||||||||||||||||||||
| 1814 |             subFocusItem = subFocusItem->d_ptr->focusScopeItem; never executed:  subFocusItem = subFocusItem->d_ptr->focusScopeItem; | 0 | ||||||||||||||||||||||||||||||
| 1815 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1816 | - | |||||||||||||||||||||||||||||||
| 1817 |     if (giveFocusToParent
  | 0 | ||||||||||||||||||||||||||||||
| 1818 | - | |||||||||||||||||||||||||||||||
| 1819 |         if (!inDestructor
  | 0 | ||||||||||||||||||||||||||||||
| 1820 | QGraphicsItem *p = parent; | - | ||||||||||||||||||||||||||||||
| 1821 |             while (p
  | 0 | ||||||||||||||||||||||||||||||
| 1822 |                 if (p->flags() & QGraphicsItem::ItemIsFocusScope
  | 0 | ||||||||||||||||||||||||||||||
| 1823 |                     if (p->d_ptr->focusScopeItem == q_ptr
  | 0 | ||||||||||||||||||||||||||||||
| 1824 | p->d_ptr->focusScopeItem = 0; | - | ||||||||||||||||||||||||||||||
| 1825 |                         if (!subFocusItem->hasFocus()
  | 0 | ||||||||||||||||||||||||||||||
| 1826 |                             focusScopeItemChange(false); never executed:  focusScopeItemChange(false); | 0 | ||||||||||||||||||||||||||||||
| 1827 |                     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1828 |                     if (subFocusItem->hasFocus()
  | 0 | ||||||||||||||||||||||||||||||
| 1829 |                         p->d_ptr->setFocusHelper(Qt::OtherFocusReason, false, never executed:  p->d_ptr->setFocusHelper(Qt::OtherFocusReason, false, false); | 0 | ||||||||||||||||||||||||||||||
| 1830 |                                                                        false); never executed:  p->d_ptr->setFocusHelper(Qt::OtherFocusReason, false, false); | 0 | ||||||||||||||||||||||||||||||
| 1831 |                     return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 1832 | } | - | ||||||||||||||||||||||||||||||
| 1833 | p = p->d_ptr->parent; | - | ||||||||||||||||||||||||||||||
| 1834 |             } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1835 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1836 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1837 | - | |||||||||||||||||||||||||||||||
| 1838 |     if (subFocusItem->hasFocus()
  | 0 | ||||||||||||||||||||||||||||||
| 1839 | - | |||||||||||||||||||||||||||||||
| 1840 |         if (!hiddenByParentPanel
  | 0 | ||||||||||||||||||||||||||||||
| 1841 |             clearSubFocus(q_ptr); never executed:  clearSubFocus(q_ptr); | 0 | ||||||||||||||||||||||||||||||
| 1842 | - | |||||||||||||||||||||||||||||||
| 1843 | - | |||||||||||||||||||||||||||||||
| 1844 | scene->setFocusItem(0); | - | ||||||||||||||||||||||||||||||
| 1845 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1846 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1847 | QGraphicsItem *QGraphicsItem::focusProxy() const | - | ||||||||||||||||||||||||||||||
| 1848 | { | - | ||||||||||||||||||||||||||||||
| 1849 |     return never executed:   d_ptr->focusProxy;return d_ptr->focusProxy;never executed:  return d_ptr->focusProxy; | 0 | ||||||||||||||||||||||||||||||
| 1850 | } | - | ||||||||||||||||||||||||||||||
| 1851 | void QGraphicsItem::setFocusProxy(QGraphicsItem *item) | - | ||||||||||||||||||||||||||||||
| 1852 | { | - | ||||||||||||||||||||||||||||||
| 1853 |     if (item == d_ptr->focusProxy
  | 0 | ||||||||||||||||||||||||||||||
| 1854 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 1855 |     if (item == this
  | 0 | ||||||||||||||||||||||||||||||
| 1856 | QMessageLogger(__FILE__, 3452, __PRETTY_FUNCTION__).warning("QGraphicsItem::setFocusProxy: cannot assign self as focus proxy"); | - | ||||||||||||||||||||||||||||||
| 1857 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 1858 | } | - | ||||||||||||||||||||||||||||||
| 1859 |     if (item
  | 0 | ||||||||||||||||||||||||||||||
| 1860 |         if (item->d_ptr->scene != d_ptr->scene
  | 0 | ||||||||||||||||||||||||||||||
| 1861 | QMessageLogger(__FILE__, 3457, __PRETTY_FUNCTION__).warning("QGraphicsItem::setFocusProxy: focus proxy must be in same scene"); | - | ||||||||||||||||||||||||||||||
| 1862 |             return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 1863 | } | - | ||||||||||||||||||||||||||||||
| 1864 |         for (QGraphicsItem *f = item->focusProxy(); f != 0
  | 0 | ||||||||||||||||||||||||||||||
| 1865 |             if (f == this
  | 0 | ||||||||||||||||||||||||||||||
| 1866 | QMessageLogger(__FILE__, 3462, __PRETTY_FUNCTION__).warning("QGraphicsItem::setFocusProxy: %p is already in the focus proxy chain", item); | - | ||||||||||||||||||||||||||||||
| 1867 |                 return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 1868 | } | - | ||||||||||||||||||||||||||||||
| 1869 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1870 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1871 | - | |||||||||||||||||||||||||||||||
| 1872 | QGraphicsItem *lastFocusProxy = d_ptr->focusProxy; | - | ||||||||||||||||||||||||||||||
| 1873 |     if (lastFocusProxy
  | 0 | ||||||||||||||||||||||||||||||
| 1874 |         lastFocusProxy->d_ptr->focusProxyRefs.removeOne(&d_ptr->focusProxy); never executed:  lastFocusProxy->d_ptr->focusProxyRefs.removeOne(&d_ptr->focusProxy); | 0 | ||||||||||||||||||||||||||||||
| 1875 | d_ptr->focusProxy = item; | - | ||||||||||||||||||||||||||||||
| 1876 |     if (item
  | 0 | ||||||||||||||||||||||||||||||
| 1877 |         item->d_ptr->focusProxyRefs << &d_ptr->focusProxy; never executed:  item->d_ptr->focusProxyRefs << &d_ptr->focusProxy; | 0 | ||||||||||||||||||||||||||||||
| 1878 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1879 | QGraphicsItem *QGraphicsItem::focusItem() const | - | ||||||||||||||||||||||||||||||
| 1880 | { | - | ||||||||||||||||||||||||||||||
| 1881 |     return never executed:   d_ptr->subFocusItem;return d_ptr->subFocusItem;never executed:  return d_ptr->subFocusItem; | 0 | ||||||||||||||||||||||||||||||
| 1882 | } | - | ||||||||||||||||||||||||||||||
| 1883 | - | |||||||||||||||||||||||||||||||
| 1884 | - | |||||||||||||||||||||||||||||||
| 1885 | - | |||||||||||||||||||||||||||||||
| 1886 | - | |||||||||||||||||||||||||||||||
| 1887 | - | |||||||||||||||||||||||||||||||
| 1888 | - | |||||||||||||||||||||||||||||||
| 1889 | QGraphicsItem *QGraphicsItem::focusScopeItem() const | - | ||||||||||||||||||||||||||||||
| 1890 | { | - | ||||||||||||||||||||||||||||||
| 1891 |     return never executed:   d_ptr->focusScopeItem;return d_ptr->focusScopeItem;never executed:  return d_ptr->focusScopeItem; | 0 | ||||||||||||||||||||||||||||||
| 1892 | } | - | ||||||||||||||||||||||||||||||
| 1893 | void QGraphicsItem::grabMouse() | - | ||||||||||||||||||||||||||||||
| 1894 | { | - | ||||||||||||||||||||||||||||||
| 1895 |     if (!d_ptr->scene
  | 0 | ||||||||||||||||||||||||||||||
| 1896 | QMessageLogger(__FILE__, 3537, __PRETTY_FUNCTION__).warning("QGraphicsItem::grabMouse: cannot grab mouse without scene"); | - | ||||||||||||||||||||||||||||||
| 1897 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 1898 | } | - | ||||||||||||||||||||||||||||||
| 1899 |     if (!d_ptr->visible
  | 0 | ||||||||||||||||||||||||||||||
| 1900 | QMessageLogger(__FILE__, 3541, __PRETTY_FUNCTION__).warning("QGraphicsItem::grabMouse: cannot grab mouse while invisible"); | - | ||||||||||||||||||||||||||||||
| 1901 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 1902 | } | - | ||||||||||||||||||||||||||||||
| 1903 | d_ptr->scene->d_func()->grabMouse(this); | - | ||||||||||||||||||||||||||||||
| 1904 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1905 | - | |||||||||||||||||||||||||||||||
| 1906 | - | |||||||||||||||||||||||||||||||
| 1907 | - | |||||||||||||||||||||||||||||||
| 1908 | - | |||||||||||||||||||||||||||||||
| 1909 | - | |||||||||||||||||||||||||||||||
| 1910 | - | |||||||||||||||||||||||||||||||
| 1911 | - | |||||||||||||||||||||||||||||||
| 1912 | void QGraphicsItem::ungrabMouse() | - | ||||||||||||||||||||||||||||||
| 1913 | { | - | ||||||||||||||||||||||||||||||
| 1914 |     if (!d_ptr->scene
  | 0 | ||||||||||||||||||||||||||||||
| 1915 | QMessageLogger(__FILE__, 3556, __PRETTY_FUNCTION__).warning("QGraphicsItem::ungrabMouse: cannot ungrab mouse without scene"); | - | ||||||||||||||||||||||||||||||
| 1916 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 1917 | } | - | ||||||||||||||||||||||||||||||
| 1918 | d_ptr->scene->d_func()->ungrabMouse(this); | - | ||||||||||||||||||||||||||||||
| 1919 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1920 | void QGraphicsItem::grabKeyboard() | - | ||||||||||||||||||||||||||||||
| 1921 | { | - | ||||||||||||||||||||||||||||||
| 1922 |     if (!d_ptr->scene
  | 0 | ||||||||||||||||||||||||||||||
| 1923 | QMessageLogger(__FILE__, 3599, __PRETTY_FUNCTION__).warning("QGraphicsItem::grabKeyboard: cannot grab keyboard without scene"); | - | ||||||||||||||||||||||||||||||
| 1924 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 1925 | } | - | ||||||||||||||||||||||||||||||
| 1926 |     if (!d_ptr->visible
  | 0 | ||||||||||||||||||||||||||||||
| 1927 | QMessageLogger(__FILE__, 3603, __PRETTY_FUNCTION__).warning("QGraphicsItem::grabKeyboard: cannot grab keyboard while invisible"); | - | ||||||||||||||||||||||||||||||
| 1928 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 1929 | } | - | ||||||||||||||||||||||||||||||
| 1930 | d_ptr->scene->d_func()->grabKeyboard(this); | - | ||||||||||||||||||||||||||||||
| 1931 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1932 | - | |||||||||||||||||||||||||||||||
| 1933 | - | |||||||||||||||||||||||||||||||
| 1934 | - | |||||||||||||||||||||||||||||||
| 1935 | - | |||||||||||||||||||||||||||||||
| 1936 | - | |||||||||||||||||||||||||||||||
| 1937 | - | |||||||||||||||||||||||||||||||
| 1938 | - | |||||||||||||||||||||||||||||||
| 1939 | void QGraphicsItem::ungrabKeyboard() | - | ||||||||||||||||||||||||||||||
| 1940 | { | - | ||||||||||||||||||||||||||||||
| 1941 |     if (!d_ptr->scene
  | 0 | ||||||||||||||||||||||||||||||
| 1942 | QMessageLogger(__FILE__, 3618, __PRETTY_FUNCTION__).warning("QGraphicsItem::ungrabKeyboard: cannot ungrab keyboard without scene"); | - | ||||||||||||||||||||||||||||||
| 1943 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 1944 | } | - | ||||||||||||||||||||||||||||||
| 1945 | d_ptr->scene->d_func()->ungrabKeyboard(this); | - | ||||||||||||||||||||||||||||||
| 1946 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1947 | QPointF QGraphicsItem::pos() const | - | ||||||||||||||||||||||||||||||
| 1948 | { | - | ||||||||||||||||||||||||||||||
| 1949 |     return never executed:   d_ptr->pos;return d_ptr->pos;never executed:  return d_ptr->pos; | 0 | ||||||||||||||||||||||||||||||
| 1950 | } | - | ||||||||||||||||||||||||||||||
| 1951 | void QGraphicsItem::setX(qreal x) | - | ||||||||||||||||||||||||||||||
| 1952 | { | - | ||||||||||||||||||||||||||||||
| 1953 |     if (d_ptr->inDestructor
  | 0 | ||||||||||||||||||||||||||||||
| 1954 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 1955 | - | |||||||||||||||||||||||||||||||
| 1956 |     if (qIsNaN(x)
  | 0 | ||||||||||||||||||||||||||||||
| 1957 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 1958 | - | |||||||||||||||||||||||||||||||
| 1959 | setPos(QPointF(x, d_ptr->pos.y())); | - | ||||||||||||||||||||||||||||||
| 1960 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1961 | void QGraphicsItem::setY(qreal y) | - | ||||||||||||||||||||||||||||||
| 1962 | { | - | ||||||||||||||||||||||||||||||
| 1963 |     if (d_ptr->inDestructor
  | 0 | ||||||||||||||||||||||||||||||
| 1964 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 1965 | - | |||||||||||||||||||||||||||||||
| 1966 |     if (qIsNaN(y)
  | 0 | ||||||||||||||||||||||||||||||
| 1967 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 1968 | - | |||||||||||||||||||||||||||||||
| 1969 | setPos(QPointF(d_ptr->pos.x(), y)); | - | ||||||||||||||||||||||||||||||
| 1970 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 1971 | - | |||||||||||||||||||||||||||||||
| 1972 | - | |||||||||||||||||||||||||||||||
| 1973 | - | |||||||||||||||||||||||||||||||
| 1974 | - | |||||||||||||||||||||||||||||||
| 1975 | - | |||||||||||||||||||||||||||||||
| 1976 | - | |||||||||||||||||||||||||||||||
| 1977 | - | |||||||||||||||||||||||||||||||
| 1978 | QPointF QGraphicsItem::scenePos() const | - | ||||||||||||||||||||||||||||||
| 1979 | { | - | ||||||||||||||||||||||||||||||
| 1980 |     return never executed:   mapToScene(0, 0);return mapToScene(0, 0);never executed:  return mapToScene(0, 0); | 0 | ||||||||||||||||||||||||||||||
| 1981 | } | - | ||||||||||||||||||||||||||||||
| 1982 | - | |||||||||||||||||||||||||||||||
| 1983 | - | |||||||||||||||||||||||||||||||
| 1984 | - | |||||||||||||||||||||||||||||||
| 1985 | - | |||||||||||||||||||||||||||||||
| 1986 | - | |||||||||||||||||||||||||||||||
| 1987 | - | |||||||||||||||||||||||||||||||
| 1988 | void QGraphicsItemPrivate::setPosHelper(const QPointF &pos) | - | ||||||||||||||||||||||||||||||
| 1989 | { | - | ||||||||||||||||||||||||||||||
| 1990 | QGraphicsItem * const q = q_func(); | - | ||||||||||||||||||||||||||||||
| 1991 | inSetPosHelper = 1; | - | ||||||||||||||||||||||||||||||
| 1992 |     if (scene
  | 0 | ||||||||||||||||||||||||||||||
| 1993 |         q->prepareGeometryChange(); never executed:  q->prepareGeometryChange(); | 0 | ||||||||||||||||||||||||||||||
| 1994 | QPointF oldPos = this->pos; | - | ||||||||||||||||||||||||||||||
| 1995 | this->pos = pos; | - | ||||||||||||||||||||||||||||||
| 1996 | dirtySceneTransform = 1; | - | ||||||||||||||||||||||||||||||
| 1997 | inSetPosHelper = 0; | - | ||||||||||||||||||||||||||||||
| 1998 |     if (isObject
  | 0 | ||||||||||||||||||||||||||||||
| 1999 |         if (pos.x() != oldPos.x()
  | 0 | ||||||||||||||||||||||||||||||
| 2000 |             static_cast< never executed:  QGraphicsObject *>(q_ptr)->xChanged();static_cast<QGraphicsObject *>(q_ptr)->xChanged();never executed:  static_cast<QGraphicsObject *>(q_ptr)->xChanged(); | 0 | ||||||||||||||||||||||||||||||
| 2001 |         if (pos.y() != oldPos.y()
  | 0 | ||||||||||||||||||||||||||||||
| 2002 |             static_cast< never executed:  QGraphicsObject *>(q_ptr)->yChanged();static_cast<QGraphicsObject *>(q_ptr)->yChanged();never executed:  static_cast<QGraphicsObject *>(q_ptr)->yChanged(); | 0 | ||||||||||||||||||||||||||||||
| 2003 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2004 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2005 | - | |||||||||||||||||||||||||||||||
| 2006 | - | |||||||||||||||||||||||||||||||
| 2007 | - | |||||||||||||||||||||||||||||||
| 2008 | - | |||||||||||||||||||||||||||||||
| 2009 | - | |||||||||||||||||||||||||||||||
| 2010 | - | |||||||||||||||||||||||||||||||
| 2011 | void QGraphicsItemPrivate::setTransformHelper(const QTransform &transform) | - | ||||||||||||||||||||||||||||||
| 2012 | { | - | ||||||||||||||||||||||||||||||
| 2013 | q_ptr->prepareGeometryChange(); | - | ||||||||||||||||||||||||||||||
| 2014 | transformData->transform = transform; | - | ||||||||||||||||||||||||||||||
| 2015 | dirtySceneTransform = 1; | - | ||||||||||||||||||||||||||||||
| 2016 | transformChanged(); | - | ||||||||||||||||||||||||||||||
| 2017 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2018 | void QGraphicsItem::setPos(const QPointF &pos) | - | ||||||||||||||||||||||||||||||
| 2019 | { | - | ||||||||||||||||||||||||||||||
| 2020 |     if (d_ptr->pos == pos
  | 0 | ||||||||||||||||||||||||||||||
| 2021 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 2022 | - | |||||||||||||||||||||||||||||||
| 2023 |     if (d_ptr->inDestructor
  | 0 | ||||||||||||||||||||||||||||||
| 2024 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 2025 | - | |||||||||||||||||||||||||||||||
| 2026 | - | |||||||||||||||||||||||||||||||
| 2027 |     if (!(d_ptr->flags & (ItemSendsGeometryChanges | ItemSendsScenePositionChanges))
  | 0 | ||||||||||||||||||||||||||||||
| 2028 | d_ptr->setPosHelper(pos); | - | ||||||||||||||||||||||||||||||
| 2029 |         if (d_ptr->isWidget
  | 0 | ||||||||||||||||||||||||||||||
| 2030 |             static_cast< never executed:  QGraphicsWidget *>(this)->d_func()->setGeometryFromSetPos();static_cast<QGraphicsWidget *>(this)->d_func()->setGeometryFromSetPos();never executed:  static_cast<QGraphicsWidget *>(this)->d_func()->setGeometryFromSetPos(); | 0 | ||||||||||||||||||||||||||||||
| 2031 |         if (d_ptr->scenePosDescendants
  | 0 | ||||||||||||||||||||||||||||||
| 2032 |             d_ptr->sendScenePosChange(); never executed:  d_ptr->sendScenePosChange(); | 0 | ||||||||||||||||||||||||||||||
| 2033 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 2034 | } | - | ||||||||||||||||||||||||||||||
| 2035 | - | |||||||||||||||||||||||||||||||
| 2036 | - | |||||||||||||||||||||||||||||||
| 2037 | const QVariant newPosVariant(itemChange(ItemPositionChange, QVariant::fromValue<QPointF>(pos))); | - | ||||||||||||||||||||||||||||||
| 2038 | QPointF newPos = newPosVariant.toPointF(); | - | ||||||||||||||||||||||||||||||
| 2039 |     if (newPos == d_ptr->pos
  | 0 | ||||||||||||||||||||||||||||||
| 2040 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 2041 | - | |||||||||||||||||||||||||||||||
| 2042 | - | |||||||||||||||||||||||||||||||
| 2043 | d_ptr->setPosHelper(newPos); | - | ||||||||||||||||||||||||||||||
| 2044 | - | |||||||||||||||||||||||||||||||
| 2045 | - | |||||||||||||||||||||||||||||||
| 2046 | itemChange(QGraphicsItem::ItemPositionHasChanged, newPosVariant); | - | ||||||||||||||||||||||||||||||
| 2047 | d_ptr->sendScenePosChange(); | - | ||||||||||||||||||||||||||||||
| 2048 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2049 | void QGraphicsItem::ensureVisible(const QRectF &rect, int xmargin, int ymargin) | - | ||||||||||||||||||||||||||||||
| 2050 | { | - | ||||||||||||||||||||||||||||||
| 2051 |     if (d_ptr->scene
  | 0 | ||||||||||||||||||||||||||||||
| 2052 | QRectF sceneRect; | - | ||||||||||||||||||||||||||||||
| 2053 |         if (!rect.isNull()
  | 0 | ||||||||||||||||||||||||||||||
| 2054 |             sceneRect = sceneTransform().mapRect(rect); never executed:  sceneRect = sceneTransform().mapRect(rect); | 0 | ||||||||||||||||||||||||||||||
| 2055 | else | - | ||||||||||||||||||||||||||||||
| 2056 |             sceneRect = sceneBoundingRect(); never executed:  sceneRect = sceneBoundingRect(); | 0 | ||||||||||||||||||||||||||||||
| 2057 | 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) | - | ||||||||||||||||||||||||||||||
| 2058 |             view->ensureVisible(sceneRect, xmargin, ymargin); never executed:  view->ensureVisible(sceneRect, xmargin, ymargin); | 0 | ||||||||||||||||||||||||||||||
| 2059 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2060 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2061 | QMatrix QGraphicsItem::matrix() const | - | ||||||||||||||||||||||||||||||
| 2062 | { | - | ||||||||||||||||||||||||||||||
| 2063 |     return never executed:   transform().toAffine();return transform().toAffine();never executed:  return transform().toAffine(); | 0 | ||||||||||||||||||||||||||||||
| 2064 | } | - | ||||||||||||||||||||||||||||||
| 2065 | QTransform QGraphicsItem::transform() const | - | ||||||||||||||||||||||||||||||
| 2066 | { | - | ||||||||||||||||||||||||||||||
| 2067 |     if (!d_ptr->transformData
  | 0 | ||||||||||||||||||||||||||||||
| 2068 |         return never executed:   QTransform();return QTransform();never executed:  return QTransform(); | 0 | ||||||||||||||||||||||||||||||
| 2069 |     return never executed:   d_ptr->transformData->transform;return d_ptr->transformData->transform;never executed:  return d_ptr->transformData->transform; | 0 | ||||||||||||||||||||||||||||||
| 2070 | } | - | ||||||||||||||||||||||||||||||
| 2071 | qreal QGraphicsItem::rotation() const | - | ||||||||||||||||||||||||||||||
| 2072 | { | - | ||||||||||||||||||||||||||||||
| 2073 |     if (!d_ptr->transformData
  | 0 | ||||||||||||||||||||||||||||||
| 2074 |         return never executed:   0;return 0;never executed:  return 0; | 0 | ||||||||||||||||||||||||||||||
| 2075 |     return never executed:   d_ptr->transformData->rotation;return d_ptr->transformData->rotation;never executed:  return d_ptr->transformData->rotation; | 0 | ||||||||||||||||||||||||||||||
| 2076 | } | - | ||||||||||||||||||||||||||||||
| 2077 | void QGraphicsItem::setRotation(qreal angle) | - | ||||||||||||||||||||||||||||||
| 2078 | { | - | ||||||||||||||||||||||||||||||
| 2079 | prepareGeometryChange(); | - | ||||||||||||||||||||||||||||||
| 2080 | qreal newRotation = angle; | - | ||||||||||||||||||||||||||||||
| 2081 | - | |||||||||||||||||||||||||||||||
| 2082 |     if (d_ptr->flags & ItemSendsGeometryChanges
  | 0 | ||||||||||||||||||||||||||||||
| 2083 | - | |||||||||||||||||||||||||||||||
| 2084 | const QVariant newRotationVariant(itemChange(ItemRotationChange, angle)); | - | ||||||||||||||||||||||||||||||
| 2085 | newRotation = newRotationVariant.toReal(); | - | ||||||||||||||||||||||||||||||
| 2086 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2087 | - | |||||||||||||||||||||||||||||||
| 2088 |     if (!d_ptr->transformData
  | 0 | ||||||||||||||||||||||||||||||
| 2089 |         d_ptr->transformData = new QGraphicsItemPrivate::TransformData; never executed:  d_ptr->transformData = new QGraphicsItemPrivate::TransformData; | 0 | ||||||||||||||||||||||||||||||
| 2090 | - | |||||||||||||||||||||||||||||||
| 2091 |     if (d_ptr->transformData->rotation == newRotation
  | 0 | ||||||||||||||||||||||||||||||
| 2092 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 2093 | - | |||||||||||||||||||||||||||||||
| 2094 | d_ptr->transformData->rotation = newRotation; | - | ||||||||||||||||||||||||||||||
| 2095 | d_ptr->transformData->onlyTransform = false; | - | ||||||||||||||||||||||||||||||
| 2096 | d_ptr->dirtySceneTransform = 1; | - | ||||||||||||||||||||||||||||||
| 2097 | - | |||||||||||||||||||||||||||||||
| 2098 | - | |||||||||||||||||||||||||||||||
| 2099 |     if (d_ptr->flags & ItemSendsGeometryChanges
  | 0 | ||||||||||||||||||||||||||||||
| 2100 |         itemChange(ItemRotationHasChanged, newRotation); never executed:  itemChange(ItemRotationHasChanged, newRotation); | 0 | ||||||||||||||||||||||||||||||
| 2101 | - | |||||||||||||||||||||||||||||||
| 2102 |     if (d_ptr->isObject
  | 0 | ||||||||||||||||||||||||||||||
| 2103 |         static_cast< never executed:  QGraphicsObject *>(this)->rotationChanged();static_cast<QGraphicsObject *>(this)->rotationChanged();never executed:  static_cast<QGraphicsObject *>(this)->rotationChanged(); | 0 | ||||||||||||||||||||||||||||||
| 2104 | - | |||||||||||||||||||||||||||||||
| 2105 | d_ptr->transformChanged(); | - | ||||||||||||||||||||||||||||||
| 2106 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2107 | qreal QGraphicsItem::scale() const | - | ||||||||||||||||||||||||||||||
| 2108 | { | - | ||||||||||||||||||||||||||||||
| 2109 |     if (!d_ptr->transformData
  | 0 | ||||||||||||||||||||||||||||||
| 2110 |         return never executed:   1.;return 1.;never executed:  return 1.; | 0 | ||||||||||||||||||||||||||||||
| 2111 |     return never executed:   d_ptr->transformData->scale;return d_ptr->transformData->scale;never executed:  return d_ptr->transformData->scale; | 0 | ||||||||||||||||||||||||||||||
| 2112 | } | - | ||||||||||||||||||||||||||||||
| 2113 | void QGraphicsItem::setScale(qreal factor) | - | ||||||||||||||||||||||||||||||
| 2114 | { | - | ||||||||||||||||||||||||||||||
| 2115 | prepareGeometryChange(); | - | ||||||||||||||||||||||||||||||
| 2116 | qreal newScale = factor; | - | ||||||||||||||||||||||||||||||
| 2117 | - | |||||||||||||||||||||||||||||||
| 2118 |     if (d_ptr->flags & ItemSendsGeometryChanges
  | 0 | ||||||||||||||||||||||||||||||
| 2119 | - | |||||||||||||||||||||||||||||||
| 2120 | const QVariant newScaleVariant(itemChange(ItemScaleChange, factor)); | - | ||||||||||||||||||||||||||||||
| 2121 | newScale = newScaleVariant.toReal(); | - | ||||||||||||||||||||||||||||||
| 2122 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2123 | - | |||||||||||||||||||||||||||||||
| 2124 |     if (!d_ptr->transformData
  | 0 | ||||||||||||||||||||||||||||||
| 2125 |         d_ptr->transformData = new QGraphicsItemPrivate::TransformData; never executed:  d_ptr->transformData = new QGraphicsItemPrivate::TransformData; | 0 | ||||||||||||||||||||||||||||||
| 2126 | - | |||||||||||||||||||||||||||||||
| 2127 |     if (d_ptr->transformData->scale == newScale
  | 0 | ||||||||||||||||||||||||||||||
| 2128 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 2129 | - | |||||||||||||||||||||||||||||||
| 2130 | d_ptr->transformData->scale = newScale; | - | ||||||||||||||||||||||||||||||
| 2131 | d_ptr->transformData->onlyTransform = false; | - | ||||||||||||||||||||||||||||||
| 2132 | d_ptr->dirtySceneTransform = 1; | - | ||||||||||||||||||||||||||||||
| 2133 | - | |||||||||||||||||||||||||||||||
| 2134 | - | |||||||||||||||||||||||||||||||
| 2135 |     if (d_ptr->flags & ItemSendsGeometryChanges
  | 0 | ||||||||||||||||||||||||||||||
| 2136 |         itemChange(ItemScaleHasChanged, newScale); never executed:  itemChange(ItemScaleHasChanged, newScale); | 0 | ||||||||||||||||||||||||||||||
| 2137 | - | |||||||||||||||||||||||||||||||
| 2138 |     if (d_ptr->isObject
  | 0 | ||||||||||||||||||||||||||||||
| 2139 |         static_cast< never executed:  QGraphicsObject *>(this)->scaleChanged();static_cast<QGraphicsObject *>(this)->scaleChanged();never executed:  static_cast<QGraphicsObject *>(this)->scaleChanged(); | 0 | ||||||||||||||||||||||||||||||
| 2140 | - | |||||||||||||||||||||||||||||||
| 2141 | d_ptr->transformChanged(); | - | ||||||||||||||||||||||||||||||
| 2142 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2143 | QList<QGraphicsTransform *> QGraphicsItem::transformations() const | - | ||||||||||||||||||||||||||||||
| 2144 | { | - | ||||||||||||||||||||||||||||||
| 2145 |     if (!d_ptr->transformData
  | 0 | ||||||||||||||||||||||||||||||
| 2146 |         return never executed:   QList<QGraphicsTransform *>();return QList<QGraphicsTransform *>();never executed:  return QList<QGraphicsTransform *>(); | 0 | ||||||||||||||||||||||||||||||
| 2147 |     return never executed:   d_ptr->transformData->graphicsTransforms;return d_ptr->transformData->graphicsTransforms;never executed:  return d_ptr->transformData->graphicsTransforms; | 0 | ||||||||||||||||||||||||||||||
| 2148 | } | - | ||||||||||||||||||||||||||||||
| 2149 | void QGraphicsItem::setTransformations(const QList<QGraphicsTransform *> &transformations) | - | ||||||||||||||||||||||||||||||
| 2150 | { | - | ||||||||||||||||||||||||||||||
| 2151 | prepareGeometryChange(); | - | ||||||||||||||||||||||||||||||
| 2152 |     if (!d_ptr->transformData
  | 0 | ||||||||||||||||||||||||||||||
| 2153 |         d_ptr->transformData = new QGraphicsItemPrivate::TransformData; never executed:  d_ptr->transformData = new QGraphicsItemPrivate::TransformData; | 0 | ||||||||||||||||||||||||||||||
| 2154 | d_ptr->transformData->graphicsTransforms = transformations; | - | ||||||||||||||||||||||||||||||
| 2155 |     for (int i = 0; i < transformations.size()
  | 0 | ||||||||||||||||||||||||||||||
| 2156 |         transformations.at(i)->d_func()->setItem(this); never executed:  transformations.at(i)->d_func()->setItem(this); | 0 | ||||||||||||||||||||||||||||||
| 2157 | d_ptr->transformData->onlyTransform = false; | - | ||||||||||||||||||||||||||||||
| 2158 | d_ptr->dirtySceneTransform = 1; | - | ||||||||||||||||||||||||||||||
| 2159 | d_ptr->transformChanged(); | - | ||||||||||||||||||||||||||||||
| 2160 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2161 | - | |||||||||||||||||||||||||||||||
| 2162 | - | |||||||||||||||||||||||||||||||
| 2163 | - | |||||||||||||||||||||||||||||||
| 2164 | - | |||||||||||||||||||||||||||||||
| 2165 | void QGraphicsItemPrivate::prependGraphicsTransform(QGraphicsTransform *t) | - | ||||||||||||||||||||||||||||||
| 2166 | { | - | ||||||||||||||||||||||||||||||
| 2167 |     if (!transformData
  | 0 | ||||||||||||||||||||||||||||||
| 2168 |         transformData = new QGraphicsItemPrivate::TransformData; never executed:  transformData = new QGraphicsItemPrivate::TransformData; | 0 | ||||||||||||||||||||||||||||||
| 2169 |     if (!transformData->graphicsTransforms.contains(t)
  | 0 | ||||||||||||||||||||||||||||||
| 2170 |         transformData->graphicsTransforms.prepend(t); never executed:  transformData->graphicsTransforms.prepend(t); | 0 | ||||||||||||||||||||||||||||||
| 2171 | - | |||||||||||||||||||||||||||||||
| 2172 | QGraphicsItem * const q = q_func(); | - | ||||||||||||||||||||||||||||||
| 2173 | t->d_func()->setItem(q); | - | ||||||||||||||||||||||||||||||
| 2174 | transformData->onlyTransform = false; | - | ||||||||||||||||||||||||||||||
| 2175 | dirtySceneTransform = 1; | - | ||||||||||||||||||||||||||||||
| 2176 | transformChanged(); | - | ||||||||||||||||||||||||||||||
| 2177 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2178 | - | |||||||||||||||||||||||||||||||
| 2179 | - | |||||||||||||||||||||||||||||||
| 2180 | - | |||||||||||||||||||||||||||||||
| 2181 | - | |||||||||||||||||||||||||||||||
| 2182 | void QGraphicsItemPrivate::appendGraphicsTransform(QGraphicsTransform *t) | - | ||||||||||||||||||||||||||||||
| 2183 | { | - | ||||||||||||||||||||||||||||||
| 2184 |     if (!transformData
  | 0 | ||||||||||||||||||||||||||||||
| 2185 |         transformData = new QGraphicsItemPrivate::TransformData; never executed:  transformData = new QGraphicsItemPrivate::TransformData; | 0 | ||||||||||||||||||||||||||||||
| 2186 |     if (!transformData->graphicsTransforms.contains(t)
  | 0 | ||||||||||||||||||||||||||||||
| 2187 |         transformData->graphicsTransforms.append(t); never executed:  transformData->graphicsTransforms.append(t); | 0 | ||||||||||||||||||||||||||||||
| 2188 | - | |||||||||||||||||||||||||||||||
| 2189 | QGraphicsItem * const q = q_func(); | - | ||||||||||||||||||||||||||||||
| 2190 | t->d_func()->setItem(q); | - | ||||||||||||||||||||||||||||||
| 2191 | transformData->onlyTransform = false; | - | ||||||||||||||||||||||||||||||
| 2192 | dirtySceneTransform = 1; | - | ||||||||||||||||||||||||||||||
| 2193 | transformChanged(); | - | ||||||||||||||||||||||||||||||
| 2194 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2195 | QPointF QGraphicsItem::transformOriginPoint() const | - | ||||||||||||||||||||||||||||||
| 2196 | { | - | ||||||||||||||||||||||||||||||
| 2197 |     if (!d_ptr->transformData
  | 0 | ||||||||||||||||||||||||||||||
| 2198 |         return never executed:   QPointF(0,0);return QPointF(0,0);never executed:  return QPointF(0,0); | 0 | ||||||||||||||||||||||||||||||
| 2199 |     return never executed:   QPointF(d_ptr->transformData->xOrigin, d_ptr->transformData->yOrigin);return QPointF(d_ptr->transformData->xOrigin, d_ptr->transformData->yOrigin);never executed:  return QPointF(d_ptr->transformData->xOrigin, d_ptr->transformData->yOrigin); | 0 | ||||||||||||||||||||||||||||||
| 2200 | } | - | ||||||||||||||||||||||||||||||
| 2201 | void QGraphicsItem::setTransformOriginPoint(const QPointF &origin) | - | ||||||||||||||||||||||||||||||
| 2202 | { | - | ||||||||||||||||||||||||||||||
| 2203 | prepareGeometryChange(); | - | ||||||||||||||||||||||||||||||
| 2204 | QPointF newOrigin = origin; | - | ||||||||||||||||||||||||||||||
| 2205 | - | |||||||||||||||||||||||||||||||
| 2206 |     if (d_ptr->flags & ItemSendsGeometryChanges
  | 0 | ||||||||||||||||||||||||||||||
| 2207 | - | |||||||||||||||||||||||||||||||
| 2208 | const QVariant newOriginVariant(itemChange(ItemTransformOriginPointChange, | - | ||||||||||||||||||||||||||||||
| 2209 | QVariant::fromValue<QPointF>(origin))); | - | ||||||||||||||||||||||||||||||
| 2210 | newOrigin = newOriginVariant.toPointF(); | - | ||||||||||||||||||||||||||||||
| 2211 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2212 | - | |||||||||||||||||||||||||||||||
| 2213 |     if (!d_ptr->transformData
  | 0 | ||||||||||||||||||||||||||||||
| 2214 |         d_ptr->transformData = new QGraphicsItemPrivate::TransformData; never executed:  d_ptr->transformData = new QGraphicsItemPrivate::TransformData; | 0 | ||||||||||||||||||||||||||||||
| 2215 | - | |||||||||||||||||||||||||||||||
| 2216 |     if (d_ptr->transformData->xOrigin == newOrigin.x()
  | 0 | ||||||||||||||||||||||||||||||
| 2217 |         && d_ptr->transformData->yOrigin == newOrigin.y()
  | 0 | ||||||||||||||||||||||||||||||
| 2218 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 2219 | } | - | ||||||||||||||||||||||||||||||
| 2220 | - | |||||||||||||||||||||||||||||||
| 2221 | d_ptr->transformData->xOrigin = newOrigin.x(); | - | ||||||||||||||||||||||||||||||
| 2222 | d_ptr->transformData->yOrigin = newOrigin.y(); | - | ||||||||||||||||||||||||||||||
| 2223 | d_ptr->transformData->onlyTransform = false; | - | ||||||||||||||||||||||||||||||
| 2224 | d_ptr->dirtySceneTransform = 1; | - | ||||||||||||||||||||||||||||||
| 2225 | - | |||||||||||||||||||||||||||||||
| 2226 | - | |||||||||||||||||||||||||||||||
| 2227 |     if (d_ptr->flags & ItemSendsGeometryChanges
  | 0 | ||||||||||||||||||||||||||||||
| 2228 |         itemChange(ItemTransformOriginPointHasChanged, QVariant::fromValue<QPointF>(newOrigin)); never executed:  itemChange(ItemTransformOriginPointHasChanged, QVariant::fromValue<QPointF>(newOrigin)); | 0 | ||||||||||||||||||||||||||||||
| 2229 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2230 | QMatrix QGraphicsItem::sceneMatrix() const | - | ||||||||||||||||||||||||||||||
| 2231 | { | - | ||||||||||||||||||||||||||||||
| 2232 | d_ptr->ensureSceneTransform(); | - | ||||||||||||||||||||||||||||||
| 2233 |     return never executed:   d_ptr->sceneTransform.toAffine();return d_ptr->sceneTransform.toAffine();never executed:  return d_ptr->sceneTransform.toAffine(); | 0 | ||||||||||||||||||||||||||||||
| 2234 | } | - | ||||||||||||||||||||||||||||||
| 2235 | QTransform QGraphicsItem::sceneTransform() const | - | ||||||||||||||||||||||||||||||
| 2236 | { | - | ||||||||||||||||||||||||||||||
| 2237 | d_ptr->ensureSceneTransform(); | - | ||||||||||||||||||||||||||||||
| 2238 |     return never executed:   d_ptr->sceneTransform;return d_ptr->sceneTransform;never executed:  return d_ptr->sceneTransform; | 0 | ||||||||||||||||||||||||||||||
| 2239 | } | - | ||||||||||||||||||||||||||||||
| 2240 | QTransform QGraphicsItem::deviceTransform(const QTransform &viewportTransform) const | - | ||||||||||||||||||||||||||||||
| 2241 | { | - | ||||||||||||||||||||||||||||||
| 2242 | - | |||||||||||||||||||||||||||||||
| 2243 |     if (!d_ptr->itemIsUntransformable()
  | 0 | ||||||||||||||||||||||||||||||
| 2244 | d_ptr->ensureSceneTransform(); | - | ||||||||||||||||||||||||||||||
| 2245 |         return never executed:   d_ptr->sceneTransform * viewportTransform;return d_ptr->sceneTransform * viewportTransform;never executed:  return d_ptr->sceneTransform * viewportTransform; | 0 | ||||||||||||||||||||||||||||||
| 2246 | } | - | ||||||||||||||||||||||||||||||
| 2247 | - | |||||||||||||||||||||||||||||||
| 2248 | - | |||||||||||||||||||||||||||||||
| 2249 | const QGraphicsItem *untransformedAncestor = this; | - | ||||||||||||||||||||||||||||||
| 2250 | QList<const QGraphicsItem *> parents; | - | ||||||||||||||||||||||||||||||
| 2251 |     while (untransformedAncestor
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 2252 |                                      & QGraphicsItemPrivate::AncestorIgnoresTransformations))
  | 0 | ||||||||||||||||||||||||||||||
| 2253 | parents.prepend(untransformedAncestor); | - | ||||||||||||||||||||||||||||||
| 2254 | untransformedAncestor = untransformedAncestor->parentItem(); | - | ||||||||||||||||||||||||||||||
| 2255 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2256 | - | |||||||||||||||||||||||||||||||
| 2257 |     if (!untransformedAncestor
  | 0 | ||||||||||||||||||||||||||||||
| 2258 | - | |||||||||||||||||||||||||||||||
| 2259 | ((!(untransformedAncestor)) ? qt_assert_x("QGraphicsItem::deviceTransform", "Invalid object structure!", | - | ||||||||||||||||||||||||||||||
| 2260 | __FILE__ | - | ||||||||||||||||||||||||||||||
| 2261 | , | - | ||||||||||||||||||||||||||||||
| 2262 | 4241 | - | ||||||||||||||||||||||||||||||
| 2263 | ) : qt_noop()) | - | ||||||||||||||||||||||||||||||
| 2264 | ; | - | ||||||||||||||||||||||||||||||
| 2265 |         return never executed:   QTransform();return QTransform();never executed:  return QTransform(); | 0 | ||||||||||||||||||||||||||||||
| 2266 | } | - | ||||||||||||||||||||||||||||||
| 2267 | - | |||||||||||||||||||||||||||||||
| 2268 | - | |||||||||||||||||||||||||||||||
| 2269 | - | |||||||||||||||||||||||||||||||
| 2270 | - | |||||||||||||||||||||||||||||||
| 2271 | QGraphicsItem *parentOfUntransformedAncestor = untransformedAncestor->parentItem(); | - | ||||||||||||||||||||||||||||||
| 2272 | QTransform inheritedMatrix; | - | ||||||||||||||||||||||||||||||
| 2273 |     if (parentOfUntransformedAncestor
  | 0 | ||||||||||||||||||||||||||||||
| 2274 |         inheritedMatrix = parentOfUntransformedAncestor->sceneTransform(); never executed:  inheritedMatrix = parentOfUntransformedAncestor->sceneTransform(); | 0 | ||||||||||||||||||||||||||||||
| 2275 | QPointF mappedPoint = (inheritedMatrix * viewportTransform).map(untransformedAncestor->pos()); | - | ||||||||||||||||||||||||||||||
| 2276 | - | |||||||||||||||||||||||||||||||
| 2277 | - | |||||||||||||||||||||||||||||||
| 2278 | QTransform matrix = QTransform::fromTranslate(mappedPoint.x(), mappedPoint.y()); | - | ||||||||||||||||||||||||||||||
| 2279 |     if (untransformedAncestor->d_ptr->transformData
  | 0 | ||||||||||||||||||||||||||||||
| 2280 |         matrix = untransformedAncestor->d_ptr->transformData->computedFullTransform(&matrix); never executed:  matrix = untransformedAncestor->d_ptr->transformData->computedFullTransform(&matrix); | 0 | ||||||||||||||||||||||||||||||
| 2281 | - | |||||||||||||||||||||||||||||||
| 2282 | - | |||||||||||||||||||||||||||||||
| 2283 |     for (int i = 0; i < parents.size()
  | 0 | ||||||||||||||||||||||||||||||
| 2284 | const QGraphicsItem *parent = parents.at(i); | - | ||||||||||||||||||||||||||||||
| 2285 | parent->d_ptr->combineTransformFromParent(&matrix); | - | ||||||||||||||||||||||||||||||
| 2286 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2287 | - | |||||||||||||||||||||||||||||||
| 2288 |     return never executed:   matrix;return matrix;never executed:  return matrix; | 0 | ||||||||||||||||||||||||||||||
| 2289 | } | - | ||||||||||||||||||||||||||||||
| 2290 | QTransform QGraphicsItem::itemTransform(const QGraphicsItem *other, bool *ok) const | - | ||||||||||||||||||||||||||||||
| 2291 | { | - | ||||||||||||||||||||||||||||||
| 2292 | - | |||||||||||||||||||||||||||||||
| 2293 |     if (other == 0
  | 0 | ||||||||||||||||||||||||||||||
| 2294 | QMessageLogger(__FILE__, 4289, __PRETTY_FUNCTION__).warning("QGraphicsItem::itemTransform: null pointer passed"); | - | ||||||||||||||||||||||||||||||
| 2295 |         return never executed:   QTransform();return QTransform();never executed:  return QTransform(); | 0 | ||||||||||||||||||||||||||||||
| 2296 | } | - | ||||||||||||||||||||||||||||||
| 2297 |     if (other == this
  | 0 | ||||||||||||||||||||||||||||||
| 2298 |         if (ok
  | 0 | ||||||||||||||||||||||||||||||
| 2299 |             * never executed:  ok = true;*ok = true;never executed:  *ok = true; | 0 | ||||||||||||||||||||||||||||||
| 2300 |         return never executed:   QTransform();return QTransform();never executed:  return QTransform(); | 0 | ||||||||||||||||||||||||||||||
| 2301 | } | - | ||||||||||||||||||||||||||||||
| 2302 | - | |||||||||||||||||||||||||||||||
| 2303 | QGraphicsItem *parent = d_ptr->parent; | - | ||||||||||||||||||||||||||||||
| 2304 | const QGraphicsItem *otherParent = other->d_ptr->parent; | - | ||||||||||||||||||||||||||||||
| 2305 | - | |||||||||||||||||||||||||||||||
| 2306 | - | |||||||||||||||||||||||||||||||
| 2307 |     if (parent == other
  | 0 | ||||||||||||||||||||||||||||||
| 2308 |         if (ok
  | 0 | ||||||||||||||||||||||||||||||
| 2309 |             * never executed:  ok = true;*ok = true;never executed:  *ok = true; | 0 | ||||||||||||||||||||||||||||||
| 2310 | QTransform x; | - | ||||||||||||||||||||||||||||||
| 2311 | d_ptr->combineTransformFromParent(&x); | - | ||||||||||||||||||||||||||||||
| 2312 |         return never executed:   x;return x;never executed:  return x; | 0 | ||||||||||||||||||||||||||||||
| 2313 | } | - | ||||||||||||||||||||||||||||||
| 2314 | - | |||||||||||||||||||||||||||||||
| 2315 | - | |||||||||||||||||||||||||||||||
| 2316 |     if (otherParent == this
  | 0 | ||||||||||||||||||||||||||||||
| 2317 | const QPointF &otherPos = other->d_ptr->pos; | - | ||||||||||||||||||||||||||||||
| 2318 |         if (other->d_ptr->transformData
  | 0 | ||||||||||||||||||||||||||||||
| 2319 | QTransform otherToParent; | - | ||||||||||||||||||||||||||||||
| 2320 | other->d_ptr->combineTransformFromParent(&otherToParent); | - | ||||||||||||||||||||||||||||||
| 2321 |             return never executed:   otherToParent.inverted(ok);return otherToParent.inverted(ok);never executed:  return otherToParent.inverted(ok); | 0 | ||||||||||||||||||||||||||||||
| 2322 | } | - | ||||||||||||||||||||||||||||||
| 2323 |         if (ok
  | 0 | ||||||||||||||||||||||||||||||
| 2324 |             * never executed:  ok = true;*ok = true;never executed:  *ok = true; | 0 | ||||||||||||||||||||||||||||||
| 2325 |         return never executed:   QTransform::fromTranslate(-otherPos.x(), -otherPos.y());return QTransform::fromTranslate(-otherPos.x(), -otherPos.y());never executed:  return QTransform::fromTranslate(-otherPos.x(), -otherPos.y()); | 0 | ||||||||||||||||||||||||||||||
| 2326 | } | - | ||||||||||||||||||||||||||||||
| 2327 | - | |||||||||||||||||||||||||||||||
| 2328 | - | |||||||||||||||||||||||||||||||
| 2329 |     if (parent == otherParent
  | 0 | ||||||||||||||||||||||||||||||
| 2330 | - | |||||||||||||||||||||||||||||||
| 2331 | const QPointF &itemPos = d_ptr->pos; | - | ||||||||||||||||||||||||||||||
| 2332 | const QPointF &otherPos = other->d_ptr->pos; | - | ||||||||||||||||||||||||||||||
| 2333 |         if (!d_ptr->transformData
 
  | 0 | ||||||||||||||||||||||||||||||
| 2334 | QPointF delta = itemPos - otherPos; | - | ||||||||||||||||||||||||||||||
| 2335 |             if (ok
  | 0 | ||||||||||||||||||||||||||||||
| 2336 |                 * never executed:  ok = true;*ok = true;never executed:  *ok = true; | 0 | ||||||||||||||||||||||||||||||
| 2337 |             return never executed:   QTransform::fromTranslate(delta.x(), delta.y());return QTransform::fromTranslate(delta.x(), delta.y());never executed:  return QTransform::fromTranslate(delta.x(), delta.y()); | 0 | ||||||||||||||||||||||||||||||
| 2338 | } | - | ||||||||||||||||||||||||||||||
| 2339 | - | |||||||||||||||||||||||||||||||
| 2340 | QTransform itemToParent; | - | ||||||||||||||||||||||||||||||
| 2341 | d_ptr->combineTransformFromParent(&itemToParent); | - | ||||||||||||||||||||||||||||||
| 2342 | QTransform otherToParent; | - | ||||||||||||||||||||||||||||||
| 2343 | other->d_ptr->combineTransformFromParent(&otherToParent); | - | ||||||||||||||||||||||||||||||
| 2344 |         return never executed:   itemToParent * otherToParent.inverted(ok);return itemToParent * otherToParent.inverted(ok);never executed:  return itemToParent * otherToParent.inverted(ok); | 0 | ||||||||||||||||||||||||||||||
| 2345 | } | - | ||||||||||||||||||||||||||||||
| 2346 | - | |||||||||||||||||||||||||||||||
| 2347 | - | |||||||||||||||||||||||||||||||
| 2348 | - | |||||||||||||||||||||||||||||||
| 2349 | const QGraphicsItem *commonAncestor = commonAncestorItem(other); | - | ||||||||||||||||||||||||||||||
| 2350 |     if (!commonAncestor
  | 0 | ||||||||||||||||||||||||||||||
| 2351 | d_ptr->ensureSceneTransform(); | - | ||||||||||||||||||||||||||||||
| 2352 | other->d_ptr->ensureSceneTransform(); | - | ||||||||||||||||||||||||||||||
| 2353 |         return never executed:   d_ptr->sceneTransform * other->d_ptr->sceneTransform.inverted(ok);return d_ptr->sceneTransform * other->d_ptr->sceneTransform.inverted(ok);never executed:  return d_ptr->sceneTransform * other->d_ptr->sceneTransform.inverted(ok); | 0 | ||||||||||||||||||||||||||||||
| 2354 | } | - | ||||||||||||||||||||||||||||||
| 2355 | - | |||||||||||||||||||||||||||||||
| 2356 | - | |||||||||||||||||||||||||||||||
| 2357 | - | |||||||||||||||||||||||||||||||
| 2358 |     bool cousins = other != commonAncestor
 
  | 0 | ||||||||||||||||||||||||||||||
| 2359 |     if (cousins
  | 0 | ||||||||||||||||||||||||||||||
| 2360 | bool good = false; | - | ||||||||||||||||||||||||||||||
| 2361 | QTransform thisToScene = itemTransform(commonAncestor, &good); | - | ||||||||||||||||||||||||||||||
| 2362 | QTransform otherToScene(Qt::Uninitialized); | - | ||||||||||||||||||||||||||||||
| 2363 |         if (good
  | 0 | ||||||||||||||||||||||||||||||
| 2364 |             otherToScene = other->itemTransform(commonAncestor, &good); never executed:  otherToScene = other->itemTransform(commonAncestor, &good); | 0 | ||||||||||||||||||||||||||||||
| 2365 |         if (!good
  | 0 | ||||||||||||||||||||||||||||||
| 2366 |             if (ok
  | 0 | ||||||||||||||||||||||||||||||
| 2367 |                 * never executed:  ok = false;*ok = false;never executed:  *ok = false; | 0 | ||||||||||||||||||||||||||||||
| 2368 |             return never executed:   QTransform();return QTransform();never executed:  return QTransform(); | 0 | ||||||||||||||||||||||||||||||
| 2369 | } | - | ||||||||||||||||||||||||||||||
| 2370 |         return never executed:   thisToScene * otherToScene.inverted(ok);return thisToScene * otherToScene.inverted(ok);never executed:  return thisToScene * otherToScene.inverted(ok); | 0 | ||||||||||||||||||||||||||||||
| 2371 | } | - | ||||||||||||||||||||||||||||||
| 2372 | - | |||||||||||||||||||||||||||||||
| 2373 | - | |||||||||||||||||||||||||||||||
| 2374 | bool parentOfOther = isAncestorOf(other); | - | ||||||||||||||||||||||||||||||
| 2375 |     const QGraphicsItem *child = parentOfOther
  | 0 | ||||||||||||||||||||||||||||||
| 2376 |     const QGraphicsItem *root = parentOfOther
  | 0 | ||||||||||||||||||||||||||||||
| 2377 | - | |||||||||||||||||||||||||||||||
| 2378 | QTransform x; | - | ||||||||||||||||||||||||||||||
| 2379 | const QGraphicsItem *p = child; | - | ||||||||||||||||||||||||||||||
| 2380 | do { | - | ||||||||||||||||||||||||||||||
| 2381 | p->d_ptr.data()->combineTransformToParent(&x); | - | ||||||||||||||||||||||||||||||
| 2382 |     } never executed:   while ((end of block
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 2383 |     if (parentOfOther
  | 0 | ||||||||||||||||||||||||||||||
| 2384 |         return never executed:   x.inverted(ok);return x.inverted(ok);never executed:  return x.inverted(ok); | 0 | ||||||||||||||||||||||||||||||
| 2385 |     if (ok
  | 0 | ||||||||||||||||||||||||||||||
| 2386 |         * never executed:  ok = true;*ok = true;never executed:  *ok = true; | 0 | ||||||||||||||||||||||||||||||
| 2387 |     return never executed:   x;return x;never executed:  return x; | 0 | ||||||||||||||||||||||||||||||
| 2388 | } | - | ||||||||||||||||||||||||||||||
| 2389 | void QGraphicsItem::setMatrix(const QMatrix &matrix, bool combine) | - | ||||||||||||||||||||||||||||||
| 2390 | { | - | ||||||||||||||||||||||||||||||
| 2391 |     if (!d_ptr->transformData
  | 0 | ||||||||||||||||||||||||||||||
| 2392 |         d_ptr->transformData = new QGraphicsItemPrivate::TransformData; never executed:  d_ptr->transformData = new QGraphicsItemPrivate::TransformData; | 0 | ||||||||||||||||||||||||||||||
| 2393 | - | |||||||||||||||||||||||||||||||
| 2394 | QTransform newTransform(combine ? QTransform(matrix) * d_ptr->transformData->transform : QTransform(matrix)); | - | ||||||||||||||||||||||||||||||
| 2395 |     if (d_ptr->transformData->transform == newTransform
  | 0 | ||||||||||||||||||||||||||||||
| 2396 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 2397 | - | |||||||||||||||||||||||||||||||
| 2398 | - | |||||||||||||||||||||||||||||||
| 2399 |     if (!(d_ptr->flags & ItemSendsGeometryChanges)
  | 0 | ||||||||||||||||||||||||||||||
| 2400 | d_ptr->setTransformHelper(newTransform); | - | ||||||||||||||||||||||||||||||
| 2401 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 2402 | } | - | ||||||||||||||||||||||||||||||
| 2403 | - | |||||||||||||||||||||||||||||||
| 2404 | - | |||||||||||||||||||||||||||||||
| 2405 | const QVariant newMatrixVariant = QVariant::fromValue<QMatrix>(newTransform.toAffine()); | - | ||||||||||||||||||||||||||||||
| 2406 | newTransform = QTransform(qvariant_cast<QMatrix>(itemChange(ItemMatrixChange, newMatrixVariant))); | - | ||||||||||||||||||||||||||||||
| 2407 |     if (d_ptr->transformData->transform == newTransform
  | 0 | ||||||||||||||||||||||||||||||
| 2408 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 2409 | - | |||||||||||||||||||||||||||||||
| 2410 | - | |||||||||||||||||||||||||||||||
| 2411 | d_ptr->setTransformHelper(newTransform); | - | ||||||||||||||||||||||||||||||
| 2412 | - | |||||||||||||||||||||||||||||||
| 2413 | - | |||||||||||||||||||||||||||||||
| 2414 | itemChange(ItemTransformHasChanged, QVariant::fromValue<QTransform>(newTransform)); | - | ||||||||||||||||||||||||||||||
| 2415 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2416 | void QGraphicsItem::setTransform(const QTransform &matrix, bool combine) | - | ||||||||||||||||||||||||||||||
| 2417 | { | - | ||||||||||||||||||||||||||||||
| 2418 |     if (!d_ptr->transformData
  | 0 | ||||||||||||||||||||||||||||||
| 2419 |         d_ptr->transformData = new QGraphicsItemPrivate::TransformData; never executed:  d_ptr->transformData = new QGraphicsItemPrivate::TransformData; | 0 | ||||||||||||||||||||||||||||||
| 2420 | - | |||||||||||||||||||||||||||||||
| 2421 | QTransform newTransform(combine ? matrix * d_ptr->transformData->transform : matrix); | - | ||||||||||||||||||||||||||||||
| 2422 |     if (d_ptr->transformData->transform == newTransform
  | 0 | ||||||||||||||||||||||||||||||
| 2423 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 2424 | - | |||||||||||||||||||||||||||||||
| 2425 | - | |||||||||||||||||||||||||||||||
| 2426 |     if (!(d_ptr->flags & (ItemSendsGeometryChanges | ItemSendsScenePositionChanges))
  | 0 | ||||||||||||||||||||||||||||||
| 2427 | d_ptr->setTransformHelper(newTransform); | - | ||||||||||||||||||||||||||||||
| 2428 |         if (d_ptr->scenePosDescendants
  | 0 | ||||||||||||||||||||||||||||||
| 2429 |             d_ptr->sendScenePosChange(); never executed:  d_ptr->sendScenePosChange(); | 0 | ||||||||||||||||||||||||||||||
| 2430 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 2431 | } | - | ||||||||||||||||||||||||||||||
| 2432 | - | |||||||||||||||||||||||||||||||
| 2433 | - | |||||||||||||||||||||||||||||||
| 2434 | const QVariant newTransformVariant(itemChange(ItemTransformChange, | - | ||||||||||||||||||||||||||||||
| 2435 | QVariant::fromValue<QTransform>(newTransform))); | - | ||||||||||||||||||||||||||||||
| 2436 | newTransform = qvariant_cast<QTransform>(newTransformVariant); | - | ||||||||||||||||||||||||||||||
| 2437 |     if (d_ptr->transformData->transform == newTransform
  | 0 | ||||||||||||||||||||||||||||||
| 2438 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 2439 | - | |||||||||||||||||||||||||||||||
| 2440 | - | |||||||||||||||||||||||||||||||
| 2441 | d_ptr->setTransformHelper(newTransform); | - | ||||||||||||||||||||||||||||||
| 2442 | - | |||||||||||||||||||||||||||||||
| 2443 | - | |||||||||||||||||||||||||||||||
| 2444 | itemChange(ItemTransformHasChanged, newTransformVariant); | - | ||||||||||||||||||||||||||||||
| 2445 | d_ptr->sendScenePosChange(); | - | ||||||||||||||||||||||||||||||
| 2446 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2447 | - | |||||||||||||||||||||||||||||||
| 2448 | - | |||||||||||||||||||||||||||||||
| 2449 | - | |||||||||||||||||||||||||||||||
| 2450 | - | |||||||||||||||||||||||||||||||
| 2451 | - | |||||||||||||||||||||||||||||||
| 2452 | - | |||||||||||||||||||||||||||||||
| 2453 | void QGraphicsItem::resetMatrix() | - | ||||||||||||||||||||||||||||||
| 2454 | { | - | ||||||||||||||||||||||||||||||
| 2455 | resetTransform(); | - | ||||||||||||||||||||||||||||||
| 2456 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2457 | void QGraphicsItem::resetTransform() | - | ||||||||||||||||||||||||||||||
| 2458 | { | - | ||||||||||||||||||||||||||||||
| 2459 | setTransform(QTransform(), false); | - | ||||||||||||||||||||||||||||||
| 2460 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2461 | void QGraphicsItem::advance(int phase) | - | ||||||||||||||||||||||||||||||
| 2462 | { | - | ||||||||||||||||||||||||||||||
| 2463 | (void)phase;; | - | ||||||||||||||||||||||||||||||
| 2464 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2465 | qreal QGraphicsItem::zValue() const | - | ||||||||||||||||||||||||||||||
| 2466 | { | - | ||||||||||||||||||||||||||||||
| 2467 |     return never executed:   d_ptr->z;return d_ptr->z;never executed:  return d_ptr->z; | 0 | ||||||||||||||||||||||||||||||
| 2468 | } | - | ||||||||||||||||||||||||||||||
| 2469 | void QGraphicsItem::setZValue(qreal z) | - | ||||||||||||||||||||||||||||||
| 2470 | { | - | ||||||||||||||||||||||||||||||
| 2471 | const QVariant newZVariant(itemChange(ItemZValueChange, z)); | - | ||||||||||||||||||||||||||||||
| 2472 | qreal newZ = newZVariant.toReal(); | - | ||||||||||||||||||||||||||||||
| 2473 |     if (newZ == d_ptr->z
  | 0 | ||||||||||||||||||||||||||||||
| 2474 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 2475 | - | |||||||||||||||||||||||||||||||
| 2476 |     if (d_ptr->scene
 
  | 0 | ||||||||||||||||||||||||||||||
| 2477 | - | |||||||||||||||||||||||||||||||
| 2478 | d_ptr->scene->d_func()->index->itemChange(this, ItemZValueChange, &newZ); | - | ||||||||||||||||||||||||||||||
| 2479 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2480 | - | |||||||||||||||||||||||||||||||
| 2481 | d_ptr->z = newZ; | - | ||||||||||||||||||||||||||||||
| 2482 |     if (d_ptr->parent
  | 0 | ||||||||||||||||||||||||||||||
| 2483 |         d_ptr->parent->d_ptr->needSortChildren = 1; never executed:  d_ptr->parent->d_ptr->needSortChildren = 1; | 0 | ||||||||||||||||||||||||||||||
| 2484 |     else if (d_ptr->scene
  | 0 | ||||||||||||||||||||||||||||||
| 2485 |         d_ptr->scene->d_func()->needSortTopLevelItems = 1; never executed:  d_ptr->scene->d_func()->needSortTopLevelItems = 1; | 0 | ||||||||||||||||||||||||||||||
| 2486 | - | |||||||||||||||||||||||||||||||
| 2487 |     if (d_ptr->scene
  | 0 | ||||||||||||||||||||||||||||||
| 2488 |         d_ptr->scene->d_func()->markDirty(this, QRectF(), true); never executed:  d_ptr->scene->d_func()->markDirty(this, QRectF(), true); | 0 | ||||||||||||||||||||||||||||||
| 2489 | - | |||||||||||||||||||||||||||||||
| 2490 | itemChange(ItemZValueHasChanged, newZVariant); | - | ||||||||||||||||||||||||||||||
| 2491 | - | |||||||||||||||||||||||||||||||
| 2492 |     if (d_ptr->flags & ItemNegativeZStacksBehindParent
  | 0 | ||||||||||||||||||||||||||||||
| 2493 |         setFlag(QGraphicsItem::ItemStacksBehindParent, z < qreal(0.0)); never executed:  setFlag(QGraphicsItem::ItemStacksBehindParent, z < qreal(0.0)); | 0 | ||||||||||||||||||||||||||||||
| 2494 | - | |||||||||||||||||||||||||||||||
| 2495 |     if (d_ptr->isObject
  | 0 | ||||||||||||||||||||||||||||||
| 2496 |         static_cast< never executed:  QGraphicsObject *>(this)->zChanged();static_cast<QGraphicsObject *>(this)->zChanged();never executed:  static_cast<QGraphicsObject *>(this)->zChanged(); | 0 | ||||||||||||||||||||||||||||||
| 2497 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2498 | void QGraphicsItemPrivate::ensureSequentialSiblingIndex() | - | ||||||||||||||||||||||||||||||
| 2499 | { | - | ||||||||||||||||||||||||||||||
| 2500 |     if (!sequentialOrdering
  | 0 | ||||||||||||||||||||||||||||||
| 2501 | std::sort(children.begin(), children.end(), insertionOrder); | - | ||||||||||||||||||||||||||||||
| 2502 | sequentialOrdering = 1; | - | ||||||||||||||||||||||||||||||
| 2503 | needSortChildren = 1; | - | ||||||||||||||||||||||||||||||
| 2504 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2505 |     if (holesInSiblingIndex
  | 0 | ||||||||||||||||||||||||||||||
| 2506 | holesInSiblingIndex = 0; | - | ||||||||||||||||||||||||||||||
| 2507 |         for (int i = 0; i < children.size()
  | 0 | ||||||||||||||||||||||||||||||
| 2508 |             children[i]->d_ptr->siblingIndex = i; never executed:  children[i]->d_ptr->siblingIndex = i; | 0 | ||||||||||||||||||||||||||||||
| 2509 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2510 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2511 | - | |||||||||||||||||||||||||||||||
| 2512 | - | |||||||||||||||||||||||||||||||
| 2513 | - | |||||||||||||||||||||||||||||||
| 2514 | - | |||||||||||||||||||||||||||||||
| 2515 | inline void QGraphicsItemPrivate::sendScenePosChange() | - | ||||||||||||||||||||||||||||||
| 2516 | { | - | ||||||||||||||||||||||||||||||
| 2517 | QGraphicsItem * const q = q_func(); | - | ||||||||||||||||||||||||||||||
| 2518 |     if (scene
  | 0 | ||||||||||||||||||||||||||||||
| 2519 |         if (flags & QGraphicsItem::ItemSendsScenePositionChanges
  | 0 | ||||||||||||||||||||||||||||||
| 2520 |             q->itemChange(QGraphicsItem::ItemScenePositionHasChanged, q->scenePos()); never executed:  q->itemChange(QGraphicsItem::ItemScenePositionHasChanged, q->scenePos()); | 0 | ||||||||||||||||||||||||||||||
| 2521 |         if (scenePosDescendants
  | 0 | ||||||||||||||||||||||||||||||
| 2522 | 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) { | - | ||||||||||||||||||||||||||||||
| 2523 |                 if (q->isAncestorOf(item)
  | 0 | ||||||||||||||||||||||||||||||
| 2524 |                     item->itemChange(QGraphicsItem::ItemScenePositionHasChanged, item->scenePos()); never executed:  item->itemChange(QGraphicsItem::ItemScenePositionHasChanged, item->scenePos()); | 0 | ||||||||||||||||||||||||||||||
| 2525 |             } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2526 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2527 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2528 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2529 | void QGraphicsItem::stackBefore(const QGraphicsItem *sibling) | - | ||||||||||||||||||||||||||||||
| 2530 | { | - | ||||||||||||||||||||||||||||||
| 2531 |     if (sibling == this
  | 0 | ||||||||||||||||||||||||||||||
| 2532 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 2533 |     if (!sibling
 
  | 0 | ||||||||||||||||||||||||||||||
| 2534 | QMessageLogger(__FILE__, 4724, __PRETTY_FUNCTION__).warning("QGraphicsItem::stackUnder: cannot stack under %p, which must be a sibling", sibling); | - | ||||||||||||||||||||||||||||||
| 2535 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 2536 | } | - | ||||||||||||||||||||||||||||||
| 2537 |     QList<QGraphicsItem *> *siblings = d_ptr->parent
  | 0 | ||||||||||||||||||||||||||||||
| 2538 | ? &d_ptr->parent->d_ptr->children | - | ||||||||||||||||||||||||||||||
| 2539 |                                        : (d_ptr->scene
  | 0 | ||||||||||||||||||||||||||||||
| 2540 |     if (!siblings
  | 0 | ||||||||||||||||||||||||||||||
| 2541 | QMessageLogger(__FILE__, 4731, __PRETTY_FUNCTION__).warning("QGraphicsItem::stackUnder: cannot stack under %p, which must be a sibling", sibling); | - | ||||||||||||||||||||||||||||||
| 2542 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 2543 | } | - | ||||||||||||||||||||||||||||||
| 2544 | - | |||||||||||||||||||||||||||||||
| 2545 | - | |||||||||||||||||||||||||||||||
| 2546 | - | |||||||||||||||||||||||||||||||
| 2547 |     if (d_ptr->parent
  | 0 | ||||||||||||||||||||||||||||||
| 2548 |         d_ptr->parent->d_ptr->ensureSequentialSiblingIndex(); never executed:  d_ptr->parent->d_ptr->ensureSequentialSiblingIndex(); | 0 | ||||||||||||||||||||||||||||||
| 2549 | else | - | ||||||||||||||||||||||||||||||
| 2550 |         d_ptr->scene->d_func()->ensureSequentialTopLevelSiblingIndexes(); never executed:  d_ptr->scene->d_func()->ensureSequentialTopLevelSiblingIndexes(); | 0 | ||||||||||||||||||||||||||||||
| 2551 | - | |||||||||||||||||||||||||||||||
| 2552 | - | |||||||||||||||||||||||||||||||
| 2553 | int siblingIndex = sibling->d_ptr->siblingIndex; | - | ||||||||||||||||||||||||||||||
| 2554 | int myIndex = d_ptr->siblingIndex; | - | ||||||||||||||||||||||||||||||
| 2555 |     if (myIndex >= siblingIndex
  | 0 | ||||||||||||||||||||||||||||||
| 2556 | siblings->move(myIndex, siblingIndex); | - | ||||||||||||||||||||||||||||||
| 2557 | - | |||||||||||||||||||||||||||||||
| 2558 |         for (int i = 0; i < siblings->size()
  | 0 | ||||||||||||||||||||||||||||||
| 2559 | int &index = siblings->at(i)->d_ptr->siblingIndex; | - | ||||||||||||||||||||||||||||||
| 2560 |             if (i != siblingIndex
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 2561 |                 ++ never executed:  index;++index;never executed:  ++index; | 0 | ||||||||||||||||||||||||||||||
| 2562 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2563 | d_ptr->siblingIndex = siblingIndex; | - | ||||||||||||||||||||||||||||||
| 2564 |         for (int i = 0; i < siblings->size()
  | 0 | ||||||||||||||||||||||||||||||
| 2565 | int &index = siblings->at(i)->d_ptr->siblingIndex; | - | ||||||||||||||||||||||||||||||
| 2566 |             if (i != siblingIndex
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 2567 |                 siblings->at(i)->d_ptr->siblingOrderChange(); never executed:  siblings->at(i)->d_ptr->siblingOrderChange(); | 0 | ||||||||||||||||||||||||||||||
| 2568 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2569 | d_ptr->siblingOrderChange(); | - | ||||||||||||||||||||||||||||||
| 2570 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2571 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2572 | QRectF QGraphicsItem::childrenBoundingRect() const | - | ||||||||||||||||||||||||||||||
| 2573 | { | - | ||||||||||||||||||||||||||||||
| 2574 |     if (!d_ptr->dirtyChildrenBoundingRect
  | 0 | ||||||||||||||||||||||||||||||
| 2575 |         return never executed:   d_ptr->childrenBoundingRect;return d_ptr->childrenBoundingRect;never executed:  return d_ptr->childrenBoundingRect; | 0 | ||||||||||||||||||||||||||||||
| 2576 | - | |||||||||||||||||||||||||||||||
| 2577 | d_ptr->childrenBoundingRect = QRectF(); | - | ||||||||||||||||||||||||||||||
| 2578 | d_ptr->childrenBoundingRectHelper(0, &d_ptr->childrenBoundingRect, 0); | - | ||||||||||||||||||||||||||||||
| 2579 | d_ptr->dirtyChildrenBoundingRect = 0; | - | ||||||||||||||||||||||||||||||
| 2580 |     return never executed:   d_ptr->childrenBoundingRect;return d_ptr->childrenBoundingRect;never executed:  return d_ptr->childrenBoundingRect; | 0 | ||||||||||||||||||||||||||||||
| 2581 | } | - | ||||||||||||||||||||||||||||||
| 2582 | QRectF QGraphicsItem::sceneBoundingRect() const | - | ||||||||||||||||||||||||||||||
| 2583 | { | - | ||||||||||||||||||||||||||||||
| 2584 | - | |||||||||||||||||||||||||||||||
| 2585 | - | |||||||||||||||||||||||||||||||
| 2586 | QPointF offset; | - | ||||||||||||||||||||||||||||||
| 2587 | const QGraphicsItem *parentItem = this; | - | ||||||||||||||||||||||||||||||
| 2588 | const QGraphicsItemPrivate *itemd; | - | ||||||||||||||||||||||||||||||
| 2589 | do { | - | ||||||||||||||||||||||||||||||
| 2590 | itemd = parentItem->d_ptr.data(); | - | ||||||||||||||||||||||||||||||
| 2591 |         if (itemd->transformData
  | 0 | ||||||||||||||||||||||||||||||
| 2592 |             break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 2593 | offset += itemd->pos; | - | ||||||||||||||||||||||||||||||
| 2594 |     } never executed:   while ((end of block
 
  | 0 | ||||||||||||||||||||||||||||||
| 2595 | - | |||||||||||||||||||||||||||||||
| 2596 | QRectF br = boundingRect(); | - | ||||||||||||||||||||||||||||||
| 2597 | br.translate(offset); | - | ||||||||||||||||||||||||||||||
| 2598 |     if (!parentItem
  | 0 | ||||||||||||||||||||||||||||||
| 2599 |         return never executed:   br;return br;never executed:  return br; | 0 | ||||||||||||||||||||||||||||||
| 2600 |     if (parentItem->d_ptr->hasTranslateOnlySceneTransform()
  | 0 | ||||||||||||||||||||||||||||||
| 2601 | br.translate(parentItem->d_ptr->sceneTransform.dx(), parentItem->d_ptr->sceneTransform.dy()); | - | ||||||||||||||||||||||||||||||
| 2602 |         return never executed:   br;return br;never executed:  return br; | 0 | ||||||||||||||||||||||||||||||
| 2603 | } | - | ||||||||||||||||||||||||||||||
| 2604 |     return never executed:   parentItem->d_ptr->sceneTransform.mapRect(br);return parentItem->d_ptr->sceneTransform.mapRect(br);never executed:  return parentItem->d_ptr->sceneTransform.mapRect(br); | 0 | ||||||||||||||||||||||||||||||
| 2605 | } | - | ||||||||||||||||||||||||||||||
| 2606 | QPainterPath QGraphicsItem::shape() const | - | ||||||||||||||||||||||||||||||
| 2607 | { | - | ||||||||||||||||||||||||||||||
| 2608 | QPainterPath path; | - | ||||||||||||||||||||||||||||||
| 2609 | path.addRect(boundingRect()); | - | ||||||||||||||||||||||||||||||
| 2610 |     return never executed:   path;return path;never executed:  return path; | 0 | ||||||||||||||||||||||||||||||
| 2611 | } | - | ||||||||||||||||||||||||||||||
| 2612 | bool QGraphicsItem::isClipped() const | - | ||||||||||||||||||||||||||||||
| 2613 | { | - | ||||||||||||||||||||||||||||||
| 2614 | const QGraphicsItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 2615 |     return never executed:   (return (d->ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren) || (d->flags & QGraphicsItem::ItemClipsToShape);
 
 never executed:  return (d->ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren) || (d->flags & QGraphicsItem::ItemClipsToShape); | 0 | ||||||||||||||||||||||||||||||
| 2616 |         || (
 
 never executed:  return (d->ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren) || (d->flags & QGraphicsItem::ItemClipsToShape); | 0 | ||||||||||||||||||||||||||||||
| 2617 | } | - | ||||||||||||||||||||||||||||||
| 2618 | QPainterPath QGraphicsItem::clipPath() const | - | ||||||||||||||||||||||||||||||
| 2619 | { | - | ||||||||||||||||||||||||||||||
| 2620 | const QGraphicsItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 2621 |     if (!isClipped()
  | 0 | ||||||||||||||||||||||||||||||
| 2622 |         return never executed:   QPainterPath();return QPainterPath();never executed:  return QPainterPath(); | 0 | ||||||||||||||||||||||||||||||
| 2623 | - | |||||||||||||||||||||||||||||||
| 2624 | const QRectF thisBoundingRect(boundingRect()); | - | ||||||||||||||||||||||||||||||
| 2625 |     if (thisBoundingRect.isEmpty()
  | 0 | ||||||||||||||||||||||||||||||
| 2626 |         return never executed:   QPainterPath();return QPainterPath();never executed:  return QPainterPath(); | 0 | ||||||||||||||||||||||||||||||
| 2627 | - | |||||||||||||||||||||||||||||||
| 2628 | QPainterPath clip; | - | ||||||||||||||||||||||||||||||
| 2629 | - | |||||||||||||||||||||||||||||||
| 2630 | clip.addRect(thisBoundingRect); | - | ||||||||||||||||||||||||||||||
| 2631 | - | |||||||||||||||||||||||||||||||
| 2632 |     if (d->ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren
  | 0 | ||||||||||||||||||||||||||||||
| 2633 | const QGraphicsItem *parent = this; | - | ||||||||||||||||||||||||||||||
| 2634 | const QGraphicsItem *lastParent = this; | - | ||||||||||||||||||||||||||||||
| 2635 | - | |||||||||||||||||||||||||||||||
| 2636 | - | |||||||||||||||||||||||||||||||
| 2637 |         while ((
 
  | 0 | ||||||||||||||||||||||||||||||
| 2638 |             if (parent->d_ptr->flags & ItemClipsChildrenToShape
  | 0 | ||||||||||||||||||||||||||||||
| 2639 | - | |||||||||||||||||||||||||||||||
| 2640 | clip = lastParent->itemTransform(parent).map(clip); | - | ||||||||||||||||||||||||||||||
| 2641 | clip = clip.intersected(parent->shape()); | - | ||||||||||||||||||||||||||||||
| 2642 |                 if (clip.isEmpty()
  | 0 | ||||||||||||||||||||||||||||||
| 2643 |                     return never executed:   clip;return clip;never executed:  return clip; | 0 | ||||||||||||||||||||||||||||||
| 2644 | lastParent = parent; | - | ||||||||||||||||||||||||||||||
| 2645 |             } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2646 | - | |||||||||||||||||||||||||||||||
| 2647 |             if (!(parent->d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren)
  | 0 | ||||||||||||||||||||||||||||||
| 2648 |                 break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 2649 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2650 | - | |||||||||||||||||||||||||||||||
| 2651 |         if (lastParent != this
  | 0 | ||||||||||||||||||||||||||||||
| 2652 | - | |||||||||||||||||||||||||||||||
| 2653 | - | |||||||||||||||||||||||||||||||
| 2654 | clip = lastParent->itemTransform(this).map(clip); | - | ||||||||||||||||||||||||||||||
| 2655 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2656 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2657 | - | |||||||||||||||||||||||||||||||
| 2658 |     if (d->flags & ItemClipsToShape
  | 0 | ||||||||||||||||||||||||||||||
| 2659 |         clip = clip.intersected(shape()); never executed:  clip = clip.intersected(shape()); | 0 | ||||||||||||||||||||||||||||||
| 2660 | - | |||||||||||||||||||||||||||||||
| 2661 |     return never executed:   clip;return clip;never executed:  return clip; | 0 | ||||||||||||||||||||||||||||||
| 2662 | } | - | ||||||||||||||||||||||||||||||
| 2663 | bool QGraphicsItem::contains(const QPointF &point) const | - | ||||||||||||||||||||||||||||||
| 2664 | { | - | ||||||||||||||||||||||||||||||
| 2665 |     return never executed:   isClipped()return isClipped() ? clipPath().contains(point) : shape().contains(point);
 never executed:  return isClipped() ? clipPath().contains(point) : shape().contains(point); | 0 | ||||||||||||||||||||||||||||||
| 2666 | } | - | ||||||||||||||||||||||||||||||
| 2667 | bool QGraphicsItem::collidesWithItem(const QGraphicsItem *other, Qt::ItemSelectionMode mode) const | - | ||||||||||||||||||||||||||||||
| 2668 | { | - | ||||||||||||||||||||||||||||||
| 2669 |     if (other == this
  | 0 | ||||||||||||||||||||||||||||||
| 2670 |         return never executed:   true;return true;never executed:  return true; | 0 | ||||||||||||||||||||||||||||||
| 2671 |     if (!other
  | 0 | ||||||||||||||||||||||||||||||
| 2672 |         return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||
| 2673 | - | |||||||||||||||||||||||||||||||
| 2674 | - | |||||||||||||||||||||||||||||||
| 2675 | bool clips = (d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren); | - | ||||||||||||||||||||||||||||||
| 2676 | bool otherClips = (other->d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren); | - | ||||||||||||||||||||||||||||||
| 2677 |     if (clips
 
  | 0 | ||||||||||||||||||||||||||||||
| 2678 |         const QGraphicsItem *closestClipper = isAncestorOf(other)
  | 0 | ||||||||||||||||||||||||||||||
| 2679 |         while (closestClipper
 
  | 0 | ||||||||||||||||||||||||||||||
| 2680 |             closestClipper = closestClipper->parentItem(); never executed:  closestClipper = closestClipper->parentItem(); | 0 | ||||||||||||||||||||||||||||||
| 2681 |         const QGraphicsItem *otherClosestClipper = other->isAncestorOf(this)
  | 0 | ||||||||||||||||||||||||||||||
| 2682 |         while (otherClosestClipper
 
  | 0 | ||||||||||||||||||||||||||||||
| 2683 |             otherClosestClipper = otherClosestClipper->parentItem(); never executed:  otherClosestClipper = otherClosestClipper->parentItem(); | 0 | ||||||||||||||||||||||||||||||
| 2684 |         if (closestClipper == otherClosestClipper
  | 0 | ||||||||||||||||||||||||||||||
| 2685 | d_ptr->localCollisionHack = 1; | - | ||||||||||||||||||||||||||||||
| 2686 | bool res = collidesWithPath(mapFromItem(other, other->shape()), mode); | - | ||||||||||||||||||||||||||||||
| 2687 | d_ptr->localCollisionHack = 0; | - | ||||||||||||||||||||||||||||||
| 2688 |             return never executed:   res;return res;never executed:  return res; | 0 | ||||||||||||||||||||||||||||||
| 2689 | } | - | ||||||||||||||||||||||||||||||
| 2690 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2691 | - | |||||||||||||||||||||||||||||||
| 2692 |     QPainterPath otherShape = other->isClipped()
  | 0 | ||||||||||||||||||||||||||||||
| 2693 |     return never executed:   collidesWithPath(mapFromItem(other, otherShape), mode);return collidesWithPath(mapFromItem(other, otherShape), mode);never executed:  return collidesWithPath(mapFromItem(other, otherShape), mode); | 0 | ||||||||||||||||||||||||||||||
| 2694 | } | - | ||||||||||||||||||||||||||||||
| 2695 | bool QGraphicsItem::collidesWithPath(const QPainterPath &path, Qt::ItemSelectionMode mode) const | - | ||||||||||||||||||||||||||||||
| 2696 | { | - | ||||||||||||||||||||||||||||||
| 2697 |     if (path.isEmpty()
  | 0 | ||||||||||||||||||||||||||||||
| 2698 | - | |||||||||||||||||||||||||||||||
| 2699 |         return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||
| 2700 | } | - | ||||||||||||||||||||||||||||||
| 2701 | - | |||||||||||||||||||||||||||||||
| 2702 | QRectF rectA(boundingRect()); | - | ||||||||||||||||||||||||||||||
| 2703 | _q_adjustRect(&rectA); | - | ||||||||||||||||||||||||||||||
| 2704 | QRectF rectB(path.controlPointRect()); | - | ||||||||||||||||||||||||||||||
| 2705 | _q_adjustRect(&rectB); | - | ||||||||||||||||||||||||||||||
| 2706 |     if (!rectA.intersects(rectB)
  | 0 | ||||||||||||||||||||||||||||||
| 2707 | - | |||||||||||||||||||||||||||||||
| 2708 | - | |||||||||||||||||||||||||||||||
| 2709 |         return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||
| 2710 | } | - | ||||||||||||||||||||||||||||||
| 2711 | - | |||||||||||||||||||||||||||||||
| 2712 | - | |||||||||||||||||||||||||||||||
| 2713 | QPainterPath thisShape; | - | ||||||||||||||||||||||||||||||
| 2714 |     if (mode == Qt::IntersectsItemShape
 
  | 0 | ||||||||||||||||||||||||||||||
| 2715 |         thisShape = (isClipped()
 
 never executed:  thisShape = (isClipped() && !d_ptr->localCollisionHack) ? clipPath() : shape(); | 0 | ||||||||||||||||||||||||||||||
| 2716 | else | - | ||||||||||||||||||||||||||||||
| 2717 |         thisShape.addRect(rectA); never executed:  thisShape.addRect(rectA); | 0 | ||||||||||||||||||||||||||||||
| 2718 | - | |||||||||||||||||||||||||||||||
| 2719 |     if (thisShape == QPainterPath()
  | 0 | ||||||||||||||||||||||||||||||
| 2720 | - | |||||||||||||||||||||||||||||||
| 2721 |         return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||
| 2722 | } | - | ||||||||||||||||||||||||||||||
| 2723 | - | |||||||||||||||||||||||||||||||
| 2724 | - | |||||||||||||||||||||||||||||||
| 2725 |     if (mode == Qt::IntersectsItemShape
 
  | 0 | ||||||||||||||||||||||||||||||
| 2726 |         return never executed:   path.intersects(thisShape);return path.intersects(thisShape);never executed:  return path.intersects(thisShape); | 0 | ||||||||||||||||||||||||||||||
| 2727 |     return never executed:   path.contains(thisShape);return path.contains(thisShape);never executed:  return path.contains(thisShape); | 0 | ||||||||||||||||||||||||||||||
| 2728 | } | - | ||||||||||||||||||||||||||||||
| 2729 | QList<QGraphicsItem *> QGraphicsItem::collidingItems(Qt::ItemSelectionMode mode) const | - | ||||||||||||||||||||||||||||||
| 2730 | { | - | ||||||||||||||||||||||||||||||
| 2731 |     if (d_ptr->scene
  | 0 | ||||||||||||||||||||||||||||||
| 2732 |         return never executed:   d_ptr->scene->collidingItems(this, mode);return d_ptr->scene->collidingItems(this, mode);never executed:  return d_ptr->scene->collidingItems(this, mode); | 0 | ||||||||||||||||||||||||||||||
| 2733 |     return never executed:   QList<QGraphicsItem *>();return QList<QGraphicsItem *>();never executed:  return QList<QGraphicsItem *>(); | 0 | ||||||||||||||||||||||||||||||
| 2734 | } | - | ||||||||||||||||||||||||||||||
| 2735 | static bool qt_QGraphicsItem_isObscured(const QGraphicsItem *item, | - | ||||||||||||||||||||||||||||||
| 2736 | const QGraphicsItem *other, | - | ||||||||||||||||||||||||||||||
| 2737 | const QRectF &rect) | - | ||||||||||||||||||||||||||||||
| 2738 | { | - | ||||||||||||||||||||||||||||||
| 2739 |     return never executed:   other->mapToItem(item, other->opaqueArea()).contains(rect);return other->mapToItem(item, other->opaqueArea()).contains(rect);never executed:  return other->mapToItem(item, other->opaqueArea()).contains(rect); | 0 | ||||||||||||||||||||||||||||||
| 2740 | } | - | ||||||||||||||||||||||||||||||
| 2741 | bool QGraphicsItem::isObscured(const QRectF &rect) const | - | ||||||||||||||||||||||||||||||
| 2742 | { | - | ||||||||||||||||||||||||||||||
| 2743 | const QGraphicsItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 2744 |     if (!d->scene
  | 0 | ||||||||||||||||||||||||||||||
| 2745 |         return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||
| 2746 | - | |||||||||||||||||||||||||||||||
| 2747 | QRectF br = boundingRect(); | - | ||||||||||||||||||||||||||||||
| 2748 |     QRectF testRect = rect.isNull()
  | 0 | ||||||||||||||||||||||||||||||
| 2749 | - | |||||||||||||||||||||||||||||||
| 2750 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(d->scene->items(mapToScene(br), Qt::IntersectsItemBoundingRect))>::type> _container_((d->scene->items(mapToScene(br), Qt::IntersectsItemBoundingRect))); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QGraphicsItem *item = *_container_.i; _container_.control; _container_.control = 0) { | - | ||||||||||||||||||||||||||||||
| 2751 |         if (item == this
  | 0 | ||||||||||||||||||||||||||||||
| 2752 |             break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 2753 |         if (qt_QGraphicsItem_isObscured(this, item, testRect)
  | 0 | ||||||||||||||||||||||||||||||
| 2754 |             return never executed:   true;return true;never executed:  return true; | 0 | ||||||||||||||||||||||||||||||
| 2755 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2756 |     return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||
| 2757 | } | - | ||||||||||||||||||||||||||||||
| 2758 | bool QGraphicsItem::isObscuredBy(const QGraphicsItem *item) const | - | ||||||||||||||||||||||||||||||
| 2759 | { | - | ||||||||||||||||||||||||||||||
| 2760 |     if (!item
  | 0 | ||||||||||||||||||||||||||||||
| 2761 |         return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||
| 2762 |     return never executed:   qt_closestItemFirst(item, this)return qt_closestItemFirst(item, this) && qt_QGraphicsItem_isObscured(this, item, boundingRect());
 never executed:  return qt_closestItemFirst(item, this) && qt_QGraphicsItem_isObscured(this, item, boundingRect()); | 0 | ||||||||||||||||||||||||||||||
| 2763 |         && qt_QGraphicsItem_isObscured(this, item, boundingRect())
 never executed:  return qt_closestItemFirst(item, this) && qt_QGraphicsItem_isObscured(this, item, boundingRect()); | 0 | ||||||||||||||||||||||||||||||
| 2764 | } | - | ||||||||||||||||||||||||||||||
| 2765 | QPainterPath QGraphicsItem::opaqueArea() const | - | ||||||||||||||||||||||||||||||
| 2766 | { | - | ||||||||||||||||||||||||||||||
| 2767 |     return never executed:   QPainterPath();return QPainterPath();never executed:  return QPainterPath(); | 0 | ||||||||||||||||||||||||||||||
| 2768 | } | - | ||||||||||||||||||||||||||||||
| 2769 | QRegion QGraphicsItem::boundingRegion(const QTransform &itemToDeviceTransform) const | - | ||||||||||||||||||||||||||||||
| 2770 | { | - | ||||||||||||||||||||||||||||||
| 2771 | qreal granularity = boundingRegionGranularity(); | - | ||||||||||||||||||||||||||||||
| 2772 | QRect deviceRect = itemToDeviceTransform.mapRect(boundingRect()).toRect(); | - | ||||||||||||||||||||||||||||||
| 2773 | _q_adjustRect(&deviceRect); | - | ||||||||||||||||||||||||||||||
| 2774 |     if (granularity == 0.0
  | 0 | ||||||||||||||||||||||||||||||
| 2775 |         return never executed:   QRegion(deviceRect);return QRegion(deviceRect);never executed:  return QRegion(deviceRect); | 0 | ||||||||||||||||||||||||||||||
| 2776 | - | |||||||||||||||||||||||||||||||
| 2777 | int pad = 1; | - | ||||||||||||||||||||||||||||||
| 2778 | QSize bitmapSize(qMax(1, int(deviceRect.width() * granularity) + pad * 2), | - | ||||||||||||||||||||||||||||||
| 2779 | qMax(1, int(deviceRect.height() * granularity) + pad * 2)); | - | ||||||||||||||||||||||||||||||
| 2780 | QImage mask(bitmapSize, QImage::Format_ARGB32_Premultiplied); | - | ||||||||||||||||||||||||||||||
| 2781 | mask.fill(0); | - | ||||||||||||||||||||||||||||||
| 2782 | QPainter p(&mask); | - | ||||||||||||||||||||||||||||||
| 2783 | p.setRenderHints(QPainter::Antialiasing); | - | ||||||||||||||||||||||||||||||
| 2784 | - | |||||||||||||||||||||||||||||||
| 2785 | - | |||||||||||||||||||||||||||||||
| 2786 | - | |||||||||||||||||||||||||||||||
| 2787 | QPointF viewOrigo = itemToDeviceTransform.map(QPointF(0, 0)); | - | ||||||||||||||||||||||||||||||
| 2788 | QPointF offset = viewOrigo - deviceRect.topLeft(); | - | ||||||||||||||||||||||||||||||
| 2789 | p.scale(granularity, granularity); | - | ||||||||||||||||||||||||||||||
| 2790 | p.translate(offset); | - | ||||||||||||||||||||||||||||||
| 2791 | p.translate(pad, pad); | - | ||||||||||||||||||||||||||||||
| 2792 | p.setWorldTransform(itemToDeviceTransform, true); | - | ||||||||||||||||||||||||||||||
| 2793 | p.translate(itemToDeviceTransform.inverted().map(QPointF(0, 0))); | - | ||||||||||||||||||||||||||||||
| 2794 | - | |||||||||||||||||||||||||||||||
| 2795 | - | |||||||||||||||||||||||||||||||
| 2796 | QStyleOptionGraphicsItem option; | - | ||||||||||||||||||||||||||||||
| 2797 | const_cast<QGraphicsItem *>(this)->paint(&p, &option, 0); | - | ||||||||||||||||||||||||||||||
| 2798 | p.end(); | - | ||||||||||||||||||||||||||||||
| 2799 | - | |||||||||||||||||||||||||||||||
| 2800 | - | |||||||||||||||||||||||||||||||
| 2801 | QTransform unscale = QTransform::fromScale(1 / granularity, 1 / granularity); | - | ||||||||||||||||||||||||||||||
| 2802 | QRegion r; | - | ||||||||||||||||||||||||||||||
| 2803 | QBitmap colorMask = QBitmap::fromImage(mask.createMaskFromColor(0)); | - | ||||||||||||||||||||||||||||||
| 2804 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(QRegion( colorMask ).rects())>::type> _container_((QRegion( colorMask ).rects())); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (const QRect &rect = *_container_.i; _container_.control; _container_.control = 0) { | - | ||||||||||||||||||||||||||||||
| 2805 | QRect xrect = unscale.mapRect(rect).translated(deviceRect.topLeft() - QPoint(pad, pad)); | - | ||||||||||||||||||||||||||||||
| 2806 | r += xrect.adjusted(-1, -1, 1, 1) & deviceRect; | - | ||||||||||||||||||||||||||||||
| 2807 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2808 |     return never executed:   r;return r;never executed:  return r; | 0 | ||||||||||||||||||||||||||||||
| 2809 | } | - | ||||||||||||||||||||||||||||||
| 2810 | qreal QGraphicsItem::boundingRegionGranularity() const | - | ||||||||||||||||||||||||||||||
| 2811 | { | - | ||||||||||||||||||||||||||||||
| 2812 |     return never executed:   d_ptr->hasBoundingRegionGranularityreturn d_ptr->hasBoundingRegionGranularity ? qvariant_cast<qreal>(d_ptr->extra(QGraphicsItemPrivate::ExtraBoundingRegionGranularity)) : 0;
 never executed:  return d_ptr->hasBoundingRegionGranularity ? qvariant_cast<qreal>(d_ptr->extra(QGraphicsItemPrivate::ExtraBoundingRegionGranularity)) : 0; | 0 | ||||||||||||||||||||||||||||||
| 2813 |         ? qvariant_cast<qreal>(d_ptr->extra(QGraphicsItemPrivate::ExtraBoundingRegionGranularity)) never executed:  return d_ptr->hasBoundingRegionGranularity ? qvariant_cast<qreal>(d_ptr->extra(QGraphicsItemPrivate::ExtraBoundingRegionGranularity)) : 0; | 0 | ||||||||||||||||||||||||||||||
| 2814 |         : 0; never executed:  return d_ptr->hasBoundingRegionGranularity ? qvariant_cast<qreal>(d_ptr->extra(QGraphicsItemPrivate::ExtraBoundingRegionGranularity)) : 0; | 0 | ||||||||||||||||||||||||||||||
| 2815 | } | - | ||||||||||||||||||||||||||||||
| 2816 | void QGraphicsItem::setBoundingRegionGranularity(qreal granularity) | - | ||||||||||||||||||||||||||||||
| 2817 | { | - | ||||||||||||||||||||||||||||||
| 2818 |     if (granularity < 0.0
 
  | 0 | ||||||||||||||||||||||||||||||
| 2819 | QMessageLogger(__FILE__, 5314, __PRETTY_FUNCTION__).warning("QGraphicsItem::setBoundingRegionGranularity: invalid granularity %g", granularity); | - | ||||||||||||||||||||||||||||||
| 2820 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 2821 | } | - | ||||||||||||||||||||||||||||||
| 2822 |     if (granularity == 0.0
  | 0 | ||||||||||||||||||||||||||||||
| 2823 | d_ptr->unsetExtra(QGraphicsItemPrivate::ExtraBoundingRegionGranularity); | - | ||||||||||||||||||||||||||||||
| 2824 | d_ptr->hasBoundingRegionGranularity = 0; | - | ||||||||||||||||||||||||||||||
| 2825 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 2826 | } | - | ||||||||||||||||||||||||||||||
| 2827 | d_ptr->hasBoundingRegionGranularity = 1; | - | ||||||||||||||||||||||||||||||
| 2828 | d_ptr->setExtra(QGraphicsItemPrivate::ExtraBoundingRegionGranularity, | - | ||||||||||||||||||||||||||||||
| 2829 | QVariant::fromValue<qreal>(granularity)); | - | ||||||||||||||||||||||||||||||
| 2830 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2831 | bool QGraphicsItemPrivate::discardUpdateRequest(bool ignoreVisibleBit, bool ignoreDirtyBit, | - | ||||||||||||||||||||||||||||||
| 2832 | bool ignoreOpacity) const | - | ||||||||||||||||||||||||||||||
| 2833 | { | - | ||||||||||||||||||||||||||||||
| 2834 | - | |||||||||||||||||||||||||||||||
| 2835 | - | |||||||||||||||||||||||||||||||
| 2836 |     return never executed:   !scenereturn !scene || (!visible && !ignoreVisibleBit && !this->ignoreVisible) || (!ignoreDirtyBit && fullUpdatePending) || (!ignoreOpacity && !this->ignoreOpacity && childrenCombineOpacity() && isFullyTransparent());
 never executed:  return !scene || (!visible && !ignoreVisibleBit && !this->ignoreVisible) || (!ignoreDirtyBit && fullUpdatePending) || (!ignoreOpacity && !this->ignoreOpacity && childrenCombineOpacity() && isFullyTransparent()); | 0 | ||||||||||||||||||||||||||||||
| 2837 |            || (!visible
 
 
 never executed:  return !scene || (!visible && !ignoreVisibleBit && !this->ignoreVisible) || (!ignoreDirtyBit && fullUpdatePending) || (!ignoreOpacity && !this->ignoreOpacity && childrenCombineOpacity() && isFullyTransparent()); | 0 | ||||||||||||||||||||||||||||||
| 2838 |            || (!ignoreDirtyBit
 
 never executed:  return !scene || (!visible && !ignoreVisibleBit && !this->ignoreVisible) || (!ignoreDirtyBit && fullUpdatePending) || (!ignoreOpacity && !this->ignoreOpacity && childrenCombineOpacity() && isFullyTransparent()); | 0 | ||||||||||||||||||||||||||||||
| 2839 |            || (!ignoreOpacity
 
 
 
 never executed:  return !scene || (!visible && !ignoreVisibleBit && !this->ignoreVisible) || (!ignoreDirtyBit && fullUpdatePending) || (!ignoreOpacity && !this->ignoreOpacity && childrenCombineOpacity() && isFullyTransparent()); | 0 | ||||||||||||||||||||||||||||||
| 2840 | } | - | ||||||||||||||||||||||||||||||
| 2841 | - | |||||||||||||||||||||||||||||||
| 2842 | - | |||||||||||||||||||||||||||||||
| 2843 | - | |||||||||||||||||||||||||||||||
| 2844 | - | |||||||||||||||||||||||||||||||
| 2845 | int QGraphicsItemPrivate::depth() const | - | ||||||||||||||||||||||||||||||
| 2846 | { | - | ||||||||||||||||||||||||||||||
| 2847 |     if (itemDepth == -1
  | 0 | ||||||||||||||||||||||||||||||
| 2848 |         const_cast< never executed:  QGraphicsItemPrivate *>(this)->resolveDepth();const_cast<QGraphicsItemPrivate *>(this)->resolveDepth();never executed:  const_cast<QGraphicsItemPrivate *>(this)->resolveDepth(); | 0 | ||||||||||||||||||||||||||||||
| 2849 | - | |||||||||||||||||||||||||||||||
| 2850 |     return never executed:   itemDepth;return itemDepth;never executed:  return itemDepth; | 0 | ||||||||||||||||||||||||||||||
| 2851 | } | - | ||||||||||||||||||||||||||||||
| 2852 | - | |||||||||||||||||||||||||||||||
| 2853 | - | |||||||||||||||||||||||||||||||
| 2854 | - | |||||||||||||||||||||||||||||||
| 2855 | - | |||||||||||||||||||||||||||||||
| 2856 | - | |||||||||||||||||||||||||||||||
| 2857 | void QGraphicsItemPrivate::invalidateParentGraphicsEffectsRecursively() | - | ||||||||||||||||||||||||||||||
| 2858 | { | - | ||||||||||||||||||||||||||||||
| 2859 | QGraphicsItemPrivate *itemPrivate = this; | - | ||||||||||||||||||||||||||||||
| 2860 | do { | - | ||||||||||||||||||||||||||||||
| 2861 |         if (itemPrivate->graphicsEffect
  | 0 | ||||||||||||||||||||||||||||||
| 2862 | itemPrivate->notifyInvalidated = 1; | - | ||||||||||||||||||||||||||||||
| 2863 | - | |||||||||||||||||||||||||||||||
| 2864 |             if (!itemPrivate->updateDueToGraphicsEffect
  | 0 | ||||||||||||||||||||||||||||||
| 2865 |                 static_cast< never executed:  QGraphicsItemEffectSourcePrivate *>(itemPrivate->graphicsEffect->d_func()->source->d_func())->invalidateCache();static_cast<QGraphicsItemEffectSourcePrivate *>(itemPrivate->graphicsEffect->d_func()->source->d_func())->invalidateCache();never executed:  static_cast<QGraphicsItemEffectSourcePrivate *>(itemPrivate->graphicsEffect->d_func()->source->d_func())->invalidateCache(); | 0 | ||||||||||||||||||||||||||||||
| 2866 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2867 |     } never executed:   while ((end of block
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 2868 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2869 | - | |||||||||||||||||||||||||||||||
| 2870 | void QGraphicsItemPrivate::invalidateChildGraphicsEffectsRecursively(QGraphicsItemPrivate::InvalidateReason reason) | - | ||||||||||||||||||||||||||||||
| 2871 | { | - | ||||||||||||||||||||||||||||||
| 2872 |     if (!mayHaveChildWithGraphicsEffect
  | 0 | ||||||||||||||||||||||||||||||
| 2873 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 2874 | - | |||||||||||||||||||||||||||||||
| 2875 |     for (int i = 0; i < children.size()
  | 0 | ||||||||||||||||||||||||||||||
| 2876 | QGraphicsItemPrivate *childPrivate = children.at(i)->d_ptr.data(); | - | ||||||||||||||||||||||||||||||
| 2877 |         if (reason == OpacityChanged
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 2878 |             continue; never executed:  continue; | 0 | ||||||||||||||||||||||||||||||
| 2879 |         if (childPrivate->graphicsEffect
  | 0 | ||||||||||||||||||||||||||||||
| 2880 | childPrivate->notifyInvalidated = 1; | - | ||||||||||||||||||||||||||||||
| 2881 | static_cast<QGraphicsItemEffectSourcePrivate *>(childPrivate->graphicsEffect->d_func()->source->d_func())->invalidateCache(); | - | ||||||||||||||||||||||||||||||
| 2882 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2883 | - | |||||||||||||||||||||||||||||||
| 2884 | childPrivate->invalidateChildGraphicsEffectsRecursively(reason); | - | ||||||||||||||||||||||||||||||
| 2885 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2886 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2887 | - | |||||||||||||||||||||||||||||||
| 2888 | - | |||||||||||||||||||||||||||||||
| 2889 | - | |||||||||||||||||||||||||||||||
| 2890 | - | |||||||||||||||||||||||||||||||
| 2891 | - | |||||||||||||||||||||||||||||||
| 2892 | void QGraphicsItemPrivate::invalidateDepthRecursively() | - | ||||||||||||||||||||||||||||||
| 2893 | { | - | ||||||||||||||||||||||||||||||
| 2894 |     if (itemDepth == -1
  | 0 | ||||||||||||||||||||||||||||||
| 2895 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 2896 | - | |||||||||||||||||||||||||||||||
| 2897 | itemDepth = -1; | - | ||||||||||||||||||||||||||||||
| 2898 |     for (int i = 0; i < children.size()
  | 0 | ||||||||||||||||||||||||||||||
| 2899 |         children.at(i)->d_ptr->invalidateDepthRecursively(); never executed:  children.at(i)->d_ptr->invalidateDepthRecursively(); | 0 | ||||||||||||||||||||||||||||||
| 2900 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2901 | - | |||||||||||||||||||||||||||||||
| 2902 | - | |||||||||||||||||||||||||||||||
| 2903 | - | |||||||||||||||||||||||||||||||
| 2904 | - | |||||||||||||||||||||||||||||||
| 2905 | - | |||||||||||||||||||||||||||||||
| 2906 | - | |||||||||||||||||||||||||||||||
| 2907 | void QGraphicsItemPrivate::resolveDepth() | - | ||||||||||||||||||||||||||||||
| 2908 | { | - | ||||||||||||||||||||||||||||||
| 2909 |     if (!parent
  | 0 | ||||||||||||||||||||||||||||||
| 2910 |         itemDepth = 0; never executed:  itemDepth = 0; | 0 | ||||||||||||||||||||||||||||||
| 2911 | else { | - | ||||||||||||||||||||||||||||||
| 2912 |         if (parent->d_ptr->itemDepth == -1
  | 0 | ||||||||||||||||||||||||||||||
| 2913 |             parent->d_ptr->resolveDepth(); never executed:  parent->d_ptr->resolveDepth(); | 0 | ||||||||||||||||||||||||||||||
| 2914 | itemDepth = parent->d_ptr->itemDepth + 1; | - | ||||||||||||||||||||||||||||||
| 2915 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2916 | } | - | ||||||||||||||||||||||||||||||
| 2917 | - | |||||||||||||||||||||||||||||||
| 2918 | - | |||||||||||||||||||||||||||||||
| 2919 | - | |||||||||||||||||||||||||||||||
| 2920 | - | |||||||||||||||||||||||||||||||
| 2921 | - | |||||||||||||||||||||||||||||||
| 2922 | - | |||||||||||||||||||||||||||||||
| 2923 | - | |||||||||||||||||||||||||||||||
| 2924 | void QGraphicsItemPrivate::addChild(QGraphicsItem *child) | - | ||||||||||||||||||||||||||||||
| 2925 | { | - | ||||||||||||||||||||||||||||||
| 2926 | - | |||||||||||||||||||||||||||||||
| 2927 | - | |||||||||||||||||||||||||||||||
| 2928 | ensureSequentialSiblingIndex(); | - | ||||||||||||||||||||||||||||||
| 2929 | needSortChildren = 1; | - | ||||||||||||||||||||||||||||||
| 2930 | child->d_ptr->siblingIndex = children.size(); | - | ||||||||||||||||||||||||||||||
| 2931 | children.append(child); | - | ||||||||||||||||||||||||||||||
| 2932 |     if (isObject
  | 0 | ||||||||||||||||||||||||||||||
| 2933 |         static_cast< never executed:  QGraphicsObject *>(q_ptr)->childrenChanged();static_cast<QGraphicsObject *>(q_ptr)->childrenChanged();never executed:  static_cast<QGraphicsObject *>(q_ptr)->childrenChanged(); | 0 | ||||||||||||||||||||||||||||||
| 2934 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2935 | - | |||||||||||||||||||||||||||||||
| 2936 | - | |||||||||||||||||||||||||||||||
| 2937 | - | |||||||||||||||||||||||||||||||
| 2938 | - | |||||||||||||||||||||||||||||||
| 2939 | - | |||||||||||||||||||||||||||||||
| 2940 | - | |||||||||||||||||||||||||||||||
| 2941 | - | |||||||||||||||||||||||||||||||
| 2942 | void QGraphicsItemPrivate::removeChild(QGraphicsItem *child) | - | ||||||||||||||||||||||||||||||
| 2943 | { | - | ||||||||||||||||||||||||||||||
| 2944 | - | |||||||||||||||||||||||||||||||
| 2945 | - | |||||||||||||||||||||||||||||||
| 2946 |     if (!holesInSiblingIndex
  | 0 | ||||||||||||||||||||||||||||||
| 2947 |         holesInSiblingIndex = child->d_ptr->siblingIndex != children.size() - 1; never executed:  holesInSiblingIndex = child->d_ptr->siblingIndex != children.size() - 1; | 0 | ||||||||||||||||||||||||||||||
| 2948 |     if (sequentialOrdering
 
  | 0 | ||||||||||||||||||||||||||||||
| 2949 |         children.removeAt(child->d_ptr->siblingIndex); never executed:  children.removeAt(child->d_ptr->siblingIndex); | 0 | ||||||||||||||||||||||||||||||
| 2950 | else | - | ||||||||||||||||||||||||||||||
| 2951 |         children.removeOne(child); never executed:  children.removeOne(child); | 0 | ||||||||||||||||||||||||||||||
| 2952 | - | |||||||||||||||||||||||||||||||
| 2953 | - | |||||||||||||||||||||||||||||||
| 2954 | - | |||||||||||||||||||||||||||||||
| 2955 | child->d_ptr->siblingIndex = -1; | - | ||||||||||||||||||||||||||||||
| 2956 |     if (isObject
  | 0 | ||||||||||||||||||||||||||||||
| 2957 |         static_cast< never executed:  QGraphicsObject *>(q_ptr)->childrenChanged();static_cast<QGraphicsObject *>(q_ptr)->childrenChanged();never executed:  static_cast<QGraphicsObject *>(q_ptr)->childrenChanged(); | 0 | ||||||||||||||||||||||||||||||
| 2958 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2959 | - | |||||||||||||||||||||||||||||||
| 2960 | - | |||||||||||||||||||||||||||||||
| 2961 | - | |||||||||||||||||||||||||||||||
| 2962 | - | |||||||||||||||||||||||||||||||
| 2963 | QGraphicsItemCache *QGraphicsItemPrivate::maybeExtraItemCache() const | - | ||||||||||||||||||||||||||||||
| 2964 | { | - | ||||||||||||||||||||||||||||||
| 2965 |     return never executed:   (QGraphicsItemCache *)qvariant_cast<void *>(extra(ExtraCacheData));return (QGraphicsItemCache *)qvariant_cast<void *>(extra(ExtraCacheData));never executed:  return (QGraphicsItemCache *)qvariant_cast<void *>(extra(ExtraCacheData)); | 0 | ||||||||||||||||||||||||||||||
| 2966 | } | - | ||||||||||||||||||||||||||||||
| 2967 | - | |||||||||||||||||||||||||||||||
| 2968 | - | |||||||||||||||||||||||||||||||
| 2969 | - | |||||||||||||||||||||||||||||||
| 2970 | - | |||||||||||||||||||||||||||||||
| 2971 | QGraphicsItemCache *QGraphicsItemPrivate::extraItemCache() const | - | ||||||||||||||||||||||||||||||
| 2972 | { | - | ||||||||||||||||||||||||||||||
| 2973 | QGraphicsItemCache *c = (QGraphicsItemCache *)qvariant_cast<void *>(extra(ExtraCacheData)); | - | ||||||||||||||||||||||||||||||
| 2974 |     if (!c
  | 0 | ||||||||||||||||||||||||||||||
| 2975 | QGraphicsItemPrivate *that = const_cast<QGraphicsItemPrivate *>(this); | - | ||||||||||||||||||||||||||||||
| 2976 | c = new QGraphicsItemCache; | - | ||||||||||||||||||||||||||||||
| 2977 | that->setExtra(ExtraCacheData, QVariant::fromValue<void *>(c)); | - | ||||||||||||||||||||||||||||||
| 2978 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2979 |     return never executed:   c;return c;never executed:  return c; | 0 | ||||||||||||||||||||||||||||||
| 2980 | } | - | ||||||||||||||||||||||||||||||
| 2981 | - | |||||||||||||||||||||||||||||||
| 2982 | - | |||||||||||||||||||||||||||||||
| 2983 | - | |||||||||||||||||||||||||||||||
| 2984 | - | |||||||||||||||||||||||||||||||
| 2985 | void QGraphicsItemPrivate::removeExtraItemCache() | - | ||||||||||||||||||||||||||||||
| 2986 | { | - | ||||||||||||||||||||||||||||||
| 2987 | QGraphicsItemCache *c = (QGraphicsItemCache *)qvariant_cast<void *>(extra(ExtraCacheData)); | - | ||||||||||||||||||||||||||||||
| 2988 |     if (c
  | 0 | ||||||||||||||||||||||||||||||
| 2989 | c->purge(); | - | ||||||||||||||||||||||||||||||
| 2990 | delete c; | - | ||||||||||||||||||||||||||||||
| 2991 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2992 | unsetExtra(ExtraCacheData); | - | ||||||||||||||||||||||||||||||
| 2993 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 2994 | - | |||||||||||||||||||||||||||||||
| 2995 | void QGraphicsItemPrivate::updatePaintedViewBoundingRects(bool updateChildren) | - | ||||||||||||||||||||||||||||||
| 2996 | { | - | ||||||||||||||||||||||||||||||
| 2997 |     if (!scene
  | 0 | ||||||||||||||||||||||||||||||
| 2998 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 2999 | - | |||||||||||||||||||||||||||||||
| 3000 |     for (int i = 0; i < scene->d_func()->views.size()
  | 0 | ||||||||||||||||||||||||||||||
| 3001 | QGraphicsViewPrivate *viewPrivate = scene->d_func()->views.at(i)->d_func(); | - | ||||||||||||||||||||||||||||||
| 3002 | QRect rect = paintedViewBoundingRects.value(viewPrivate->viewport); | - | ||||||||||||||||||||||||||||||
| 3003 | rect.translate(viewPrivate->dirtyScrollOffset); | - | ||||||||||||||||||||||||||||||
| 3004 | viewPrivate->updateRect(rect); | - | ||||||||||||||||||||||||||||||
| 3005 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3006 | - | |||||||||||||||||||||||||||||||
| 3007 |     if (updateChildren
  | 0 | ||||||||||||||||||||||||||||||
| 3008 |         for (int i = 0; i < children.size()
  | 0 | ||||||||||||||||||||||||||||||
| 3009 |             children.at(i)->d_ptr->updatePaintedViewBoundingRects(true); never executed:  children.at(i)->d_ptr->updatePaintedViewBoundingRects(true); | 0 | ||||||||||||||||||||||||||||||
| 3010 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3011 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3012 | - | |||||||||||||||||||||||||||||||
| 3013 | - | |||||||||||||||||||||||||||||||
| 3014 | - | |||||||||||||||||||||||||||||||
| 3015 | - | |||||||||||||||||||||||||||||||
| 3016 | - | |||||||||||||||||||||||||||||||
| 3017 | - | |||||||||||||||||||||||||||||||
| 3018 | void QGraphicsItemPrivate::ensureSceneTransformRecursive(QGraphicsItem **topMostDirtyItem) | - | ||||||||||||||||||||||||||||||
| 3019 | { | - | ||||||||||||||||||||||||||||||
| 3020 | ((!(topMostDirtyItem)) ? qt_assert("topMostDirtyItem",__FILE__,5564) : qt_noop()); | - | ||||||||||||||||||||||||||||||
| 3021 | - | |||||||||||||||||||||||||||||||
| 3022 |     if (dirtySceneTransform
  | 0 | ||||||||||||||||||||||||||||||
| 3023 |         * never executed:  topMostDirtyItem = q_ptr;*topMostDirtyItem = q_ptr;never executed:  *topMostDirtyItem = q_ptr; | 0 | ||||||||||||||||||||||||||||||
| 3024 | - | |||||||||||||||||||||||||||||||
| 3025 |     if (parent
  | 0 | ||||||||||||||||||||||||||||||
| 3026 |         parent->d_ptr->ensureSceneTransformRecursive(topMostDirtyItem); never executed:  parent->d_ptr->ensureSceneTransformRecursive(topMostDirtyItem); | 0 | ||||||||||||||||||||||||||||||
| 3027 | - | |||||||||||||||||||||||||||||||
| 3028 |     if (*
 
  | 0 | ||||||||||||||||||||||||||||||
| 3029 |         if (!dirtySceneTransform
  | 0 | ||||||||||||||||||||||||||||||
| 3030 |             return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 3031 | *topMostDirtyItem = 0; | - | ||||||||||||||||||||||||||||||
| 3032 |     } never executed:   else if (*end of block
 
  | 0 | ||||||||||||||||||||||||||||||
| 3033 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 3034 | } | - | ||||||||||||||||||||||||||||||
| 3035 | - | |||||||||||||||||||||||||||||||
| 3036 | - | |||||||||||||||||||||||||||||||
| 3037 | - | |||||||||||||||||||||||||||||||
| 3038 | - | |||||||||||||||||||||||||||||||
| 3039 | - | |||||||||||||||||||||||||||||||
| 3040 | invalidateChildrenSceneTransform(); | - | ||||||||||||||||||||||||||||||
| 3041 | - | |||||||||||||||||||||||||||||||
| 3042 | - | |||||||||||||||||||||||||||||||
| 3043 | updateSceneTransformFromParent(); | - | ||||||||||||||||||||||||||||||
| 3044 | ((!(!dirtySceneTransform)) ? qt_assert("!dirtySceneTransform",__FILE__,5588) : qt_noop()); | - | ||||||||||||||||||||||||||||||
| 3045 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3046 | - | |||||||||||||||||||||||||||||||
| 3047 | - | |||||||||||||||||||||||||||||||
| 3048 | - | |||||||||||||||||||||||||||||||
| 3049 | - | |||||||||||||||||||||||||||||||
| 3050 | void QGraphicsItemPrivate::setSubFocus(QGraphicsItem *rootItem, QGraphicsItem *stopItem) | - | ||||||||||||||||||||||||||||||
| 3051 | { | - | ||||||||||||||||||||||||||||||
| 3052 | - | |||||||||||||||||||||||||||||||
| 3053 | - | |||||||||||||||||||||||||||||||
| 3054 |     QGraphicsItem *parent = rootItem
  | 0 | ||||||||||||||||||||||||||||||
| 3055 |     if (parent->panel() != q_ptr->panel()
  | 0 | ||||||||||||||||||||||||||||||
| 3056 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 3057 | - | |||||||||||||||||||||||||||||||
| 3058 | do { | - | ||||||||||||||||||||||||||||||
| 3059 | - | |||||||||||||||||||||||||||||||
| 3060 |         if (parent != q_ptr
 
  | 0 | ||||||||||||||||||||||||||||||
| 3061 |             if (parent->d_ptr->subFocusItem == q_ptr
  | 0 | ||||||||||||||||||||||||||||||
| 3062 |                 break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 3063 | parent->d_ptr->subFocusItem->d_ptr->clearSubFocus(0, stopItem); | - | ||||||||||||||||||||||||||||||
| 3064 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3065 | parent->d_ptr->subFocusItem = q_ptr; | - | ||||||||||||||||||||||||||||||
| 3066 | parent->d_ptr->subFocusItemChange(); | - | ||||||||||||||||||||||||||||||
| 3067 |     } never executed:   while (!parent->isPanel()end of block
 
 
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 3068 | - | |||||||||||||||||||||||||||||||
| 3069 |     if (scene
 
  | 0 | ||||||||||||||||||||||||||||||
| 3070 | scene->d_func()->passiveFocusItem = subFocusItem; | - | ||||||||||||||||||||||||||||||
| 3071 | scene->d_func()->lastFocusItem = subFocusItem; | - | ||||||||||||||||||||||||||||||
| 3072 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3073 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3074 | - | |||||||||||||||||||||||||||||||
| 3075 | - | |||||||||||||||||||||||||||||||
| 3076 | - | |||||||||||||||||||||||||||||||
| 3077 | - | |||||||||||||||||||||||||||||||
| 3078 | void QGraphicsItemPrivate::clearSubFocus(QGraphicsItem *rootItem, QGraphicsItem *stopItem) | - | ||||||||||||||||||||||||||||||
| 3079 | { | - | ||||||||||||||||||||||||||||||
| 3080 | - | |||||||||||||||||||||||||||||||
| 3081 |     QGraphicsItem *parent = rootItem
  | 0 | ||||||||||||||||||||||||||||||
| 3082 | do { | - | ||||||||||||||||||||||||||||||
| 3083 |         if (parent->d_ptr->subFocusItem != q_ptr
  | 0 | ||||||||||||||||||||||||||||||
| 3084 |             break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 3085 | parent->d_ptr->subFocusItem = 0; | - | ||||||||||||||||||||||||||||||
| 3086 |         if (parent != stopItem
 
  | 0 | ||||||||||||||||||||||||||||||
| 3087 |             parent->d_ptr->subFocusItemChange(); never executed:  parent->d_ptr->subFocusItemChange(); | 0 | ||||||||||||||||||||||||||||||
| 3088 |     } never executed:   while (!parent->isPanel()end of block
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 3089 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3090 | - | |||||||||||||||||||||||||||||||
| 3091 | - | |||||||||||||||||||||||||||||||
| 3092 | - | |||||||||||||||||||||||||||||||
| 3093 | - | |||||||||||||||||||||||||||||||
| 3094 | - | |||||||||||||||||||||||||||||||
| 3095 | - | |||||||||||||||||||||||||||||||
| 3096 | - | |||||||||||||||||||||||||||||||
| 3097 | void QGraphicsItemPrivate::resetFocusProxy() | - | ||||||||||||||||||||||||||||||
| 3098 | { | - | ||||||||||||||||||||||||||||||
| 3099 |     for (int i = 0; i < focusProxyRefs.size()
  | 0 | ||||||||||||||||||||||||||||||
| 3100 |         * never executed:  focusProxyRefs.at(i) = 0;*focusProxyRefs.at(i) = 0;never executed:  *focusProxyRefs.at(i) = 0; | 0 | ||||||||||||||||||||||||||||||
| 3101 | focusProxyRefs.clear(); | - | ||||||||||||||||||||||||||||||
| 3102 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3103 | - | |||||||||||||||||||||||||||||||
| 3104 | - | |||||||||||||||||||||||||||||||
| 3105 | - | |||||||||||||||||||||||||||||||
| 3106 | - | |||||||||||||||||||||||||||||||
| 3107 | - | |||||||||||||||||||||||||||||||
| 3108 | - | |||||||||||||||||||||||||||||||
| 3109 | - | |||||||||||||||||||||||||||||||
| 3110 | void QGraphicsItemPrivate::subFocusItemChange() | - | ||||||||||||||||||||||||||||||
| 3111 | { | - | ||||||||||||||||||||||||||||||
| 3112 | } | - | ||||||||||||||||||||||||||||||
| 3113 | - | |||||||||||||||||||||||||||||||
| 3114 | - | |||||||||||||||||||||||||||||||
| 3115 | - | |||||||||||||||||||||||||||||||
| 3116 | - | |||||||||||||||||||||||||||||||
| 3117 | - | |||||||||||||||||||||||||||||||
| 3118 | - | |||||||||||||||||||||||||||||||
| 3119 | - | |||||||||||||||||||||||||||||||
| 3120 | void QGraphicsItemPrivate::focusScopeItemChange(bool isSubFocusItem) | - | ||||||||||||||||||||||||||||||
| 3121 | { | - | ||||||||||||||||||||||||||||||
| 3122 | (void)isSubFocusItem;; | - | ||||||||||||||||||||||||||||||
| 3123 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3124 | - | |||||||||||||||||||||||||||||||
| 3125 | - | |||||||||||||||||||||||||||||||
| 3126 | - | |||||||||||||||||||||||||||||||
| 3127 | - | |||||||||||||||||||||||||||||||
| 3128 | - | |||||||||||||||||||||||||||||||
| 3129 | - | |||||||||||||||||||||||||||||||
| 3130 | - | |||||||||||||||||||||||||||||||
| 3131 | void QGraphicsItemPrivate::siblingOrderChange() | - | ||||||||||||||||||||||||||||||
| 3132 | { | - | ||||||||||||||||||||||||||||||
| 3133 | } | - | ||||||||||||||||||||||||||||||
| 3134 | - | |||||||||||||||||||||||||||||||
| 3135 | - | |||||||||||||||||||||||||||||||
| 3136 | - | |||||||||||||||||||||||||||||||
| 3137 | - | |||||||||||||||||||||||||||||||
| 3138 | - | |||||||||||||||||||||||||||||||
| 3139 | - | |||||||||||||||||||||||||||||||
| 3140 | bool QGraphicsItemPrivate::isProxyWidget() const | - | ||||||||||||||||||||||||||||||
| 3141 | { | - | ||||||||||||||||||||||||||||||
| 3142 |     return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||
| 3143 | } | - | ||||||||||||||||||||||||||||||
| 3144 | void QGraphicsItem::update(const QRectF &rect) | - | ||||||||||||||||||||||||||||||
| 3145 | { | - | ||||||||||||||||||||||||||||||
| 3146 |     if (rect.isEmpty()
 
  | 0 | ||||||||||||||||||||||||||||||
| 3147 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 3148 | - | |||||||||||||||||||||||||||||||
| 3149 | - | |||||||||||||||||||||||||||||||
| 3150 | - | |||||||||||||||||||||||||||||||
| 3151 | d_ptr->invalidateParentGraphicsEffectsRecursively(); | - | ||||||||||||||||||||||||||||||
| 3152 | - | |||||||||||||||||||||||||||||||
| 3153 | - | |||||||||||||||||||||||||||||||
| 3154 |     if (CacheMode(d_ptr->cacheMode) != NoCache
  | 0 | ||||||||||||||||||||||||||||||
| 3155 | - | |||||||||||||||||||||||||||||||
| 3156 | QGraphicsItemCache *cache = d_ptr->extraItemCache(); | - | ||||||||||||||||||||||||||||||
| 3157 |         if (!cache->allExposed
  | 0 | ||||||||||||||||||||||||||||||
| 3158 |             if (rect.isNull()
  | 0 | ||||||||||||||||||||||||||||||
| 3159 | cache->allExposed = true; | - | ||||||||||||||||||||||||||||||
| 3160 | cache->exposed.clear(); | - | ||||||||||||||||||||||||||||||
| 3161 |             } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||
| 3162 | cache->exposed.append(rect); | - | ||||||||||||||||||||||||||||||
| 3163 |             } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3164 | } | - | ||||||||||||||||||||||||||||||
| 3165 | - | |||||||||||||||||||||||||||||||
| 3166 |         if (d_ptr->fullUpdatePending
  | 0 | ||||||||||||||||||||||||||||||
| 3167 |             return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 3168 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3169 | - | |||||||||||||||||||||||||||||||
| 3170 |     if (d_ptr->scene
  | 0 | ||||||||||||||||||||||||||||||
| 3171 |         d_ptr->scene->d_func()->markDirty(this, rect); never executed:  d_ptr->scene->d_func()->markDirty(this, rect); | 0 | ||||||||||||||||||||||||||||||
| 3172 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3173 | void QGraphicsItem::scroll(qreal dx, qreal dy, const QRectF &rect) | - | ||||||||||||||||||||||||||||||
| 3174 | { | - | ||||||||||||||||||||||||||||||
| 3175 | QGraphicsItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 3176 |     if (dx == 0.0
 
  | 0 | ||||||||||||||||||||||||||||||
| 3177 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 3178 |     if (!d->scene
  | 0 | ||||||||||||||||||||||||||||||
| 3179 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 3180 |     if (d->cacheMode != QGraphicsItem::ItemCoordinateCache
  | 0 | ||||||||||||||||||||||||||||||
| 3181 |         || !qFuzzyIsNull(dx - int(dx))
 
  | 0 | ||||||||||||||||||||||||||||||
| 3182 | update(rect); | - | ||||||||||||||||||||||||||||||
| 3183 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 3184 | } | - | ||||||||||||||||||||||||||||||
| 3185 | - | |||||||||||||||||||||||||||||||
| 3186 | QGraphicsItemCache *cache = d->extraItemCache(); | - | ||||||||||||||||||||||||||||||
| 3187 |     if (cache->allExposed
 
  | 0 | ||||||||||||||||||||||||||||||
| 3188 | - | |||||||||||||||||||||||||||||||
| 3189 | update(rect); | - | ||||||||||||||||||||||||||||||
| 3190 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 3191 | } | - | ||||||||||||||||||||||||||||||
| 3192 | - | |||||||||||||||||||||||||||||||
| 3193 | - | |||||||||||||||||||||||||||||||
| 3194 | QPixmap cachedPixmap; | - | ||||||||||||||||||||||||||||||
| 3195 |     if (!QPixmapCache::find(cache->key, &cachedPixmap)
  | 0 | ||||||||||||||||||||||||||||||
| 3196 | update(rect); | - | ||||||||||||||||||||||||||||||
| 3197 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 3198 | } | - | ||||||||||||||||||||||||||||||
| 3199 | - | |||||||||||||||||||||||||||||||
| 3200 |     QRect scrollRect = (rect.isNull()
  | 0 | ||||||||||||||||||||||||||||||
| 3201 |     if (!scrollRect.intersects(cache->boundingRect)
  | 0 | ||||||||||||||||||||||||||||||
| 3202 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 3203 | - | |||||||||||||||||||||||||||||||
| 3204 | - | |||||||||||||||||||||||||||||||
| 3205 | QPixmapCache::remove(cache->key); | - | ||||||||||||||||||||||||||||||
| 3206 | - | |||||||||||||||||||||||||||||||
| 3207 | QRegion exposed; | - | ||||||||||||||||||||||||||||||
| 3208 | cachedPixmap.scroll(dx, dy, scrollRect.translated(-cache->boundingRect.topLeft()), &exposed); | - | ||||||||||||||||||||||||||||||
| 3209 | - | |||||||||||||||||||||||||||||||
| 3210 | - | |||||||||||||||||||||||||||||||
| 3211 | cache->key = QPixmapCache::insert(cachedPixmap); | - | ||||||||||||||||||||||||||||||
| 3212 | - | |||||||||||||||||||||||||||||||
| 3213 | - | |||||||||||||||||||||||||||||||
| 3214 |     for (int i = 0; i < cache->exposed.size()
  | 0 | ||||||||||||||||||||||||||||||
| 3215 | QRectF &e = cache->exposed[i]; | - | ||||||||||||||||||||||||||||||
| 3216 |         if (!rect.isNull()
 
  | 0 | ||||||||||||||||||||||||||||||
| 3217 |             continue; never executed:  continue; | 0 | ||||||||||||||||||||||||||||||
| 3218 | e.translate(dx, dy); | - | ||||||||||||||||||||||||||||||
| 3219 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3220 | - | |||||||||||||||||||||||||||||||
| 3221 | - | |||||||||||||||||||||||||||||||
| 3222 | - | |||||||||||||||||||||||||||||||
| 3223 | exposed.translate(cache->boundingRect.topLeft()); | - | ||||||||||||||||||||||||||||||
| 3224 | const QVector<QRect> exposedRects = exposed.rects(); | - | ||||||||||||||||||||||||||||||
| 3225 |     for (int i = 0; i < exposedRects.size()
  | 0 | ||||||||||||||||||||||||||||||
| 3226 |         cache->exposed += exposedRects.at(i); never executed:  cache->exposed += exposedRects.at(i); | 0 | ||||||||||||||||||||||||||||||
| 3227 | - | |||||||||||||||||||||||||||||||
| 3228 | - | |||||||||||||||||||||||||||||||
| 3229 | - | |||||||||||||||||||||||||||||||
| 3230 | d->scene->d_func()->markDirty(this, rect); | - | ||||||||||||||||||||||||||||||
| 3231 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3232 | QPointF QGraphicsItem::mapToItem(const QGraphicsItem *item, const QPointF &point) const | - | ||||||||||||||||||||||||||||||
| 3233 | { | - | ||||||||||||||||||||||||||||||
| 3234 |     if (item
  | 0 | ||||||||||||||||||||||||||||||
| 3235 |         return never executed:   itemTransform(item).map(point);return itemTransform(item).map(point);never executed:  return itemTransform(item).map(point); | 0 | ||||||||||||||||||||||||||||||
| 3236 |     return never executed:   mapToScene(point);return mapToScene(point);never executed:  return mapToScene(point); | 0 | ||||||||||||||||||||||||||||||
| 3237 | } | - | ||||||||||||||||||||||||||||||
| 3238 | QPointF QGraphicsItem::mapToParent(const QPointF &point) const | - | ||||||||||||||||||||||||||||||
| 3239 | { | - | ||||||||||||||||||||||||||||||
| 3240 | - | |||||||||||||||||||||||||||||||
| 3241 |     if (!d_ptr->transformData
  | 0 | ||||||||||||||||||||||||||||||
| 3242 |         return never executed:   point + d_ptr->pos;return point + d_ptr->pos;never executed:  return point + d_ptr->pos; | 0 | ||||||||||||||||||||||||||||||
| 3243 |     return never executed:   d_ptr->transformToParent().map(point);return d_ptr->transformToParent().map(point);never executed:  return d_ptr->transformToParent().map(point); | 0 | ||||||||||||||||||||||||||||||
| 3244 | } | - | ||||||||||||||||||||||||||||||
| 3245 | QPointF QGraphicsItem::mapToScene(const QPointF &point) const | - | ||||||||||||||||||||||||||||||
| 3246 | { | - | ||||||||||||||||||||||||||||||
| 3247 |     if (d_ptr->hasTranslateOnlySceneTransform()
  | 0 | ||||||||||||||||||||||||||||||
| 3248 |         return never executed:   QPointF(point.x() + d_ptr->sceneTransform.dx(), point.y() + d_ptr->sceneTransform.dy());return 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 | ||||||||||||||||||||||||||||||
| 3249 |     return never executed:   d_ptr->sceneTransform.map(point);return d_ptr->sceneTransform.map(point);never executed:  return d_ptr->sceneTransform.map(point); | 0 | ||||||||||||||||||||||||||||||
| 3250 | } | - | ||||||||||||||||||||||||||||||
| 3251 | QPolygonF QGraphicsItem::mapToItem(const QGraphicsItem *item, const QRectF &rect) const | - | ||||||||||||||||||||||||||||||
| 3252 | { | - | ||||||||||||||||||||||||||||||
| 3253 |     if (item
  | 0 | ||||||||||||||||||||||||||||||
| 3254 |         return never executed:   itemTransform(item).map(rect);return itemTransform(item).map(rect);never executed:  return itemTransform(item).map(rect); | 0 | ||||||||||||||||||||||||||||||
| 3255 |     return never executed:   mapToScene(rect);return mapToScene(rect);never executed:  return mapToScene(rect); | 0 | ||||||||||||||||||||||||||||||
| 3256 | } | - | ||||||||||||||||||||||||||||||
| 3257 | QPolygonF QGraphicsItem::mapToParent(const QRectF &rect) const | - | ||||||||||||||||||||||||||||||
| 3258 | { | - | ||||||||||||||||||||||||||||||
| 3259 | - | |||||||||||||||||||||||||||||||
| 3260 |     if (!d_ptr->transformData
  | 0 | ||||||||||||||||||||||||||||||
| 3261 |         return never executed:   rect.translated(d_ptr->pos);return rect.translated(d_ptr->pos);never executed:  return rect.translated(d_ptr->pos); | 0 | ||||||||||||||||||||||||||||||
| 3262 |     return never executed:   d_ptr->transformToParent().map(rect);return d_ptr->transformToParent().map(rect);never executed:  return d_ptr->transformToParent().map(rect); | 0 | ||||||||||||||||||||||||||||||
| 3263 | } | - | ||||||||||||||||||||||||||||||
| 3264 | QPolygonF QGraphicsItem::mapToScene(const QRectF &rect) const | - | ||||||||||||||||||||||||||||||
| 3265 | { | - | ||||||||||||||||||||||||||||||
| 3266 |     if (d_ptr->hasTranslateOnlySceneTransform()
  | 0 | ||||||||||||||||||||||||||||||
| 3267 |         return never executed:   rect.translated(d_ptr->sceneTransform.dx(), d_ptr->sceneTransform.dy());return rect.translated(d_ptr->sceneTransform.dx(), d_ptr->sceneTransform.dy());never executed:  return rect.translated(d_ptr->sceneTransform.dx(), d_ptr->sceneTransform.dy()); | 0 | ||||||||||||||||||||||||||||||
| 3268 |     return never executed:   d_ptr->sceneTransform.map(rect);return d_ptr->sceneTransform.map(rect);never executed:  return d_ptr->sceneTransform.map(rect); | 0 | ||||||||||||||||||||||||||||||
| 3269 | } | - | ||||||||||||||||||||||||||||||
| 3270 | QRectF QGraphicsItem::mapRectToItem(const QGraphicsItem *item, const QRectF &rect) const | - | ||||||||||||||||||||||||||||||
| 3271 | { | - | ||||||||||||||||||||||||||||||
| 3272 |     if (item
  | 0 | ||||||||||||||||||||||||||||||
| 3273 |         return never executed:   itemTransform(item).mapRect(rect);return itemTransform(item).mapRect(rect);never executed:  return itemTransform(item).mapRect(rect); | 0 | ||||||||||||||||||||||||||||||
| 3274 |     return never executed:   mapRectToScene(rect);return mapRectToScene(rect);never executed:  return mapRectToScene(rect); | 0 | ||||||||||||||||||||||||||||||
| 3275 | } | - | ||||||||||||||||||||||||||||||
| 3276 | QRectF QGraphicsItem::mapRectToParent(const QRectF &rect) const | - | ||||||||||||||||||||||||||||||
| 3277 | { | - | ||||||||||||||||||||||||||||||
| 3278 | - | |||||||||||||||||||||||||||||||
| 3279 |     if (!d_ptr->transformData
  | 0 | ||||||||||||||||||||||||||||||
| 3280 |         return never executed:   rect.translated(d_ptr->pos);return rect.translated(d_ptr->pos);never executed:  return rect.translated(d_ptr->pos); | 0 | ||||||||||||||||||||||||||||||
| 3281 |     return never executed:   d_ptr->transformToParent().mapRect(rect);return d_ptr->transformToParent().mapRect(rect);never executed:  return d_ptr->transformToParent().mapRect(rect); | 0 | ||||||||||||||||||||||||||||||
| 3282 | } | - | ||||||||||||||||||||||||||||||
| 3283 | QRectF QGraphicsItem::mapRectToScene(const QRectF &rect) const | - | ||||||||||||||||||||||||||||||
| 3284 | { | - | ||||||||||||||||||||||||||||||
| 3285 |     if (d_ptr->hasTranslateOnlySceneTransform()
  | 0 | ||||||||||||||||||||||||||||||
| 3286 |         return never executed:   rect.translated(d_ptr->sceneTransform.dx(), d_ptr->sceneTransform.dy());return rect.translated(d_ptr->sceneTransform.dx(), d_ptr->sceneTransform.dy());never executed:  return rect.translated(d_ptr->sceneTransform.dx(), d_ptr->sceneTransform.dy()); | 0 | ||||||||||||||||||||||||||||||
| 3287 |     return never executed:   d_ptr->sceneTransform.mapRect(rect);return d_ptr->sceneTransform.mapRect(rect);never executed:  return d_ptr->sceneTransform.mapRect(rect); | 0 | ||||||||||||||||||||||||||||||
| 3288 | } | - | ||||||||||||||||||||||||||||||
| 3289 | QRectF QGraphicsItem::mapRectFromItem(const QGraphicsItem *item, const QRectF &rect) const | - | ||||||||||||||||||||||||||||||
| 3290 | { | - | ||||||||||||||||||||||||||||||
| 3291 |     if (item
  | 0 | ||||||||||||||||||||||||||||||
| 3292 |         return never executed:   item->itemTransform(this).mapRect(rect);return item->itemTransform(this).mapRect(rect);never executed:  return item->itemTransform(this).mapRect(rect); | 0 | ||||||||||||||||||||||||||||||
| 3293 |     return never executed:   mapRectFromScene(rect);return mapRectFromScene(rect);never executed:  return mapRectFromScene(rect); | 0 | ||||||||||||||||||||||||||||||
| 3294 | } | - | ||||||||||||||||||||||||||||||
| 3295 | QRectF QGraphicsItem::mapRectFromParent(const QRectF &rect) const | - | ||||||||||||||||||||||||||||||
| 3296 | { | - | ||||||||||||||||||||||||||||||
| 3297 | - | |||||||||||||||||||||||||||||||
| 3298 |     if (!d_ptr->transformData
  | 0 | ||||||||||||||||||||||||||||||
| 3299 |         return never executed:   rect.translated(-d_ptr->pos);return rect.translated(-d_ptr->pos);never executed:  return rect.translated(-d_ptr->pos); | 0 | ||||||||||||||||||||||||||||||
| 3300 |     return never executed:   d_ptr->transformToParent().inverted().mapRect(rect);return d_ptr->transformToParent().inverted().mapRect(rect);never executed:  return d_ptr->transformToParent().inverted().mapRect(rect); | 0 | ||||||||||||||||||||||||||||||
| 3301 | } | - | ||||||||||||||||||||||||||||||
| 3302 | QRectF QGraphicsItem::mapRectFromScene(const QRectF &rect) const | - | ||||||||||||||||||||||||||||||
| 3303 | { | - | ||||||||||||||||||||||||||||||
| 3304 |     if (d_ptr->hasTranslateOnlySceneTransform()
  | 0 | ||||||||||||||||||||||||||||||
| 3305 |         return never executed:   rect.translated(-d_ptr->sceneTransform.dx(), -d_ptr->sceneTransform.dy());return rect.translated(-d_ptr->sceneTransform.dx(), -d_ptr->sceneTransform.dy());never executed:  return rect.translated(-d_ptr->sceneTransform.dx(), -d_ptr->sceneTransform.dy()); | 0 | ||||||||||||||||||||||||||||||
| 3306 |     return never executed:   d_ptr->sceneTransform.inverted().mapRect(rect);return d_ptr->sceneTransform.inverted().mapRect(rect);never executed:  return d_ptr->sceneTransform.inverted().mapRect(rect); | 0 | ||||||||||||||||||||||||||||||
| 3307 | } | - | ||||||||||||||||||||||||||||||
| 3308 | QPolygonF QGraphicsItem::mapToItem(const QGraphicsItem *item, const QPolygonF &polygon) const | - | ||||||||||||||||||||||||||||||
| 3309 | { | - | ||||||||||||||||||||||||||||||
| 3310 |     if (item
  | 0 | ||||||||||||||||||||||||||||||
| 3311 |         return never executed:   itemTransform(item).map(polygon);return itemTransform(item).map(polygon);never executed:  return itemTransform(item).map(polygon); | 0 | ||||||||||||||||||||||||||||||
| 3312 |     return never executed:   mapToScene(polygon);return mapToScene(polygon);never executed:  return mapToScene(polygon); | 0 | ||||||||||||||||||||||||||||||
| 3313 | } | - | ||||||||||||||||||||||||||||||
| 3314 | QPolygonF QGraphicsItem::mapToParent(const QPolygonF &polygon) const | - | ||||||||||||||||||||||||||||||
| 3315 | { | - | ||||||||||||||||||||||||||||||
| 3316 | - | |||||||||||||||||||||||||||||||
| 3317 |     if (!d_ptr->transformData
  | 0 | ||||||||||||||||||||||||||||||
| 3318 |         return never executed:   polygon.translated(d_ptr->pos);return polygon.translated(d_ptr->pos);never executed:  return polygon.translated(d_ptr->pos); | 0 | ||||||||||||||||||||||||||||||
| 3319 |     return never executed:   d_ptr->transformToParent().map(polygon);return d_ptr->transformToParent().map(polygon);never executed:  return d_ptr->transformToParent().map(polygon); | 0 | ||||||||||||||||||||||||||||||
| 3320 | } | - | ||||||||||||||||||||||||||||||
| 3321 | QPolygonF QGraphicsItem::mapToScene(const QPolygonF &polygon) const | - | ||||||||||||||||||||||||||||||
| 3322 | { | - | ||||||||||||||||||||||||||||||
| 3323 |     if (d_ptr->hasTranslateOnlySceneTransform()
  | 0 | ||||||||||||||||||||||||||||||
| 3324 |         return never executed:   polygon.translated(d_ptr->sceneTransform.dx(), d_ptr->sceneTransform.dy());return polygon.translated(d_ptr->sceneTransform.dx(), d_ptr->sceneTransform.dy());never executed:  return polygon.translated(d_ptr->sceneTransform.dx(), d_ptr->sceneTransform.dy()); | 0 | ||||||||||||||||||||||||||||||
| 3325 |     return never executed:   d_ptr->sceneTransform.map(polygon);return d_ptr->sceneTransform.map(polygon);never executed:  return d_ptr->sceneTransform.map(polygon); | 0 | ||||||||||||||||||||||||||||||
| 3326 | } | - | ||||||||||||||||||||||||||||||
| 3327 | QPainterPath QGraphicsItem::mapToItem(const QGraphicsItem *item, const QPainterPath &path) const | - | ||||||||||||||||||||||||||||||
| 3328 | { | - | ||||||||||||||||||||||||||||||
| 3329 |     if (item
  | 0 | ||||||||||||||||||||||||||||||
| 3330 |         return never executed:   itemTransform(item).map(path);return itemTransform(item).map(path);never executed:  return itemTransform(item).map(path); | 0 | ||||||||||||||||||||||||||||||
| 3331 |     return never executed:   mapToScene(path);return mapToScene(path);never executed:  return mapToScene(path); | 0 | ||||||||||||||||||||||||||||||
| 3332 | } | - | ||||||||||||||||||||||||||||||
| 3333 | QPainterPath QGraphicsItem::mapToParent(const QPainterPath &path) const | - | ||||||||||||||||||||||||||||||
| 3334 | { | - | ||||||||||||||||||||||||||||||
| 3335 | - | |||||||||||||||||||||||||||||||
| 3336 |     if (!d_ptr->transformData
  | 0 | ||||||||||||||||||||||||||||||
| 3337 |         return never executed:   path.translated(d_ptr->pos);return path.translated(d_ptr->pos);never executed:  return path.translated(d_ptr->pos); | 0 | ||||||||||||||||||||||||||||||
| 3338 |     return never executed:   d_ptr->transformToParent().map(path);return d_ptr->transformToParent().map(path);never executed:  return d_ptr->transformToParent().map(path); | 0 | ||||||||||||||||||||||||||||||
| 3339 | } | - | ||||||||||||||||||||||||||||||
| 3340 | QPainterPath QGraphicsItem::mapToScene(const QPainterPath &path) const | - | ||||||||||||||||||||||||||||||
| 3341 | { | - | ||||||||||||||||||||||||||||||
| 3342 |     if (d_ptr->hasTranslateOnlySceneTransform()
  | 0 | ||||||||||||||||||||||||||||||
| 3343 |         return never executed:   path.translated(d_ptr->sceneTransform.dx(), d_ptr->sceneTransform.dy());return path.translated(d_ptr->sceneTransform.dx(), d_ptr->sceneTransform.dy());never executed:  return path.translated(d_ptr->sceneTransform.dx(), d_ptr->sceneTransform.dy()); | 0 | ||||||||||||||||||||||||||||||
| 3344 |     return never executed:   d_ptr->sceneTransform.map(path);return d_ptr->sceneTransform.map(path);never executed:  return d_ptr->sceneTransform.map(path); | 0 | ||||||||||||||||||||||||||||||
| 3345 | } | - | ||||||||||||||||||||||||||||||
| 3346 | QPointF QGraphicsItem::mapFromItem(const QGraphicsItem *item, const QPointF &point) const | - | ||||||||||||||||||||||||||||||
| 3347 | { | - | ||||||||||||||||||||||||||||||
| 3348 |     if (item
  | 0 | ||||||||||||||||||||||||||||||
| 3349 |         return never executed:   item->itemTransform(this).map(point);return item->itemTransform(this).map(point);never executed:  return item->itemTransform(this).map(point); | 0 | ||||||||||||||||||||||||||||||
| 3350 |     return never executed:   mapFromScene(point);return mapFromScene(point);never executed:  return mapFromScene(point); | 0 | ||||||||||||||||||||||||||||||
| 3351 | } | - | ||||||||||||||||||||||||||||||
| 3352 | QPointF QGraphicsItem::mapFromParent(const QPointF &point) const | - | ||||||||||||||||||||||||||||||
| 3353 | { | - | ||||||||||||||||||||||||||||||
| 3354 | - | |||||||||||||||||||||||||||||||
| 3355 |     if (d_ptr->transformData
  | 0 | ||||||||||||||||||||||||||||||
| 3356 |         return never executed:   d_ptr->transformToParent().inverted().map(point);return d_ptr->transformToParent().inverted().map(point);never executed:  return d_ptr->transformToParent().inverted().map(point); | 0 | ||||||||||||||||||||||||||||||
| 3357 |     return never executed:   point - d_ptr->pos;return point - d_ptr->pos;never executed:  return point - d_ptr->pos; | 0 | ||||||||||||||||||||||||||||||
| 3358 | } | - | ||||||||||||||||||||||||||||||
| 3359 | QPointF QGraphicsItem::mapFromScene(const QPointF &point) const | - | ||||||||||||||||||||||||||||||
| 3360 | { | - | ||||||||||||||||||||||||||||||
| 3361 |     if (d_ptr->hasTranslateOnlySceneTransform()
  | 0 | ||||||||||||||||||||||||||||||
| 3362 |         return never executed:   QPointF(point.x() - d_ptr->sceneTransform.dx(), point.y() - d_ptr->sceneTransform.dy());return 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 | ||||||||||||||||||||||||||||||
| 3363 |     return never executed:   d_ptr->sceneTransform.inverted().map(point);return d_ptr->sceneTransform.inverted().map(point);never executed:  return d_ptr->sceneTransform.inverted().map(point); | 0 | ||||||||||||||||||||||||||||||
| 3364 | } | - | ||||||||||||||||||||||||||||||
| 3365 | QPolygonF QGraphicsItem::mapFromItem(const QGraphicsItem *item, const QRectF &rect) const | - | ||||||||||||||||||||||||||||||
| 3366 | { | - | ||||||||||||||||||||||||||||||
| 3367 |     if (item
  | 0 | ||||||||||||||||||||||||||||||
| 3368 |         return never executed:   item->itemTransform(this).map(rect);return item->itemTransform(this).map(rect);never executed:  return item->itemTransform(this).map(rect); | 0 | ||||||||||||||||||||||||||||||
| 3369 |     return never executed:   mapFromScene(rect);return mapFromScene(rect);never executed:  return mapFromScene(rect); | 0 | ||||||||||||||||||||||||||||||
| 3370 | } | - | ||||||||||||||||||||||||||||||
| 3371 | QPolygonF QGraphicsItem::mapFromParent(const QRectF &rect) const | - | ||||||||||||||||||||||||||||||
| 3372 | { | - | ||||||||||||||||||||||||||||||
| 3373 | - | |||||||||||||||||||||||||||||||
| 3374 |     if (!d_ptr->transformData
  | 0 | ||||||||||||||||||||||||||||||
| 3375 |         return never executed:   rect.translated(-d_ptr->pos);return rect.translated(-d_ptr->pos);never executed:  return rect.translated(-d_ptr->pos); | 0 | ||||||||||||||||||||||||||||||
| 3376 |     return never executed:   d_ptr->transformToParent().inverted().map(rect);return d_ptr->transformToParent().inverted().map(rect);never executed:  return d_ptr->transformToParent().inverted().map(rect); | 0 | ||||||||||||||||||||||||||||||
| 3377 | } | - | ||||||||||||||||||||||||||||||
| 3378 | QPolygonF QGraphicsItem::mapFromScene(const QRectF &rect) const | - | ||||||||||||||||||||||||||||||
| 3379 | { | - | ||||||||||||||||||||||||||||||
| 3380 |     if (d_ptr->hasTranslateOnlySceneTransform()
  | 0 | ||||||||||||||||||||||||||||||
| 3381 |         return never executed:   rect.translated(-d_ptr->sceneTransform.dx(), -d_ptr->sceneTransform.dy());return rect.translated(-d_ptr->sceneTransform.dx(), -d_ptr->sceneTransform.dy());never executed:  return rect.translated(-d_ptr->sceneTransform.dx(), -d_ptr->sceneTransform.dy()); | 0 | ||||||||||||||||||||||||||||||
| 3382 |     return never executed:   d_ptr->sceneTransform.inverted().map(rect);return d_ptr->sceneTransform.inverted().map(rect);never executed:  return d_ptr->sceneTransform.inverted().map(rect); | 0 | ||||||||||||||||||||||||||||||
| 3383 | } | - | ||||||||||||||||||||||||||||||
| 3384 | QPolygonF QGraphicsItem::mapFromItem(const QGraphicsItem *item, const QPolygonF &polygon) const | - | ||||||||||||||||||||||||||||||
| 3385 | { | - | ||||||||||||||||||||||||||||||
| 3386 |     if (item
  | 0 | ||||||||||||||||||||||||||||||
| 3387 |         return never executed:   item->itemTransform(this).map(polygon);return item->itemTransform(this).map(polygon);never executed:  return item->itemTransform(this).map(polygon); | 0 | ||||||||||||||||||||||||||||||
| 3388 |     return never executed:   mapFromScene(polygon);return mapFromScene(polygon);never executed:  return mapFromScene(polygon); | 0 | ||||||||||||||||||||||||||||||
| 3389 | } | - | ||||||||||||||||||||||||||||||
| 3390 | QPolygonF QGraphicsItem::mapFromParent(const QPolygonF &polygon) const | - | ||||||||||||||||||||||||||||||
| 3391 | { | - | ||||||||||||||||||||||||||||||
| 3392 | - | |||||||||||||||||||||||||||||||
| 3393 |     if (!d_ptr->transformData
  | 0 | ||||||||||||||||||||||||||||||
| 3394 |         return never executed:   polygon.translated(-d_ptr->pos);return polygon.translated(-d_ptr->pos);never executed:  return polygon.translated(-d_ptr->pos); | 0 | ||||||||||||||||||||||||||||||
| 3395 |     return never executed:   d_ptr->transformToParent().inverted().map(polygon);return d_ptr->transformToParent().inverted().map(polygon);never executed:  return d_ptr->transformToParent().inverted().map(polygon); | 0 | ||||||||||||||||||||||||||||||
| 3396 | } | - | ||||||||||||||||||||||||||||||
| 3397 | QPolygonF QGraphicsItem::mapFromScene(const QPolygonF &polygon) const | - | ||||||||||||||||||||||||||||||
| 3398 | { | - | ||||||||||||||||||||||||||||||
| 3399 |     if (d_ptr->hasTranslateOnlySceneTransform()
  | 0 | ||||||||||||||||||||||||||||||
| 3400 |         return never executed:   polygon.translated(-d_ptr->sceneTransform.dx(), -d_ptr->sceneTransform.dy());return polygon.translated(-d_ptr->sceneTransform.dx(), -d_ptr->sceneTransform.dy());never executed:  return polygon.translated(-d_ptr->sceneTransform.dx(), -d_ptr->sceneTransform.dy()); | 0 | ||||||||||||||||||||||||||||||
| 3401 |     return never executed:   d_ptr->sceneTransform.inverted().map(polygon);return d_ptr->sceneTransform.inverted().map(polygon);never executed:  return d_ptr->sceneTransform.inverted().map(polygon); | 0 | ||||||||||||||||||||||||||||||
| 3402 | } | - | ||||||||||||||||||||||||||||||
| 3403 | QPainterPath QGraphicsItem::mapFromItem(const QGraphicsItem *item, const QPainterPath &path) const | - | ||||||||||||||||||||||||||||||
| 3404 | { | - | ||||||||||||||||||||||||||||||
| 3405 |     if (item
  | 0 | ||||||||||||||||||||||||||||||
| 3406 |         return never executed:   item->itemTransform(this).map(path);return item->itemTransform(this).map(path);never executed:  return item->itemTransform(this).map(path); | 0 | ||||||||||||||||||||||||||||||
| 3407 |     return never executed:   mapFromScene(path);return mapFromScene(path);never executed:  return mapFromScene(path); | 0 | ||||||||||||||||||||||||||||||
| 3408 | } | - | ||||||||||||||||||||||||||||||
| 3409 | QPainterPath QGraphicsItem::mapFromParent(const QPainterPath &path) const | - | ||||||||||||||||||||||||||||||
| 3410 | { | - | ||||||||||||||||||||||||||||||
| 3411 | - | |||||||||||||||||||||||||||||||
| 3412 |     if (!d_ptr->transformData
  | 0 | ||||||||||||||||||||||||||||||
| 3413 |             return never executed:   path.translated(-d_ptr->pos);return path.translated(-d_ptr->pos);never executed:  return path.translated(-d_ptr->pos); | 0 | ||||||||||||||||||||||||||||||
| 3414 |     return never executed:   d_ptr->transformToParent().inverted().map(path);return d_ptr->transformToParent().inverted().map(path);never executed:  return d_ptr->transformToParent().inverted().map(path); | 0 | ||||||||||||||||||||||||||||||
| 3415 | } | - | ||||||||||||||||||||||||||||||
| 3416 | QPainterPath QGraphicsItem::mapFromScene(const QPainterPath &path) const | - | ||||||||||||||||||||||||||||||
| 3417 | { | - | ||||||||||||||||||||||||||||||
| 3418 |     if (d_ptr->hasTranslateOnlySceneTransform()
  | 0 | ||||||||||||||||||||||||||||||
| 3419 |         return never executed:   path.translated(-d_ptr->sceneTransform.dx(), -d_ptr->sceneTransform.dy());return path.translated(-d_ptr->sceneTransform.dx(), -d_ptr->sceneTransform.dy());never executed:  return path.translated(-d_ptr->sceneTransform.dx(), -d_ptr->sceneTransform.dy()); | 0 | ||||||||||||||||||||||||||||||
| 3420 |     return never executed:   d_ptr->sceneTransform.inverted().map(path);return d_ptr->sceneTransform.inverted().map(path);never executed:  return d_ptr->sceneTransform.inverted().map(path); | 0 | ||||||||||||||||||||||||||||||
| 3421 | } | - | ||||||||||||||||||||||||||||||
| 3422 | - | |||||||||||||||||||||||||||||||
| 3423 | - | |||||||||||||||||||||||||||||||
| 3424 | - | |||||||||||||||||||||||||||||||
| 3425 | - | |||||||||||||||||||||||||||||||
| 3426 | - | |||||||||||||||||||||||||||||||
| 3427 | - | |||||||||||||||||||||||||||||||
| 3428 | - | |||||||||||||||||||||||||||||||
| 3429 | bool QGraphicsItem::isAncestorOf(const QGraphicsItem *child) const | - | ||||||||||||||||||||||||||||||
| 3430 | { | - | ||||||||||||||||||||||||||||||
| 3431 |     if (!child
 
  | 0 | ||||||||||||||||||||||||||||||
| 3432 |         return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||
| 3433 |     if (child->d_ptr->depth() < d_ptr->depth()
  | 0 | ||||||||||||||||||||||||||||||
| 3434 |         return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||
| 3435 | const QGraphicsItem *ancestor = child; | - | ||||||||||||||||||||||||||||||
| 3436 |     while ((
 
  | 0 | ||||||||||||||||||||||||||||||
| 3437 |         if (ancestor == this
  | 0 | ||||||||||||||||||||||||||||||
| 3438 |             return never executed:   true;return true;never executed:  return true; | 0 | ||||||||||||||||||||||||||||||
| 3439 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3440 |     return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||
| 3441 | } | - | ||||||||||||||||||||||||||||||
| 3442 | QGraphicsItem *QGraphicsItem::commonAncestorItem(const QGraphicsItem *other) const | - | ||||||||||||||||||||||||||||||
| 3443 | { | - | ||||||||||||||||||||||||||||||
| 3444 |     if (!other
  | 0 | ||||||||||||||||||||||||||||||
| 3445 |         return never executed:   0;return 0;never executed:  return 0; | 0 | ||||||||||||||||||||||||||||||
| 3446 |     if (other == this
  | 0 | ||||||||||||||||||||||||||||||
| 3447 |         return never executed:   const_cast<QGraphicsItem *>(this);return const_cast<QGraphicsItem *>(this);never executed:  return const_cast<QGraphicsItem *>(this); | 0 | ||||||||||||||||||||||||||||||
| 3448 | const QGraphicsItem *thisw = this; | - | ||||||||||||||||||||||||||||||
| 3449 | const QGraphicsItem *otherw = other; | - | ||||||||||||||||||||||||||||||
| 3450 | int thisDepth = d_ptr->depth(); | - | ||||||||||||||||||||||||||||||
| 3451 | int otherDepth = other->d_ptr->depth(); | - | ||||||||||||||||||||||||||||||
| 3452 |     while (thisDepth > otherDepth
  | 0 | ||||||||||||||||||||||||||||||
| 3453 | thisw = thisw->d_ptr->parent; | - | ||||||||||||||||||||||||||||||
| 3454 | --thisDepth; | - | ||||||||||||||||||||||||||||||
| 3455 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3456 |     while (otherDepth > thisDepth
  | 0 | ||||||||||||||||||||||||||||||
| 3457 | otherw = otherw->d_ptr->parent; | - | ||||||||||||||||||||||||||||||
| 3458 | --otherDepth; | - | ||||||||||||||||||||||||||||||
| 3459 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3460 |     while (thisw
 
  | 0 | ||||||||||||||||||||||||||||||
| 3461 | thisw = thisw->d_ptr->parent; | - | ||||||||||||||||||||||||||||||
| 3462 | otherw = otherw->d_ptr->parent; | - | ||||||||||||||||||||||||||||||
| 3463 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3464 |     return never executed:   const_cast<QGraphicsItem *>(thisw);return const_cast<QGraphicsItem *>(thisw);never executed:  return const_cast<QGraphicsItem *>(thisw); | 0 | ||||||||||||||||||||||||||||||
| 3465 | } | - | ||||||||||||||||||||||||||||||
| 3466 | bool QGraphicsItem::isUnderMouse() const | - | ||||||||||||||||||||||||||||||
| 3467 | { | - | ||||||||||||||||||||||||||||||
| 3468 | const QGraphicsItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 3469 |     if (!d->scene
  | 0 | ||||||||||||||||||||||||||||||
| 3470 |         return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||
| 3471 | - | |||||||||||||||||||||||||||||||
| 3472 | QPoint cursorPos = QCursor::pos(); | - | ||||||||||||||||||||||||||||||
| 3473 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(d->scene->views())>::type> _container_((d->scene->views())); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QGraphicsView *view = *_container_.i; _container_.control; _container_.control = 0) { | - | ||||||||||||||||||||||||||||||
| 3474 |         if (contains(mapFromScene(view->mapToScene(view->mapFromGlobal(cursorPos))))
  | 0 | ||||||||||||||||||||||||||||||
| 3475 |             return never executed:   true;return true;never executed:  return true; | 0 | ||||||||||||||||||||||||||||||
| 3476 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3477 |     return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||
| 3478 | } | - | ||||||||||||||||||||||||||||||
| 3479 | QVariant QGraphicsItem::data(int key) const | - | ||||||||||||||||||||||||||||||
| 3480 | { | - | ||||||||||||||||||||||||||||||
| 3481 | QGraphicsItemCustomDataStore *store = qt_dataStore(); | - | ||||||||||||||||||||||||||||||
| 3482 |     if (!store->data.contains(this)
  | 0 | ||||||||||||||||||||||||||||||
| 3483 |         return never executed:   QVariant();return QVariant();never executed:  return QVariant(); | 0 | ||||||||||||||||||||||||||||||
| 3484 |     return never executed:   store->data.value(this).value(key);return store->data.value(this).value(key);never executed:  return store->data.value(this).value(key); | 0 | ||||||||||||||||||||||||||||||
| 3485 | } | - | ||||||||||||||||||||||||||||||
| 3486 | void QGraphicsItem::setData(int key, const QVariant &value) | - | ||||||||||||||||||||||||||||||
| 3487 | { | - | ||||||||||||||||||||||||||||||
| 3488 | qt_dataStore()->data[this][key] = value; | - | ||||||||||||||||||||||||||||||
| 3489 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3490 | int QGraphicsItem::type() const | - | ||||||||||||||||||||||||||||||
| 3491 | { | - | ||||||||||||||||||||||||||||||
| 3492 |     return never executed:   (int)UserType;return (int)UserType;never executed:  return (int)UserType; | 0 | ||||||||||||||||||||||||||||||
| 3493 | } | - | ||||||||||||||||||||||||||||||
| 3494 | void QGraphicsItem::installSceneEventFilter(QGraphicsItem *filterItem) | - | ||||||||||||||||||||||||||||||
| 3495 | { | - | ||||||||||||||||||||||||||||||
| 3496 |     if (!d_ptr->scene
  | 0 | ||||||||||||||||||||||||||||||
| 3497 | QMessageLogger(__FILE__, 6627, __PRETTY_FUNCTION__).warning("QGraphicsItem::installSceneEventFilter: event filters can only be installed" | - | ||||||||||||||||||||||||||||||
| 3498 | " on items in a scene."); | - | ||||||||||||||||||||||||||||||
| 3499 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 3500 | } | - | ||||||||||||||||||||||||||||||
| 3501 |     if (d_ptr->scene != filterItem->scene()
  | 0 | ||||||||||||||||||||||||||||||
| 3502 | QMessageLogger(__FILE__, 6632, __PRETTY_FUNCTION__).warning("QGraphicsItem::installSceneEventFilter: event filters can only be installed" | - | ||||||||||||||||||||||||||||||
| 3503 | " on items in the same scene."); | - | ||||||||||||||||||||||||||||||
| 3504 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 3505 | } | - | ||||||||||||||||||||||||||||||
| 3506 | d_ptr->scene->d_func()->installSceneEventFilter(this, filterItem); | - | ||||||||||||||||||||||||||||||
| 3507 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3508 | - | |||||||||||||||||||||||||||||||
| 3509 | - | |||||||||||||||||||||||||||||||
| 3510 | - | |||||||||||||||||||||||||||||||
| 3511 | - | |||||||||||||||||||||||||||||||
| 3512 | - | |||||||||||||||||||||||||||||||
| 3513 | - | |||||||||||||||||||||||||||||||
| 3514 | void QGraphicsItem::removeSceneEventFilter(QGraphicsItem *filterItem) | - | ||||||||||||||||||||||||||||||
| 3515 | { | - | ||||||||||||||||||||||||||||||
| 3516 |     if (!d_ptr->scene
 
  | 0 | ||||||||||||||||||||||||||||||
| 3517 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 3518 | d_ptr->scene->d_func()->removeSceneEventFilter(this, filterItem); | - | ||||||||||||||||||||||||||||||
| 3519 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3520 | bool QGraphicsItem::sceneEventFilter(QGraphicsItem *watched, QEvent *event) | - | ||||||||||||||||||||||||||||||
| 3521 | { | - | ||||||||||||||||||||||||||||||
| 3522 | (void)watched;; | - | ||||||||||||||||||||||||||||||
| 3523 | (void)event;; | - | ||||||||||||||||||||||||||||||
| 3524 |     return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||
| 3525 | } | - | ||||||||||||||||||||||||||||||
| 3526 | bool QGraphicsItem::sceneEvent(QEvent *event) | - | ||||||||||||||||||||||||||||||
| 3527 | { | - | ||||||||||||||||||||||||||||||
| 3528 |     if (d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorHandlesChildEvents
  | 0 | ||||||||||||||||||||||||||||||
| 3529 |         if (event->type() == QEvent::HoverEnter
 
  | 0 | ||||||||||||||||||||||||||||||
| 3530 |             || event->type() == QEvent::DragEnter
 
  | 0 | ||||||||||||||||||||||||||||||
| 3531 | - | |||||||||||||||||||||||||||||||
| 3532 | - | |||||||||||||||||||||||||||||||
| 3533 |             return never executed:   true;return true;never executed:  return true; | 0 | ||||||||||||||||||||||||||||||
| 3534 | } | - | ||||||||||||||||||||||||||||||
| 3535 | - | |||||||||||||||||||||||||||||||
| 3536 | QGraphicsItem *handler = this; | - | ||||||||||||||||||||||||||||||
| 3537 | do { | - | ||||||||||||||||||||||||||||||
| 3538 | handler = handler->d_ptr->parent; | - | ||||||||||||||||||||||||||||||
| 3539 | ((!(handler)) ? qt_assert("handler",__FILE__,6701) : qt_noop()); | - | ||||||||||||||||||||||||||||||
| 3540 |         } never executed:   while (handler->d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorHandlesChildEventsend of block
  | 0 | ||||||||||||||||||||||||||||||
| 3541 | - | |||||||||||||||||||||||||||||||
| 3542 | - | |||||||||||||||||||||||||||||||
| 3543 | - | |||||||||||||||||||||||||||||||
| 3544 | d_ptr->remapItemPos(event, handler); | - | ||||||||||||||||||||||||||||||
| 3545 | handler->sceneEvent(event); | - | ||||||||||||||||||||||||||||||
| 3546 |         return never executed:   true;return true;never executed:  return true; | 0 | ||||||||||||||||||||||||||||||
| 3547 | } | - | ||||||||||||||||||||||||||||||
| 3548 | - | |||||||||||||||||||||||||||||||
| 3549 |     if (event->type() == QEvent::FocusOut
  | 0 | ||||||||||||||||||||||||||||||
| 3550 | focusOutEvent(static_cast<QFocusEvent *>(event)); | - | ||||||||||||||||||||||||||||||
| 3551 |         return never executed:   true;return true;never executed:  return true; | 0 | ||||||||||||||||||||||||||||||
| 3552 | } | - | ||||||||||||||||||||||||||||||
| 3553 | - | |||||||||||||||||||||||||||||||
| 3554 |     if (!d_ptr->visible
  | 0 | ||||||||||||||||||||||||||||||
| 3555 | - | |||||||||||||||||||||||||||||||
| 3556 |         return never executed:   true;return true;never executed:  return true; | 0 | ||||||||||||||||||||||||||||||
| 3557 | } | - | ||||||||||||||||||||||||||||||
| 3558 | - | |||||||||||||||||||||||||||||||
| 3559 | switch (event->type()) { | - | ||||||||||||||||||||||||||||||
| 3560 |     case never executed:   QEvent::FocusIn:case QEvent::FocusIn:never executed:  case QEvent::FocusIn: | 0 | ||||||||||||||||||||||||||||||
| 3561 | focusInEvent(static_cast<QFocusEvent *>(event)); | - | ||||||||||||||||||||||||||||||
| 3562 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 3563 |     case never executed:   QEvent::GraphicsSceneContextMenu:case QEvent::GraphicsSceneContextMenu:never executed:  case QEvent::GraphicsSceneContextMenu: | 0 | ||||||||||||||||||||||||||||||
| 3564 | contextMenuEvent(static_cast<QGraphicsSceneContextMenuEvent *>(event)); | - | ||||||||||||||||||||||||||||||
| 3565 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 3566 |     case never executed:   QEvent::GraphicsSceneDragEnter:case QEvent::GraphicsSceneDragEnter:never executed:  case QEvent::GraphicsSceneDragEnter: | 0 | ||||||||||||||||||||||||||||||
| 3567 | dragEnterEvent(static_cast<QGraphicsSceneDragDropEvent *>(event)); | - | ||||||||||||||||||||||||||||||
| 3568 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 3569 |     case never executed:   QEvent::GraphicsSceneDragMove:case QEvent::GraphicsSceneDragMove:never executed:  case QEvent::GraphicsSceneDragMove: | 0 | ||||||||||||||||||||||||||||||
| 3570 | dragMoveEvent(static_cast<QGraphicsSceneDragDropEvent *>(event)); | - | ||||||||||||||||||||||||||||||
| 3571 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 3572 |     case never executed:   QEvent::GraphicsSceneDragLeave:case QEvent::GraphicsSceneDragLeave:never executed:  case QEvent::GraphicsSceneDragLeave: | 0 | ||||||||||||||||||||||||||||||
| 3573 | dragLeaveEvent(static_cast<QGraphicsSceneDragDropEvent *>(event)); | - | ||||||||||||||||||||||||||||||
| 3574 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 3575 |     case never executed:   QEvent::GraphicsSceneDrop:case QEvent::GraphicsSceneDrop:never executed:  case QEvent::GraphicsSceneDrop: | 0 | ||||||||||||||||||||||||||||||
| 3576 | dropEvent(static_cast<QGraphicsSceneDragDropEvent *>(event)); | - | ||||||||||||||||||||||||||||||
| 3577 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 3578 |     case never executed:   QEvent::GraphicsSceneHoverEnter:case QEvent::GraphicsSceneHoverEnter:never executed:  case QEvent::GraphicsSceneHoverEnter: | 0 | ||||||||||||||||||||||||||||||
| 3579 | hoverEnterEvent(static_cast<QGraphicsSceneHoverEvent *>(event)); | - | ||||||||||||||||||||||||||||||
| 3580 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 3581 |     case never executed:   QEvent::GraphicsSceneHoverMove:case QEvent::GraphicsSceneHoverMove:never executed:  case QEvent::GraphicsSceneHoverMove: | 0 | ||||||||||||||||||||||||||||||
| 3582 | hoverMoveEvent(static_cast<QGraphicsSceneHoverEvent *>(event)); | - | ||||||||||||||||||||||||||||||
| 3583 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 3584 |     case never executed:   QEvent::GraphicsSceneHoverLeave:case QEvent::GraphicsSceneHoverLeave:never executed:  case QEvent::GraphicsSceneHoverLeave: | 0 | ||||||||||||||||||||||||||||||
| 3585 | hoverLeaveEvent(static_cast<QGraphicsSceneHoverEvent *>(event)); | - | ||||||||||||||||||||||||||||||
| 3586 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 3587 |     case never executed:   QEvent::GraphicsSceneMouseMove:case QEvent::GraphicsSceneMouseMove:never executed:  case QEvent::GraphicsSceneMouseMove: | 0 | ||||||||||||||||||||||||||||||
| 3588 | mouseMoveEvent(static_cast<QGraphicsSceneMouseEvent *>(event)); | - | ||||||||||||||||||||||||||||||
| 3589 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 3590 |     case never executed:   QEvent::GraphicsSceneMousePress:case QEvent::GraphicsSceneMousePress:never executed:  case QEvent::GraphicsSceneMousePress: | 0 | ||||||||||||||||||||||||||||||
| 3591 | mousePressEvent(static_cast<QGraphicsSceneMouseEvent *>(event)); | - | ||||||||||||||||||||||||||||||
| 3592 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 3593 |     case never executed:   QEvent::GraphicsSceneMouseRelease:case QEvent::GraphicsSceneMouseRelease:never executed:  case QEvent::GraphicsSceneMouseRelease: | 0 | ||||||||||||||||||||||||||||||
| 3594 | mouseReleaseEvent(static_cast<QGraphicsSceneMouseEvent *>(event)); | - | ||||||||||||||||||||||||||||||
| 3595 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 3596 |     case never executed:   QEvent::GraphicsSceneMouseDoubleClick:case QEvent::GraphicsSceneMouseDoubleClick:never executed:  case QEvent::GraphicsSceneMouseDoubleClick: | 0 | ||||||||||||||||||||||||||||||
| 3597 | mouseDoubleClickEvent(static_cast<QGraphicsSceneMouseEvent *>(event)); | - | ||||||||||||||||||||||||||||||
| 3598 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 3599 |     case never executed:   QEvent::GraphicsSceneWheel:case QEvent::GraphicsSceneWheel:never executed:  case QEvent::GraphicsSceneWheel: | 0 | ||||||||||||||||||||||||||||||
| 3600 | wheelEvent(static_cast<QGraphicsSceneWheelEvent *>(event)); | - | ||||||||||||||||||||||||||||||
| 3601 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 3602 |     case never executed:   QEvent::KeyPress:case QEvent::KeyPress:never executed:   {case QEvent::KeyPress: | 0 | ||||||||||||||||||||||||||||||
| 3603 | QKeyEvent *k = static_cast<QKeyEvent *>(event); | - | ||||||||||||||||||||||||||||||
| 3604 |         if (k->key() == Qt::Key_Tab
 
  | 0 | ||||||||||||||||||||||||||||||
| 3605 |             if (!(k->modifiers() & (Qt::ControlModifier | Qt::AltModifier))
  | 0 | ||||||||||||||||||||||||||||||
| 3606 | bool res = false; | - | ||||||||||||||||||||||||||||||
| 3607 |                 if (k->key() == Qt::Key_Backtab
  | 0 | ||||||||||||||||||||||||||||||
| 3608 |                     || (k->key() == Qt::Key_Tab
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 3609 |                     if (d_ptr->isWidget
  | 0 | ||||||||||||||||||||||||||||||
| 3610 | res = static_cast<QGraphicsWidget *>(this)->focusNextPrevChild(false); | - | ||||||||||||||||||||||||||||||
| 3611 |                     } never executed:   else if (d_ptr->sceneend of block
  | 0 | ||||||||||||||||||||||||||||||
| 3612 | res = d_ptr->scene->focusNextPrevChild(false); | - | ||||||||||||||||||||||||||||||
| 3613 |                     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3614 |                 } never executed:   else if (k->key() == Qt::Key_Tabend of block
  | 0 | ||||||||||||||||||||||||||||||
| 3615 |                     if (d_ptr->isWidget
  | 0 | ||||||||||||||||||||||||||||||
| 3616 | res = static_cast<QGraphicsWidget *>(this)->focusNextPrevChild(true); | - | ||||||||||||||||||||||||||||||
| 3617 |                     } never executed:   else if (d_ptr->sceneend of block
  | 0 | ||||||||||||||||||||||||||||||
| 3618 | res = d_ptr->scene->focusNextPrevChild(true); | - | ||||||||||||||||||||||||||||||
| 3619 |                     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3620 |                 } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3621 |                 if (!res
  | 0 | ||||||||||||||||||||||||||||||
| 3622 |                     event->ignore(); never executed:  event->ignore(); | 0 | ||||||||||||||||||||||||||||||
| 3623 |                 return never executed:   true;return true;never executed:  return true; | 0 | ||||||||||||||||||||||||||||||
| 3624 | } | - | ||||||||||||||||||||||||||||||
| 3625 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3626 | keyPressEvent(static_cast<QKeyEvent *>(event)); | - | ||||||||||||||||||||||||||||||
| 3627 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 3628 | } | - | ||||||||||||||||||||||||||||||
| 3629 |     case never executed:   QEvent::KeyRelease:case QEvent::KeyRelease:never executed:  case QEvent::KeyRelease: | 0 | ||||||||||||||||||||||||||||||
| 3630 | keyReleaseEvent(static_cast<QKeyEvent *>(event)); | - | ||||||||||||||||||||||||||||||
| 3631 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 3632 |     case never executed:   QEvent::InputMethod:case QEvent::InputMethod:never executed:  case QEvent::InputMethod: | 0 | ||||||||||||||||||||||||||||||
| 3633 | inputMethodEvent(static_cast<QInputMethodEvent *>(event)); | - | ||||||||||||||||||||||||||||||
| 3634 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 3635 |     case never executed:   QEvent::WindowActivate:case QEvent::WindowActivate:never executed:  case QEvent::WindowActivate: | 0 | ||||||||||||||||||||||||||||||
| 3636 |     case never executed:   QEvent::WindowDeactivate:case QEvent::WindowDeactivate:never executed:  case QEvent::WindowDeactivate: | 0 | ||||||||||||||||||||||||||||||
| 3637 | - | |||||||||||||||||||||||||||||||
| 3638 |         if (d_ptr->scene
  | 0 | ||||||||||||||||||||||||||||||
| 3639 |             for (int i = 0; i < d_ptr->children.size()
  | 0 | ||||||||||||||||||||||||||||||
| 3640 | QGraphicsItem *child = d_ptr->children.at(i); | - | ||||||||||||||||||||||||||||||
| 3641 |                 if (child->isVisible()
 
  | 0 | ||||||||||||||||||||||||||||||
| 3642 |                     if (!(child->d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorHandlesChildEvents)
  | 0 | ||||||||||||||||||||||||||||||
| 3643 |                         d_ptr->scene->sendEvent(child, event); never executed:  d_ptr->scene->sendEvent(child, event); | 0 | ||||||||||||||||||||||||||||||
| 3644 |                 } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3645 |             } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3646 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3647 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 3648 |     default never executed:  :default:never executed:  default: | 0 | ||||||||||||||||||||||||||||||
| 3649 |         return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||
| 3650 | } | - | ||||||||||||||||||||||||||||||
| 3651 | - | |||||||||||||||||||||||||||||||
| 3652 |     return never executed:   true;return true;never executed:  return true; | 0 | ||||||||||||||||||||||||||||||
| 3653 | } | - | ||||||||||||||||||||||||||||||
| 3654 | void QGraphicsItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) | - | ||||||||||||||||||||||||||||||
| 3655 | { | - | ||||||||||||||||||||||||||||||
| 3656 | event->ignore(); | - | ||||||||||||||||||||||||||||||
| 3657 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3658 | void QGraphicsItem::dragEnterEvent(QGraphicsSceneDragDropEvent *event) | - | ||||||||||||||||||||||||||||||
| 3659 | { | - | ||||||||||||||||||||||||||||||
| 3660 | QGraphicsItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 3661 | - | |||||||||||||||||||||||||||||||
| 3662 |     if (d->isProxyWidget()
  | 0 | ||||||||||||||||||||||||||||||
| 3663 |         static_cast< never executed:  QGraphicsProxyWidget*>(this)->dragEnterEvent(event);static_cast<QGraphicsProxyWidget*>(this)->dragEnterEvent(event);never executed:  static_cast<QGraphicsProxyWidget*>(this)->dragEnterEvent(event); | 0 | ||||||||||||||||||||||||||||||
| 3664 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3665 | void QGraphicsItem::dragLeaveEvent(QGraphicsSceneDragDropEvent *event) | - | ||||||||||||||||||||||||||||||
| 3666 | { | - | ||||||||||||||||||||||||||||||
| 3667 | QGraphicsItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 3668 | - | |||||||||||||||||||||||||||||||
| 3669 |     if (d->isProxyWidget()
  | 0 | ||||||||||||||||||||||||||||||
| 3670 |         static_cast< never executed:  QGraphicsProxyWidget*>(this)->dragLeaveEvent(event);static_cast<QGraphicsProxyWidget*>(this)->dragLeaveEvent(event);never executed:  static_cast<QGraphicsProxyWidget*>(this)->dragLeaveEvent(event); | 0 | ||||||||||||||||||||||||||||||
| 3671 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3672 | void QGraphicsItem::dragMoveEvent(QGraphicsSceneDragDropEvent *event) | - | ||||||||||||||||||||||||||||||
| 3673 | { | - | ||||||||||||||||||||||||||||||
| 3674 | QGraphicsItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 3675 | - | |||||||||||||||||||||||||||||||
| 3676 |     if (d->isProxyWidget()
  | 0 | ||||||||||||||||||||||||||||||
| 3677 |         static_cast< never executed:  QGraphicsProxyWidget*>(this)->dragMoveEvent(event);static_cast<QGraphicsProxyWidget*>(this)->dragMoveEvent(event);never executed:  static_cast<QGraphicsProxyWidget*>(this)->dragMoveEvent(event); | 0 | ||||||||||||||||||||||||||||||
| 3678 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3679 | void QGraphicsItem::dropEvent(QGraphicsSceneDragDropEvent *event) | - | ||||||||||||||||||||||||||||||
| 3680 | { | - | ||||||||||||||||||||||||||||||
| 3681 | QGraphicsItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 3682 | - | |||||||||||||||||||||||||||||||
| 3683 |     if (d->isProxyWidget()
  | 0 | ||||||||||||||||||||||||||||||
| 3684 |         static_cast< never executed:  QGraphicsProxyWidget*>(this)->dropEvent(event);static_cast<QGraphicsProxyWidget*>(this)->dropEvent(event);never executed:  static_cast<QGraphicsProxyWidget*>(this)->dropEvent(event); | 0 | ||||||||||||||||||||||||||||||
| 3685 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3686 | void QGraphicsItem::focusInEvent(QFocusEvent *event) | - | ||||||||||||||||||||||||||||||
| 3687 | { | - | ||||||||||||||||||||||||||||||
| 3688 | (void)event;; | - | ||||||||||||||||||||||||||||||
| 3689 | update(); | - | ||||||||||||||||||||||||||||||
| 3690 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3691 | - | |||||||||||||||||||||||||||||||
| 3692 | - | |||||||||||||||||||||||||||||||
| 3693 | - | |||||||||||||||||||||||||||||||
| 3694 | - | |||||||||||||||||||||||||||||||
| 3695 | - | |||||||||||||||||||||||||||||||
| 3696 | - | |||||||||||||||||||||||||||||||
| 3697 | - | |||||||||||||||||||||||||||||||
| 3698 | void QGraphicsItem::focusOutEvent(QFocusEvent *event) | - | ||||||||||||||||||||||||||||||
| 3699 | { | - | ||||||||||||||||||||||||||||||
| 3700 | (void)event;; | - | ||||||||||||||||||||||||||||||
| 3701 | update(); | - | ||||||||||||||||||||||||||||||
| 3702 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3703 | void QGraphicsItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event) | - | ||||||||||||||||||||||||||||||
| 3704 | { | - | ||||||||||||||||||||||||||||||
| 3705 | (void)event;; | - | ||||||||||||||||||||||||||||||
| 3706 | update(); | - | ||||||||||||||||||||||||||||||
| 3707 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3708 | void QGraphicsItem::hoverMoveEvent(QGraphicsSceneHoverEvent *event) | - | ||||||||||||||||||||||||||||||
| 3709 | { | - | ||||||||||||||||||||||||||||||
| 3710 | (void)event;; | - | ||||||||||||||||||||||||||||||
| 3711 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3712 | void QGraphicsItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) | - | ||||||||||||||||||||||||||||||
| 3713 | { | - | ||||||||||||||||||||||||||||||
| 3714 | (void)event;; | - | ||||||||||||||||||||||||||||||
| 3715 | update(); | - | ||||||||||||||||||||||||||||||
| 3716 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3717 | void QGraphicsItem::keyPressEvent(QKeyEvent *event) | - | ||||||||||||||||||||||||||||||
| 3718 | { | - | ||||||||||||||||||||||||||||||
| 3719 | event->ignore(); | - | ||||||||||||||||||||||||||||||
| 3720 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3721 | void QGraphicsItem::keyReleaseEvent(QKeyEvent *event) | - | ||||||||||||||||||||||||||||||
| 3722 | { | - | ||||||||||||||||||||||||||||||
| 3723 | event->ignore(); | - | ||||||||||||||||||||||||||||||
| 3724 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3725 | void QGraphicsItem::mousePressEvent(QGraphicsSceneMouseEvent *event) | - | ||||||||||||||||||||||||||||||
| 3726 | { | - | ||||||||||||||||||||||||||||||
| 3727 |     if (event->button() == Qt::LeftButton
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 3728 | bool multiSelect = (event->modifiers() & Qt::ControlModifier) != 0; | - | ||||||||||||||||||||||||||||||
| 3729 |         if (!multiSelect
  | 0 | ||||||||||||||||||||||||||||||
| 3730 |             if (!d_ptr->selected
  | 0 | ||||||||||||||||||||||||||||||
| 3731 |                 if (QGraphicsScene *scene = d_ptr->scene
  | 0 | ||||||||||||||||||||||||||||||
| 3732 | ++scene->d_func()->selectionChanging; | - | ||||||||||||||||||||||||||||||
| 3733 | scene->clearSelection(); | - | ||||||||||||||||||||||||||||||
| 3734 | --scene->d_func()->selectionChanging; | - | ||||||||||||||||||||||||||||||
| 3735 |                 } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3736 | setSelected(true); | - | ||||||||||||||||||||||||||||||
| 3737 |             } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3738 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3739 |     } never executed:   else if (!(flags() & ItemIsMovable)end of block
  | 0 | ||||||||||||||||||||||||||||||
| 3740 | event->ignore(); | - | ||||||||||||||||||||||||||||||
| 3741 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3742 |     if (d_ptr->isWidget
  | 0 | ||||||||||||||||||||||||||||||
| 3743 | - | |||||||||||||||||||||||||||||||
| 3744 | QGraphicsWidget *w = static_cast<QGraphicsWidget *>(this); | - | ||||||||||||||||||||||||||||||
| 3745 |         if ((
 
  | 0 | ||||||||||||||||||||||||||||||
| 3746 | event->accept(); | - | ||||||||||||||||||||||||||||||
| 3747 |             if (!w->rect().contains(event->pos())
  | 0 | ||||||||||||||||||||||||||||||
| 3748 |                 w->close(); never executed:  w->close(); | 0 | ||||||||||||||||||||||||||||||
| 3749 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3750 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3751 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3752 | - | |||||||||||||||||||||||||||||||
| 3753 | - | |||||||||||||||||||||||||||||||
| 3754 | - | |||||||||||||||||||||||||||||||
| 3755 | - | |||||||||||||||||||||||||||||||
| 3756 | bool _qt_movableAncestorIsSelected(const QGraphicsItem *item) | - | ||||||||||||||||||||||||||||||
| 3757 | { | - | ||||||||||||||||||||||||||||||
| 3758 | const QGraphicsItem *parent = item->parentItem(); | - | ||||||||||||||||||||||||||||||
| 3759 |     return never executed:   parentreturn parent && (((parent->flags() & QGraphicsItem::ItemIsMovable) && parent->isSelected()) || _qt_movableAncestorIsSelected(parent));
 
 
 
 
 never executed:  return parent && (((parent->flags() & QGraphicsItem::ItemIsMovable) && parent->isSelected()) || _qt_movableAncestorIsSelected(parent)); | 0 | ||||||||||||||||||||||||||||||
| 3760 | } | - | ||||||||||||||||||||||||||||||
| 3761 | - | |||||||||||||||||||||||||||||||
| 3762 | bool QGraphicsItemPrivate::movableAncestorIsSelected(const QGraphicsItem *item) | - | ||||||||||||||||||||||||||||||
| 3763 | { | - | ||||||||||||||||||||||||||||||
| 3764 | const QGraphicsItem *parent = item->d_ptr->parent; | - | ||||||||||||||||||||||||||||||
| 3765 |     return never executed:   parentreturn parent && (((parent->flags() & QGraphicsItem::ItemIsMovable) && parent->isSelected()) || _qt_movableAncestorIsSelected(parent));
 
 
 
 
 never executed:  return parent && (((parent->flags() & QGraphicsItem::ItemIsMovable) && parent->isSelected()) || _qt_movableAncestorIsSelected(parent)); | 0 | ||||||||||||||||||||||||||||||
| 3766 | } | - | ||||||||||||||||||||||||||||||
| 3767 | void QGraphicsItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event) | - | ||||||||||||||||||||||||||||||
| 3768 | { | - | ||||||||||||||||||||||||||||||
| 3769 |     if ((
 
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 3770 | - | |||||||||||||||||||||||||||||||
| 3771 | QList<QGraphicsItem *> selectedItems; | - | ||||||||||||||||||||||||||||||
| 3772 | QHash<QGraphicsItem *, QPointF> initialPositions; | - | ||||||||||||||||||||||||||||||
| 3773 |         if (d_ptr->scene
  | 0 | ||||||||||||||||||||||||||||||
| 3774 | selectedItems = d_ptr->scene->selectedItems(); | - | ||||||||||||||||||||||||||||||
| 3775 | initialPositions = d_ptr->scene->d_func()->movingItemsInitialPositions; | - | ||||||||||||||||||||||||||||||
| 3776 |             if (initialPositions.isEmpty()
  | 0 | ||||||||||||||||||||||||||||||
| 3777 | 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) | - | ||||||||||||||||||||||||||||||
| 3778 |                     initialPositions[item] = item->pos(); never executed:  initialPositions[item] = item->pos(); | 0 | ||||||||||||||||||||||||||||||
| 3779 | initialPositions[this] = pos(); | - | ||||||||||||||||||||||||||||||
| 3780 |             } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3781 | d_ptr->scene->d_func()->movingItemsInitialPositions = initialPositions; | - | ||||||||||||||||||||||||||||||
| 3782 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3783 | - | |||||||||||||||||||||||||||||||
| 3784 | - | |||||||||||||||||||||||||||||||
| 3785 | QGraphicsView *view = 0; | - | ||||||||||||||||||||||||||||||
| 3786 |         if (event->widget()
  | 0 | ||||||||||||||||||||||||||||||
| 3787 |             view = qobject_cast<QGraphicsView *>(event->widget()->parentWidget()); never executed:  view = qobject_cast<QGraphicsView *>(event->widget()->parentWidget()); | 0 | ||||||||||||||||||||||||||||||
| 3788 | - | |||||||||||||||||||||||||||||||
| 3789 | - | |||||||||||||||||||||||||||||||
| 3790 | int i = 0; | - | ||||||||||||||||||||||||||||||
| 3791 | bool movedMe = false; | - | ||||||||||||||||||||||||||||||
| 3792 |         while (i <= selectedItems.size()
  | 0 | ||||||||||||||||||||||||||||||
| 3793 | QGraphicsItem *item = 0; | - | ||||||||||||||||||||||||||||||
| 3794 |             if (i < selectedItems.size()
  | 0 | ||||||||||||||||||||||||||||||
| 3795 |                 item = selectedItems.at(i); never executed:  item = selectedItems.at(i); | 0 | ||||||||||||||||||||||||||||||
| 3796 | else | - | ||||||||||||||||||||||||||||||
| 3797 |                 item = this; never executed:  item = this; | 0 | ||||||||||||||||||||||||||||||
| 3798 |             if (item == this
  | 0 | ||||||||||||||||||||||||||||||
| 3799 | - | |||||||||||||||||||||||||||||||
| 3800 | - | |||||||||||||||||||||||||||||||
| 3801 | - | |||||||||||||||||||||||||||||||
| 3802 | - | |||||||||||||||||||||||||||||||
| 3803 |                 if (movedMe
  | 0 | ||||||||||||||||||||||||||||||
| 3804 |                     break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 3805 | movedMe = true; | - | ||||||||||||||||||||||||||||||
| 3806 |             } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3807 | - | |||||||||||||||||||||||||||||||
| 3808 |             if ((
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 3809 | QPointF currentParentPos; | - | ||||||||||||||||||||||||||||||
| 3810 | QPointF buttonDownParentPos; | - | ||||||||||||||||||||||||||||||
| 3811 |                 if (item->d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorIgnoresTransformations
  | 0 | ||||||||||||||||||||||||||||||
| 3812 | - | |||||||||||||||||||||||||||||||
| 3813 | - | |||||||||||||||||||||||||||||||
| 3814 | - | |||||||||||||||||||||||||||||||
| 3815 | QTransform viewToItemTransform = (item->deviceTransform(view->viewportTransform())).inverted(); | - | ||||||||||||||||||||||||||||||
| 3816 | currentParentPos = mapToParent(viewToItemTransform.map(QPointF(view->mapFromGlobal(event->screenPos())))); | - | ||||||||||||||||||||||||||||||
| 3817 | buttonDownParentPos = mapToParent(viewToItemTransform.map(QPointF(view->mapFromGlobal(event->buttonDownScreenPos(Qt::LeftButton))))); | - | ||||||||||||||||||||||||||||||
| 3818 |                 } never executed:   else if (item->flags() & ItemIgnoresTransformationsend of block
  | 0 | ||||||||||||||||||||||||||||||
| 3819 | - | |||||||||||||||||||||||||||||||
| 3820 | - | |||||||||||||||||||||||||||||||
| 3821 | - | |||||||||||||||||||||||||||||||
| 3822 | - | |||||||||||||||||||||||||||||||
| 3823 | QTransform itemTransform; | - | ||||||||||||||||||||||||||||||
| 3824 |                     if (item->d_ptr->transformData
  | 0 | ||||||||||||||||||||||||||||||
| 3825 |                         itemTransform = item->d_ptr->transformData->computedFullTransform(); never executed:  itemTransform = item->d_ptr->transformData->computedFullTransform(); | 0 | ||||||||||||||||||||||||||||||
| 3826 | itemTransform.translate(item->d_ptr->pos.x(), item->d_ptr->pos.y()); | - | ||||||||||||||||||||||||||||||
| 3827 | QTransform viewToParentTransform = itemTransform | - | ||||||||||||||||||||||||||||||
| 3828 | * (item->sceneTransform() * view->viewportTransform()).inverted(); | - | ||||||||||||||||||||||||||||||
| 3829 | currentParentPos = viewToParentTransform.map(QPointF(view->mapFromGlobal(event->screenPos()))); | - | ||||||||||||||||||||||||||||||
| 3830 | buttonDownParentPos = viewToParentTransform.map(QPointF(view->mapFromGlobal(event->buttonDownScreenPos(Qt::LeftButton)))); | - | ||||||||||||||||||||||||||||||
| 3831 |                 } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||
| 3832 | - | |||||||||||||||||||||||||||||||
| 3833 | currentParentPos = item->mapToParent(item->mapFromScene(event->scenePos())); | - | ||||||||||||||||||||||||||||||
| 3834 | buttonDownParentPos = item->mapToParent(item->mapFromScene(event->buttonDownScenePos(Qt::LeftButton))); | - | ||||||||||||||||||||||||||||||
| 3835 |                 } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3836 | - | |||||||||||||||||||||||||||||||
| 3837 | item->setPos(initialPositions.value(item) + currentParentPos - buttonDownParentPos); | - | ||||||||||||||||||||||||||||||
| 3838 | - | |||||||||||||||||||||||||||||||
| 3839 |                 if (item->flags() & ItemIsSelectable
  | 0 | ||||||||||||||||||||||||||||||
| 3840 |                     item->setSelected(true); never executed:  item->setSelected(true); | 0 | ||||||||||||||||||||||||||||||
| 3841 |             } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3842 | ++i; | - | ||||||||||||||||||||||||||||||
| 3843 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3844 | - | |||||||||||||||||||||||||||||||
| 3845 |     } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||
| 3846 | event->ignore(); | - | ||||||||||||||||||||||||||||||
| 3847 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3848 | } | - | ||||||||||||||||||||||||||||||
| 3849 | void QGraphicsItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) | - | ||||||||||||||||||||||||||||||
| 3850 | { | - | ||||||||||||||||||||||||||||||
| 3851 |     if (event->button() == Qt::LeftButton
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 3852 | bool multiSelect = (event->modifiers() & Qt::ControlModifier) != 0; | - | ||||||||||||||||||||||||||||||
| 3853 |         if (event->scenePos() == event->buttonDownScenePos(Qt::LeftButton)
  | 0 | ||||||||||||||||||||||||||||||
| 3854 | - | |||||||||||||||||||||||||||||||
| 3855 |             if (multiSelect
  | 0 | ||||||||||||||||||||||||||||||
| 3856 | setSelected(!isSelected()); | - | ||||||||||||||||||||||||||||||
| 3857 |             } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||
| 3858 | bool selectionChanged = false; | - | ||||||||||||||||||||||||||||||
| 3859 |                 if (QGraphicsScene *scene = d_ptr->scene
  | 0 | ||||||||||||||||||||||||||||||
| 3860 | ++scene->d_func()->selectionChanging; | - | ||||||||||||||||||||||||||||||
| 3861 | - | |||||||||||||||||||||||||||||||
| 3862 | - | |||||||||||||||||||||||||||||||
| 3863 | - | |||||||||||||||||||||||||||||||
| 3864 |                     if (d_ptr->selected
  | 0 | ||||||||||||||||||||||||||||||
| 3865 | scene->d_func()->selectedItems.remove(this); | - | ||||||||||||||||||||||||||||||
| 3866 | 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) { | - | ||||||||||||||||||||||||||||||
| 3867 |                             if (item->isSelected()
  | 0 | ||||||||||||||||||||||||||||||
| 3868 | selectionChanged = true; | - | ||||||||||||||||||||||||||||||
| 3869 |                                 break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 3870 | } | - | ||||||||||||||||||||||||||||||
| 3871 |                         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3872 |                     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3873 | scene->clearSelection(); | - | ||||||||||||||||||||||||||||||
| 3874 |                     if (d_ptr->selected
  | 0 | ||||||||||||||||||||||||||||||
| 3875 |                         scene->d_func()->selectedItems.insert(this); never executed:  scene->d_func()->selectedItems.insert(this); | 0 | ||||||||||||||||||||||||||||||
| 3876 | --scene->d_func()->selectionChanging; | - | ||||||||||||||||||||||||||||||
| 3877 |                     if (selectionChanged
  | 0 | ||||||||||||||||||||||||||||||
| 3878 |                         d_ptr->scene->selectionChanged(); never executed:  d_ptr->scene->selectionChanged(); | 0 | ||||||||||||||||||||||||||||||
| 3879 |                 } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3880 | setSelected(true); | - | ||||||||||||||||||||||||||||||
| 3881 |             } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3882 | } | - | ||||||||||||||||||||||||||||||
| 3883 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3884 |     if (d_ptr->scene
 
  | 0 | ||||||||||||||||||||||||||||||
| 3885 |         d_ptr->scene->d_func()->movingItemsInitialPositions.clear(); never executed:  d_ptr->scene->d_func()->movingItemsInitialPositions.clear(); | 0 | ||||||||||||||||||||||||||||||
| 3886 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3887 | void QGraphicsItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) | - | ||||||||||||||||||||||||||||||
| 3888 | { | - | ||||||||||||||||||||||||||||||
| 3889 | mousePressEvent(event); | - | ||||||||||||||||||||||||||||||
| 3890 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3891 | void QGraphicsItem::wheelEvent(QGraphicsSceneWheelEvent *event) | - | ||||||||||||||||||||||||||||||
| 3892 | { | - | ||||||||||||||||||||||||||||||
| 3893 | event->ignore(); | - | ||||||||||||||||||||||||||||||
| 3894 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3895 | void QGraphicsItem::inputMethodEvent(QInputMethodEvent *event) | - | ||||||||||||||||||||||||||||||
| 3896 | { | - | ||||||||||||||||||||||||||||||
| 3897 | event->ignore(); | - | ||||||||||||||||||||||||||||||
| 3898 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3899 | QVariant QGraphicsItem::inputMethodQuery(Qt::InputMethodQuery query) const | - | ||||||||||||||||||||||||||||||
| 3900 | { | - | ||||||||||||||||||||||||||||||
| 3901 | (void)query;; | - | ||||||||||||||||||||||||||||||
| 3902 |     return never executed:   QVariant();return QVariant();never executed:  return QVariant(); | 0 | ||||||||||||||||||||||||||||||
| 3903 | } | - | ||||||||||||||||||||||||||||||
| 3904 | Qt::InputMethodHints QGraphicsItem::inputMethodHints() const | - | ||||||||||||||||||||||||||||||
| 3905 | { | - | ||||||||||||||||||||||||||||||
| 3906 | const QGraphicsItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 3907 |     return never executed:   d->imHints;return d->imHints;never executed:  return d->imHints; | 0 | ||||||||||||||||||||||||||||||
| 3908 | } | - | ||||||||||||||||||||||||||||||
| 3909 | void QGraphicsItem::setInputMethodHints(Qt::InputMethodHints hints) | - | ||||||||||||||||||||||||||||||
| 3910 | { | - | ||||||||||||||||||||||||||||||
| 3911 | QGraphicsItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 3912 | d->imHints = hints; | - | ||||||||||||||||||||||||||||||
| 3913 |     if (!hasFocus()
  | 0 | ||||||||||||||||||||||||||||||
| 3914 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 3915 | d->scene->d_func()->updateInputMethodSensitivityInViews(); | - | ||||||||||||||||||||||||||||||
| 3916 | QWidget *fw = QApplication::focusWidget(); | - | ||||||||||||||||||||||||||||||
| 3917 |     if (!fw
  | 0 | ||||||||||||||||||||||||||||||
| 3918 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 3919 | QGuiApplication::inputMethod()->update(Qt::ImHints); | - | ||||||||||||||||||||||||||||||
| 3920 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3921 | void QGraphicsItem::updateMicroFocus() | - | ||||||||||||||||||||||||||||||
| 3922 | { | - | ||||||||||||||||||||||||||||||
| 3923 | } | - | ||||||||||||||||||||||||||||||
| 3924 | QVariant QGraphicsItem::itemChange(GraphicsItemChange change, const QVariant &value) | - | ||||||||||||||||||||||||||||||
| 3925 | { | - | ||||||||||||||||||||||||||||||
| 3926 | (void)change;; | - | ||||||||||||||||||||||||||||||
| 3927 |     return never executed:   value;return value;never executed:  return value; | 0 | ||||||||||||||||||||||||||||||
| 3928 | } | - | ||||||||||||||||||||||||||||||
| 3929 | - | |||||||||||||||||||||||||||||||
| 3930 | - | |||||||||||||||||||||||||||||||
| 3931 | - | |||||||||||||||||||||||||||||||
| 3932 | - | |||||||||||||||||||||||||||||||
| 3933 | - | |||||||||||||||||||||||||||||||
| 3934 | - | |||||||||||||||||||||||||||||||
| 3935 | - | |||||||||||||||||||||||||||||||
| 3936 | bool QGraphicsItem::supportsExtension(Extension extension) const | - | ||||||||||||||||||||||||||||||
| 3937 | { | - | ||||||||||||||||||||||||||||||
| 3938 | (void)extension;; | - | ||||||||||||||||||||||||||||||
| 3939 |     return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||
| 3940 | } | - | ||||||||||||||||||||||||||||||
| 3941 | - | |||||||||||||||||||||||||||||||
| 3942 | - | |||||||||||||||||||||||||||||||
| 3943 | - | |||||||||||||||||||||||||||||||
| 3944 | - | |||||||||||||||||||||||||||||||
| 3945 | - | |||||||||||||||||||||||||||||||
| 3946 | - | |||||||||||||||||||||||||||||||
| 3947 | - | |||||||||||||||||||||||||||||||
| 3948 | void QGraphicsItem::setExtension(Extension extension, const QVariant &variant) | - | ||||||||||||||||||||||||||||||
| 3949 | { | - | ||||||||||||||||||||||||||||||
| 3950 | (void)extension;; | - | ||||||||||||||||||||||||||||||
| 3951 | (void)variant;; | - | ||||||||||||||||||||||||||||||
| 3952 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3953 | - | |||||||||||||||||||||||||||||||
| 3954 | - | |||||||||||||||||||||||||||||||
| 3955 | - | |||||||||||||||||||||||||||||||
| 3956 | - | |||||||||||||||||||||||||||||||
| 3957 | - | |||||||||||||||||||||||||||||||
| 3958 | - | |||||||||||||||||||||||||||||||
| 3959 | - | |||||||||||||||||||||||||||||||
| 3960 | QVariant QGraphicsItem::extension(const QVariant &variant) const | - | ||||||||||||||||||||||||||||||
| 3961 | { | - | ||||||||||||||||||||||||||||||
| 3962 | (void)variant;; | - | ||||||||||||||||||||||||||||||
| 3963 |     return never executed:   QVariant();return QVariant();never executed:  return QVariant(); | 0 | ||||||||||||||||||||||||||||||
| 3964 | } | - | ||||||||||||||||||||||||||||||
| 3965 | void QGraphicsItem::addToIndex() | - | ||||||||||||||||||||||||||||||
| 3966 | { | - | ||||||||||||||||||||||||||||||
| 3967 |     if (d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren
  | 0 | ||||||||||||||||||||||||||||||
| 3968 |         || d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorContainsChildren
  | 0 | ||||||||||||||||||||||||||||||
| 3969 | - | |||||||||||||||||||||||||||||||
| 3970 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 3971 | } | - | ||||||||||||||||||||||||||||||
| 3972 |     if (d_ptr->scene
  | 0 | ||||||||||||||||||||||||||||||
| 3973 |         d_ptr->scene->d_func()->index->addItem(this); never executed:  d_ptr->scene->d_func()->index->addItem(this); | 0 | ||||||||||||||||||||||||||||||
| 3974 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3975 | void QGraphicsItem::removeFromIndex() | - | ||||||||||||||||||||||||||||||
| 3976 | { | - | ||||||||||||||||||||||||||||||
| 3977 |     if (d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorClipsChildren
  | 0 | ||||||||||||||||||||||||||||||
| 3978 |         || d_ptr->ancestorFlags & QGraphicsItemPrivate::AncestorContainsChildren
  | 0 | ||||||||||||||||||||||||||||||
| 3979 | - | |||||||||||||||||||||||||||||||
| 3980 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 3981 | } | - | ||||||||||||||||||||||||||||||
| 3982 |     if (d_ptr->scene
  | 0 | ||||||||||||||||||||||||||||||
| 3983 |         d_ptr->scene->d_func()->index->removeItem(this); never executed:  d_ptr->scene->d_func()->index->removeItem(this); | 0 | ||||||||||||||||||||||||||||||
| 3984 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 3985 | void QGraphicsItem::prepareGeometryChange() | - | ||||||||||||||||||||||||||||||
| 3986 | { | - | ||||||||||||||||||||||||||||||
| 3987 |     if (d_ptr->inDestructor
  | 0 | ||||||||||||||||||||||||||||||
| 3988 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 3989 |     if (d_ptr->scene
  | 0 | ||||||||||||||||||||||||||||||
| 3990 | d_ptr->scene->d_func()->dirtyGrowingItemsBoundingRect = true; | - | ||||||||||||||||||||||||||||||
| 3991 | d_ptr->geometryChanged = 1; | - | ||||||||||||||||||||||||||||||
| 3992 | d_ptr->paintedViewBoundingRectsNeedRepaint = 1; | - | ||||||||||||||||||||||||||||||
| 3993 | d_ptr->notifyBoundingRectChanged = !d_ptr->inSetPosHelper; | - | ||||||||||||||||||||||||||||||
| 3994 | - | |||||||||||||||||||||||||||||||
| 3995 | QGraphicsScenePrivate *scenePrivate = d_ptr->scene->d_func(); | - | ||||||||||||||||||||||||||||||
| 3996 | scenePrivate->index->prepareBoundingRectChange(this); | - | ||||||||||||||||||||||||||||||
| 3997 | scenePrivate->markDirty(this, QRectF(), true, false, | - | ||||||||||||||||||||||||||||||
| 3998 | false, false, | - | ||||||||||||||||||||||||||||||
| 3999 | true); | - | ||||||||||||||||||||||||||||||
| 4000 | - | |||||||||||||||||||||||||||||||
| 4001 | - | |||||||||||||||||||||||||||||||
| 4002 | - | |||||||||||||||||||||||||||||||
| 4003 | - | |||||||||||||||||||||||||||||||
| 4004 | - | |||||||||||||||||||||||||||||||
| 4005 |         if (scenePrivate->isSignalConnected(scenePrivate->changedSignalIndex)
  | 0 | ||||||||||||||||||||||||||||||
| 4006 |             || scenePrivate->views.isEmpty()
  | 0 | ||||||||||||||||||||||||||||||
| 4007 |             if (d_ptr->hasTranslateOnlySceneTransform()
  | 0 | ||||||||||||||||||||||||||||||
| 4008 | d_ptr->scene->update(boundingRect().translated(d_ptr->sceneTransform.dx(), | - | ||||||||||||||||||||||||||||||
| 4009 | d_ptr->sceneTransform.dy())); | - | ||||||||||||||||||||||||||||||
| 4010 |             } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||
| 4011 | d_ptr->scene->update(d_ptr->sceneTransform.mapRect(boundingRect())); | - | ||||||||||||||||||||||||||||||
| 4012 |             } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4013 | } | - | ||||||||||||||||||||||||||||||
| 4014 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4015 | - | |||||||||||||||||||||||||||||||
| 4016 | d_ptr->markParentDirty( true); | - | ||||||||||||||||||||||||||||||
| 4017 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4018 | static void qt_graphicsItem_highlightSelected( | - | ||||||||||||||||||||||||||||||
| 4019 | QGraphicsItem *item, QPainter *painter, const QStyleOptionGraphicsItem *option) | - | ||||||||||||||||||||||||||||||
| 4020 | { | - | ||||||||||||||||||||||||||||||
| 4021 | const QRectF murect = painter->transform().mapRect(QRectF(0, 0, 1, 1)); | - | ||||||||||||||||||||||||||||||
| 4022 |     if (qFuzzyIsNull(qMax(murect.width(), murect.height()))
  | 0 | ||||||||||||||||||||||||||||||
| 4023 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 4024 | - | |||||||||||||||||||||||||||||||
| 4025 | const QRectF mbrect = painter->transform().mapRect(item->boundingRect()); | - | ||||||||||||||||||||||||||||||
| 4026 |     if (qMin(mbrect.width(), mbrect.height()) < qreal(1.0)
  | 0 | ||||||||||||||||||||||||||||||
| 4027 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 4028 | - | |||||||||||||||||||||||||||||||
| 4029 | qreal itemPenWidth; | - | ||||||||||||||||||||||||||||||
| 4030 | switch (item->type()) { | - | ||||||||||||||||||||||||||||||
| 4031 |         case never executed:   QGraphicsEllipseItem::Type:case QGraphicsEllipseItem::Type:never executed:  case QGraphicsEllipseItem::Type: | 0 | ||||||||||||||||||||||||||||||
| 4032 | itemPenWidth = static_cast<QGraphicsEllipseItem *>(item)->pen().widthF(); | - | ||||||||||||||||||||||||||||||
| 4033 |             break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 4034 |         case never executed:   QGraphicsPathItem::Type:case QGraphicsPathItem::Type:never executed:  case QGraphicsPathItem::Type: | 0 | ||||||||||||||||||||||||||||||
| 4035 | itemPenWidth = static_cast<QGraphicsPathItem *>(item)->pen().widthF(); | - | ||||||||||||||||||||||||||||||
| 4036 |             break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 4037 |         case never executed:   QGraphicsPolygonItem::Type:case QGraphicsPolygonItem::Type:never executed:  case QGraphicsPolygonItem::Type: | 0 | ||||||||||||||||||||||||||||||
| 4038 | itemPenWidth = static_cast<QGraphicsPolygonItem *>(item)->pen().widthF(); | - | ||||||||||||||||||||||||||||||
| 4039 |             break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 4040 |         case never executed:   QGraphicsRectItem::Type:case QGraphicsRectItem::Type:never executed:  case QGraphicsRectItem::Type: | 0 | ||||||||||||||||||||||||||||||
| 4041 | itemPenWidth = static_cast<QGraphicsRectItem *>(item)->pen().widthF(); | - | ||||||||||||||||||||||||||||||
| 4042 |             break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 4043 |         case never executed:   QGraphicsSimpleTextItem::Type:case QGraphicsSimpleTextItem::Type:never executed:  case QGraphicsSimpleTextItem::Type: | 0 | ||||||||||||||||||||||||||||||
| 4044 | itemPenWidth = static_cast<QGraphicsSimpleTextItem *>(item)->pen().widthF(); | - | ||||||||||||||||||||||||||||||
| 4045 |             break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 4046 |         case never executed:   QGraphicsLineItem::Type:case QGraphicsLineItem::Type:never executed:  case QGraphicsLineItem::Type: | 0 | ||||||||||||||||||||||||||||||
| 4047 | itemPenWidth = static_cast<QGraphicsLineItem *>(item)->pen().widthF(); | - | ||||||||||||||||||||||||||||||
| 4048 |             break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 4049 |         default never executed:  :default:never executed:  default: | 0 | ||||||||||||||||||||||||||||||
| 4050 | itemPenWidth = 1.0; | - | ||||||||||||||||||||||||||||||
| 4051 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4052 | const qreal pad = itemPenWidth / 2; | - | ||||||||||||||||||||||||||||||
| 4053 | - | |||||||||||||||||||||||||||||||
| 4054 | const qreal penWidth = 0; | - | ||||||||||||||||||||||||||||||
| 4055 | - | |||||||||||||||||||||||||||||||
| 4056 | const QColor fgcolor = option->palette.windowText().color(); | - | ||||||||||||||||||||||||||||||
| 4057 | const QColor bgcolor( | - | ||||||||||||||||||||||||||||||
| 4058 | fgcolor.red() > 127 ? 0 : 255, | - | ||||||||||||||||||||||||||||||
| 4059 | fgcolor.green() > 127 ? 0 : 255, | - | ||||||||||||||||||||||||||||||
| 4060 | fgcolor.blue() > 127 ? 0 : 255); | - | ||||||||||||||||||||||||||||||
| 4061 | - | |||||||||||||||||||||||||||||||
| 4062 | painter->setPen(QPen(bgcolor, penWidth, Qt::SolidLine)); | - | ||||||||||||||||||||||||||||||
| 4063 | painter->setBrush(Qt::NoBrush); | - | ||||||||||||||||||||||||||||||
| 4064 | painter->drawRect(item->boundingRect().adjusted(pad, pad, -pad, -pad)); | - | ||||||||||||||||||||||||||||||
| 4065 | - | |||||||||||||||||||||||||||||||
| 4066 | painter->setPen(QPen(option->palette.windowText(), 0, Qt::DashLine)); | - | ||||||||||||||||||||||||||||||
| 4067 | painter->setBrush(Qt::NoBrush); | - | ||||||||||||||||||||||||||||||
| 4068 | painter->drawRect(item->boundingRect().adjusted(pad, pad, -pad, -pad)); | - | ||||||||||||||||||||||||||||||
| 4069 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4070 | QGraphicsObject::QGraphicsObject(QGraphicsItem *parent) | - | ||||||||||||||||||||||||||||||
| 4071 | : QGraphicsItem(parent) | - | ||||||||||||||||||||||||||||||
| 4072 | { | - | ||||||||||||||||||||||||||||||
| 4073 | QGraphicsItem::d_ptr->isObject = true; | - | ||||||||||||||||||||||||||||||
| 4074 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4075 | - | |||||||||||||||||||||||||||||||
| 4076 | - | |||||||||||||||||||||||||||||||
| 4077 | - | |||||||||||||||||||||||||||||||
| 4078 | - | |||||||||||||||||||||||||||||||
| 4079 | QGraphicsObject::QGraphicsObject(QGraphicsItemPrivate &dd, QGraphicsItem *parent) | - | ||||||||||||||||||||||||||||||
| 4080 | : QGraphicsItem(dd, parent) | - | ||||||||||||||||||||||||||||||
| 4081 | { | - | ||||||||||||||||||||||||||||||
| 4082 | QGraphicsItem::d_ptr->isObject = true; | - | ||||||||||||||||||||||||||||||
| 4083 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4084 | - | |||||||||||||||||||||||||||||||
| 4085 | - | |||||||||||||||||||||||||||||||
| 4086 | - | |||||||||||||||||||||||||||||||
| 4087 | - | |||||||||||||||||||||||||||||||
| 4088 | QGraphicsObject::~QGraphicsObject() | - | ||||||||||||||||||||||||||||||
| 4089 | { | - | ||||||||||||||||||||||||||||||
| 4090 | } | - | ||||||||||||||||||||||||||||||
| 4091 | - | |||||||||||||||||||||||||||||||
| 4092 | - | |||||||||||||||||||||||||||||||
| 4093 | - | |||||||||||||||||||||||||||||||
| 4094 | - | |||||||||||||||||||||||||||||||
| 4095 | bool QGraphicsObject::event(QEvent *ev) | - | ||||||||||||||||||||||||||||||
| 4096 | { | - | ||||||||||||||||||||||||||||||
| 4097 |     if (ev->type() == QEvent::StyleAnimationUpdate
  | 0 | ||||||||||||||||||||||||||||||
| 4098 |         if (isVisible()
  | 0 | ||||||||||||||||||||||||||||||
| 4099 | ev->accept(); | - | ||||||||||||||||||||||||||||||
| 4100 | update(); | - | ||||||||||||||||||||||||||||||
| 4101 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4102 |         return never executed:   true;return true;never executed:  return true; | 0 | ||||||||||||||||||||||||||||||
| 4103 | } | - | ||||||||||||||||||||||||||||||
| 4104 |     return never executed:   QObject::event(ev);return QObject::event(ev);never executed:  return QObject::event(ev); | 0 | ||||||||||||||||||||||||||||||
| 4105 | } | - | ||||||||||||||||||||||||||||||
| 4106 | - | |||||||||||||||||||||||||||||||
| 4107 | - | |||||||||||||||||||||||||||||||
| 4108 | - | |||||||||||||||||||||||||||||||
| 4109 | - | |||||||||||||||||||||||||||||||
| 4110 | - | |||||||||||||||||||||||||||||||
| 4111 | - | |||||||||||||||||||||||||||||||
| 4112 | - | |||||||||||||||||||||||||||||||
| 4113 | void QGraphicsObject::grabGesture(Qt::GestureType gesture, Qt::GestureFlags flags) | - | ||||||||||||||||||||||||||||||
| 4114 | { | - | ||||||||||||||||||||||||||||||
| 4115 | bool contains = QGraphicsItem::d_ptr->gestureContext.contains(gesture); | - | ||||||||||||||||||||||||||||||
| 4116 | QGraphicsItem::d_ptr->gestureContext.insert(gesture, flags); | - | ||||||||||||||||||||||||||||||
| 4117 |     if (!contains
 
  | 0 | ||||||||||||||||||||||||||||||
| 4118 |         QGraphicsItem::d_ptr->scene->d_func()->grabGesture(this, gesture); never executed:  QGraphicsItem::d_ptr->scene->d_func()->grabGesture(this, gesture); | 0 | ||||||||||||||||||||||||||||||
| 4119 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4120 | - | |||||||||||||||||||||||||||||||
| 4121 | - | |||||||||||||||||||||||||||||||
| 4122 | - | |||||||||||||||||||||||||||||||
| 4123 | - | |||||||||||||||||||||||||||||||
| 4124 | - | |||||||||||||||||||||||||||||||
| 4125 | - | |||||||||||||||||||||||||||||||
| 4126 | void QGraphicsObject::ungrabGesture(Qt::GestureType gesture) | - | ||||||||||||||||||||||||||||||
| 4127 | { | - | ||||||||||||||||||||||||||||||
| 4128 |     if (QGraphicsItem::d_ptr->gestureContext.remove(gesture)
 
  | 0 | ||||||||||||||||||||||||||||||
| 4129 |         QGraphicsItem::d_ptr->scene->d_func()->ungrabGesture(this, gesture); never executed:  QGraphicsItem::d_ptr->scene->d_func()->ungrabGesture(this, gesture); | 0 | ||||||||||||||||||||||||||||||
| 4130 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4131 | void QGraphicsObject::updateMicroFocus() | - | ||||||||||||||||||||||||||||||
| 4132 | { | - | ||||||||||||||||||||||||||||||
| 4133 | QGraphicsItem::updateMicroFocus(); | - | ||||||||||||||||||||||||||||||
| 4134 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4135 | - | |||||||||||||||||||||||||||||||
| 4136 | void QGraphicsItemPrivate::children_append(QDeclarativeListProperty<QGraphicsObject> *list, QGraphicsObject *item) | - | ||||||||||||||||||||||||||||||
| 4137 | { | - | ||||||||||||||||||||||||||||||
| 4138 |     if (item
  | 0 | ||||||||||||||||||||||||||||||
| 4139 | QGraphicsObject *graphicsObject = static_cast<QGraphicsObject *>(list->object); | - | ||||||||||||||||||||||||||||||
| 4140 |         if (QGraphicsItemPrivate::get(graphicsObject)->sendParentChangeNotification
  | 0 | ||||||||||||||||||||||||||||||
| 4141 | item->setParentItem(graphicsObject); | - | ||||||||||||||||||||||||||||||
| 4142 |         } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||
| 4143 | QGraphicsItemPrivate::get(item)->setParentItemHelper(graphicsObject, 0, 0); | - | ||||||||||||||||||||||||||||||
| 4144 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4145 | } | - | ||||||||||||||||||||||||||||||
| 4146 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4147 | - | |||||||||||||||||||||||||||||||
| 4148 | int QGraphicsItemPrivate::children_count(QDeclarativeListProperty<QGraphicsObject> *list) | - | ||||||||||||||||||||||||||||||
| 4149 | { | - | ||||||||||||||||||||||||||||||
| 4150 | QGraphicsItemPrivate *d = QGraphicsItemPrivate::get(static_cast<QGraphicsObject *>(list->object)); | - | ||||||||||||||||||||||||||||||
| 4151 |     return never executed:   d->children.count();return d->children.count();never executed:  return d->children.count(); | 0 | ||||||||||||||||||||||||||||||
| 4152 | } | - | ||||||||||||||||||||||||||||||
| 4153 | - | |||||||||||||||||||||||||||||||
| 4154 | QGraphicsObject *QGraphicsItemPrivate::children_at(QDeclarativeListProperty<QGraphicsObject> *list, int index) | - | ||||||||||||||||||||||||||||||
| 4155 | { | - | ||||||||||||||||||||||||||||||
| 4156 | QGraphicsItemPrivate *d = QGraphicsItemPrivate::get(static_cast<QGraphicsObject *>(list->object)); | - | ||||||||||||||||||||||||||||||
| 4157 |     if (index >= 0
 
  | 0 | ||||||||||||||||||||||||||||||
| 4158 |         return never executed:   d->children.at(index)->toGraphicsObject();return d->children.at(index)->toGraphicsObject();never executed:  return d->children.at(index)->toGraphicsObject(); | 0 | ||||||||||||||||||||||||||||||
| 4159 | else | - | ||||||||||||||||||||||||||||||
| 4160 |         return never executed:   0;return 0;never executed:  return 0; | 0 | ||||||||||||||||||||||||||||||
| 4161 | } | - | ||||||||||||||||||||||||||||||
| 4162 | - | |||||||||||||||||||||||||||||||
| 4163 | void QGraphicsItemPrivate::children_clear(QDeclarativeListProperty<QGraphicsObject> *list) | - | ||||||||||||||||||||||||||||||
| 4164 | { | - | ||||||||||||||||||||||||||||||
| 4165 | QGraphicsItemPrivate *d = QGraphicsItemPrivate::get(static_cast<QGraphicsObject *>(list->object)); | - | ||||||||||||||||||||||||||||||
| 4166 | int childCount = d->children.count(); | - | ||||||||||||||||||||||||||||||
| 4167 |     if (d->sendParentChangeNotification
  | 0 | ||||||||||||||||||||||||||||||
| 4168 |         for (int index = 0; index < childCount
  | 0 | ||||||||||||||||||||||||||||||
| 4169 |             d->children.at(0)->setParentItem(0); never executed:  d->children.at(0)->setParentItem(0); | 0 | ||||||||||||||||||||||||||||||
| 4170 |     } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||
| 4171 |         for (int index = 0; index < childCount
  | 0 | ||||||||||||||||||||||||||||||
| 4172 |             QGraphicsItemPrivate::get(d->children.at(0))->setParentItemHelper(0, 0, 0); never executed:  QGraphicsItemPrivate::get(d->children.at(0))->setParentItemHelper(0, 0, 0); | 0 | ||||||||||||||||||||||||||||||
| 4173 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4174 | } | - | ||||||||||||||||||||||||||||||
| 4175 | QDeclarativeListProperty<QGraphicsObject> QGraphicsItemPrivate::childrenList() | - | ||||||||||||||||||||||||||||||
| 4176 | { | - | ||||||||||||||||||||||||||||||
| 4177 | QGraphicsItem * const q = q_func(); | - | ||||||||||||||||||||||||||||||
| 4178 |     if (isObject
  | 0 | ||||||||||||||||||||||||||||||
| 4179 | QGraphicsObject *that = static_cast<QGraphicsObject *>(q); | - | ||||||||||||||||||||||||||||||
| 4180 |         return never executed:   QDeclarativeListProperty<QGraphicsObject>(that, &children, children_append,return QDeclarativeListProperty<QGraphicsObject>(that, &children, children_append, children_count, children_at, children_clear);never executed:  return QDeclarativeListProperty<QGraphicsObject>(that, &children, children_append, children_count, children_at, children_clear); | 0 | ||||||||||||||||||||||||||||||
| 4181 |                                                          children_count, children_at, children_clear); never executed:  return QDeclarativeListProperty<QGraphicsObject>(that, &children, children_append, children_count, children_at, children_clear); | 0 | ||||||||||||||||||||||||||||||
| 4182 | } else { | - | ||||||||||||||||||||||||||||||
| 4183 | - | |||||||||||||||||||||||||||||||
| 4184 |         return never executed:   QDeclarativeListProperty<QGraphicsObject>();return QDeclarativeListProperty<QGraphicsObject>();never executed:  return QDeclarativeListProperty<QGraphicsObject>(); | 0 | ||||||||||||||||||||||||||||||
| 4185 | } | - | ||||||||||||||||||||||||||||||
| 4186 | } | - | ||||||||||||||||||||||||||||||
| 4187 | - | |||||||||||||||||||||||||||||||
| 4188 | - | |||||||||||||||||||||||||||||||
| 4189 | - | |||||||||||||||||||||||||||||||
| 4190 | - | |||||||||||||||||||||||||||||||
| 4191 | - | |||||||||||||||||||||||||||||||
| 4192 | - | |||||||||||||||||||||||||||||||
| 4193 | qreal QGraphicsItemPrivate::width() const | - | ||||||||||||||||||||||||||||||
| 4194 | { | - | ||||||||||||||||||||||||||||||
| 4195 |     return never executed:   0;return 0;never executed:  return 0; | 0 | ||||||||||||||||||||||||||||||
| 4196 | } | - | ||||||||||||||||||||||||||||||
| 4197 | - | |||||||||||||||||||||||||||||||
| 4198 | - | |||||||||||||||||||||||||||||||
| 4199 | - | |||||||||||||||||||||||||||||||
| 4200 | - | |||||||||||||||||||||||||||||||
| 4201 | - | |||||||||||||||||||||||||||||||
| 4202 | - | |||||||||||||||||||||||||||||||
| 4203 | void QGraphicsItemPrivate::setWidth(qreal w) | - | ||||||||||||||||||||||||||||||
| 4204 | { | - | ||||||||||||||||||||||||||||||
| 4205 | (void)w;; | - | ||||||||||||||||||||||||||||||
| 4206 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4207 | - | |||||||||||||||||||||||||||||||
| 4208 | - | |||||||||||||||||||||||||||||||
| 4209 | - | |||||||||||||||||||||||||||||||
| 4210 | - | |||||||||||||||||||||||||||||||
| 4211 | - | |||||||||||||||||||||||||||||||
| 4212 | - | |||||||||||||||||||||||||||||||
| 4213 | void QGraphicsItemPrivate::resetWidth() | - | ||||||||||||||||||||||||||||||
| 4214 | { | - | ||||||||||||||||||||||||||||||
| 4215 | } | - | ||||||||||||||||||||||||||||||
| 4216 | - | |||||||||||||||||||||||||||||||
| 4217 | - | |||||||||||||||||||||||||||||||
| 4218 | - | |||||||||||||||||||||||||||||||
| 4219 | - | |||||||||||||||||||||||||||||||
| 4220 | - | |||||||||||||||||||||||||||||||
| 4221 | - | |||||||||||||||||||||||||||||||
| 4222 | qreal QGraphicsItemPrivate::height() const | - | ||||||||||||||||||||||||||||||
| 4223 | { | - | ||||||||||||||||||||||||||||||
| 4224 |     return never executed:   0;return 0;never executed:  return 0; | 0 | ||||||||||||||||||||||||||||||
| 4225 | } | - | ||||||||||||||||||||||||||||||
| 4226 | - | |||||||||||||||||||||||||||||||
| 4227 | - | |||||||||||||||||||||||||||||||
| 4228 | - | |||||||||||||||||||||||||||||||
| 4229 | - | |||||||||||||||||||||||||||||||
| 4230 | - | |||||||||||||||||||||||||||||||
| 4231 | - | |||||||||||||||||||||||||||||||
| 4232 | void QGraphicsItemPrivate::setHeight(qreal h) | - | ||||||||||||||||||||||||||||||
| 4233 | { | - | ||||||||||||||||||||||||||||||
| 4234 | (void)h;; | - | ||||||||||||||||||||||||||||||
| 4235 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4236 | - | |||||||||||||||||||||||||||||||
| 4237 | - | |||||||||||||||||||||||||||||||
| 4238 | - | |||||||||||||||||||||||||||||||
| 4239 | - | |||||||||||||||||||||||||||||||
| 4240 | - | |||||||||||||||||||||||||||||||
| 4241 | - | |||||||||||||||||||||||||||||||
| 4242 | void QGraphicsItemPrivate::resetHeight() | - | ||||||||||||||||||||||||||||||
| 4243 | { | - | ||||||||||||||||||||||||||||||
| 4244 | } | - | ||||||||||||||||||||||||||||||
| 4245 | class QAbstractGraphicsShapeItemPrivate : public QGraphicsItemPrivate | - | ||||||||||||||||||||||||||||||
| 4246 | { | - | ||||||||||||||||||||||||||||||
| 4247 | 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; | - | ||||||||||||||||||||||||||||||
| 4248 | public: | - | ||||||||||||||||||||||||||||||
| 4249 | - | |||||||||||||||||||||||||||||||
| 4250 | QBrush brush; | - | ||||||||||||||||||||||||||||||
| 4251 | QPen pen; | - | ||||||||||||||||||||||||||||||
| 4252 | - | |||||||||||||||||||||||||||||||
| 4253 | - | |||||||||||||||||||||||||||||||
| 4254 | mutable QRectF boundingRect; | - | ||||||||||||||||||||||||||||||
| 4255 | }; | - | ||||||||||||||||||||||||||||||
| 4256 | - | |||||||||||||||||||||||||||||||
| 4257 | - | |||||||||||||||||||||||||||||||
| 4258 | - | |||||||||||||||||||||||||||||||
| 4259 | - | |||||||||||||||||||||||||||||||
| 4260 | - | |||||||||||||||||||||||||||||||
| 4261 | QAbstractGraphicsShapeItem::QAbstractGraphicsShapeItem(QGraphicsItem *parent) | - | ||||||||||||||||||||||||||||||
| 4262 | : QGraphicsItem(*new QAbstractGraphicsShapeItemPrivate, parent) | - | ||||||||||||||||||||||||||||||
| 4263 | { | - | ||||||||||||||||||||||||||||||
| 4264 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4265 | - | |||||||||||||||||||||||||||||||
| 4266 | - | |||||||||||||||||||||||||||||||
| 4267 | - | |||||||||||||||||||||||||||||||
| 4268 | - | |||||||||||||||||||||||||||||||
| 4269 | QAbstractGraphicsShapeItem::QAbstractGraphicsShapeItem(QAbstractGraphicsShapeItemPrivate &dd, QGraphicsItem *parent) | - | ||||||||||||||||||||||||||||||
| 4270 | : QGraphicsItem(dd, parent) | - | ||||||||||||||||||||||||||||||
| 4271 | { | - | ||||||||||||||||||||||||||||||
| 4272 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4273 | - | |||||||||||||||||||||||||||||||
| 4274 | - | |||||||||||||||||||||||||||||||
| 4275 | - | |||||||||||||||||||||||||||||||
| 4276 | - | |||||||||||||||||||||||||||||||
| 4277 | QAbstractGraphicsShapeItem::~QAbstractGraphicsShapeItem() | - | ||||||||||||||||||||||||||||||
| 4278 | { | - | ||||||||||||||||||||||||||||||
| 4279 | } | - | ||||||||||||||||||||||||||||||
| 4280 | - | |||||||||||||||||||||||||||||||
| 4281 | - | |||||||||||||||||||||||||||||||
| 4282 | - | |||||||||||||||||||||||||||||||
| 4283 | - | |||||||||||||||||||||||||||||||
| 4284 | - | |||||||||||||||||||||||||||||||
| 4285 | QPen QAbstractGraphicsShapeItem::pen() const | - | ||||||||||||||||||||||||||||||
| 4286 | { | - | ||||||||||||||||||||||||||||||
| 4287 | const QAbstractGraphicsShapeItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 4288 |     return never executed:   d->pen;return d->pen;never executed:  return d->pen; | 0 | ||||||||||||||||||||||||||||||
| 4289 | } | - | ||||||||||||||||||||||||||||||
| 4290 | void QAbstractGraphicsShapeItem::setPen(const QPen &pen) | - | ||||||||||||||||||||||||||||||
| 4291 | { | - | ||||||||||||||||||||||||||||||
| 4292 | QAbstractGraphicsShapeItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 4293 |     if (d->pen == pen
  | 0 | ||||||||||||||||||||||||||||||
| 4294 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 4295 | prepareGeometryChange(); | - | ||||||||||||||||||||||||||||||
| 4296 | d->pen = pen; | - | ||||||||||||||||||||||||||||||
| 4297 | d->boundingRect = QRectF(); | - | ||||||||||||||||||||||||||||||
| 4298 | update(); | - | ||||||||||||||||||||||||||||||
| 4299 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4300 | - | |||||||||||||||||||||||||||||||
| 4301 | - | |||||||||||||||||||||||||||||||
| 4302 | - | |||||||||||||||||||||||||||||||
| 4303 | - | |||||||||||||||||||||||||||||||
| 4304 | - | |||||||||||||||||||||||||||||||
| 4305 | - | |||||||||||||||||||||||||||||||
| 4306 | QBrush QAbstractGraphicsShapeItem::brush() const | - | ||||||||||||||||||||||||||||||
| 4307 | { | - | ||||||||||||||||||||||||||||||
| 4308 | const QAbstractGraphicsShapeItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 4309 |     return never executed:   d->brush;return d->brush;never executed:  return d->brush; | 0 | ||||||||||||||||||||||||||||||
| 4310 | } | - | ||||||||||||||||||||||||||||||
| 4311 | void QAbstractGraphicsShapeItem::setBrush(const QBrush &brush) | - | ||||||||||||||||||||||||||||||
| 4312 | { | - | ||||||||||||||||||||||||||||||
| 4313 | QAbstractGraphicsShapeItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 4314 |     if (d->brush == brush
  | 0 | ||||||||||||||||||||||||||||||
| 4315 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 4316 | d->brush = brush; | - | ||||||||||||||||||||||||||||||
| 4317 | update(); | - | ||||||||||||||||||||||||||||||
| 4318 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4319 | - | |||||||||||||||||||||||||||||||
| 4320 | - | |||||||||||||||||||||||||||||||
| 4321 | - | |||||||||||||||||||||||||||||||
| 4322 | - | |||||||||||||||||||||||||||||||
| 4323 | bool QAbstractGraphicsShapeItem::isObscuredBy(const QGraphicsItem *item) const | - | ||||||||||||||||||||||||||||||
| 4324 | { | - | ||||||||||||||||||||||||||||||
| 4325 |     return never executed:   QGraphicsItem::isObscuredBy(item);return QGraphicsItem::isObscuredBy(item);never executed:  return QGraphicsItem::isObscuredBy(item); | 0 | ||||||||||||||||||||||||||||||
| 4326 | } | - | ||||||||||||||||||||||||||||||
| 4327 | - | |||||||||||||||||||||||||||||||
| 4328 | - | |||||||||||||||||||||||||||||||
| 4329 | - | |||||||||||||||||||||||||||||||
| 4330 | - | |||||||||||||||||||||||||||||||
| 4331 | QPainterPath QAbstractGraphicsShapeItem::opaqueArea() const | - | ||||||||||||||||||||||||||||||
| 4332 | { | - | ||||||||||||||||||||||||||||||
| 4333 | const QAbstractGraphicsShapeItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 4334 |     if (d->brush.isOpaque()
  | 0 | ||||||||||||||||||||||||||||||
| 4335 |         return never executed:   isClipped()return isClipped() ? clipPath() : shape();
 never executed:  return isClipped() ? clipPath() : shape(); | 0 | ||||||||||||||||||||||||||||||
| 4336 |     return never executed:   QGraphicsItem::opaqueArea();return QGraphicsItem::opaqueArea();never executed:  return QGraphicsItem::opaqueArea(); | 0 | ||||||||||||||||||||||||||||||
| 4337 | } | - | ||||||||||||||||||||||||||||||
| 4338 | class QGraphicsPathItemPrivate : public QAbstractGraphicsShapeItemPrivate | - | ||||||||||||||||||||||||||||||
| 4339 | { | - | ||||||||||||||||||||||||||||||
| 4340 | 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; | - | ||||||||||||||||||||||||||||||
| 4341 | public: | - | ||||||||||||||||||||||||||||||
| 4342 | QPainterPath path; | - | ||||||||||||||||||||||||||||||
| 4343 | }; | - | ||||||||||||||||||||||||||||||
| 4344 | - | |||||||||||||||||||||||||||||||
| 4345 | - | |||||||||||||||||||||||||||||||
| 4346 | - | |||||||||||||||||||||||||||||||
| 4347 | - | |||||||||||||||||||||||||||||||
| 4348 | - | |||||||||||||||||||||||||||||||
| 4349 | - | |||||||||||||||||||||||||||||||
| 4350 | - | |||||||||||||||||||||||||||||||
| 4351 | QGraphicsPathItem::QGraphicsPathItem(const QPainterPath &path, | - | ||||||||||||||||||||||||||||||
| 4352 | QGraphicsItem *parent) | - | ||||||||||||||||||||||||||||||
| 4353 | : QAbstractGraphicsShapeItem(*new QGraphicsPathItemPrivate, parent) | - | ||||||||||||||||||||||||||||||
| 4354 | { | - | ||||||||||||||||||||||||||||||
| 4355 |     if (!path.isEmpty()
  | 0 | ||||||||||||||||||||||||||||||
| 4356 |         setPath(path); never executed:  setPath(path); | 0 | ||||||||||||||||||||||||||||||
| 4357 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4358 | - | |||||||||||||||||||||||||||||||
| 4359 | - | |||||||||||||||||||||||||||||||
| 4360 | - | |||||||||||||||||||||||||||||||
| 4361 | - | |||||||||||||||||||||||||||||||
| 4362 | - | |||||||||||||||||||||||||||||||
| 4363 | - | |||||||||||||||||||||||||||||||
| 4364 | - | |||||||||||||||||||||||||||||||
| 4365 | QGraphicsPathItem::QGraphicsPathItem(QGraphicsItem *parent) | - | ||||||||||||||||||||||||||||||
| 4366 | : QAbstractGraphicsShapeItem(*new QGraphicsPathItemPrivate, parent) | - | ||||||||||||||||||||||||||||||
| 4367 | { | - | ||||||||||||||||||||||||||||||
| 4368 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4369 | - | |||||||||||||||||||||||||||||||
| 4370 | - | |||||||||||||||||||||||||||||||
| 4371 | - | |||||||||||||||||||||||||||||||
| 4372 | - | |||||||||||||||||||||||||||||||
| 4373 | QGraphicsPathItem::~QGraphicsPathItem() | - | ||||||||||||||||||||||||||||||
| 4374 | { | - | ||||||||||||||||||||||||||||||
| 4375 | } | - | ||||||||||||||||||||||||||||||
| 4376 | - | |||||||||||||||||||||||||||||||
| 4377 | - | |||||||||||||||||||||||||||||||
| 4378 | - | |||||||||||||||||||||||||||||||
| 4379 | - | |||||||||||||||||||||||||||||||
| 4380 | - | |||||||||||||||||||||||||||||||
| 4381 | - | |||||||||||||||||||||||||||||||
| 4382 | - | |||||||||||||||||||||||||||||||
| 4383 | QPainterPath QGraphicsPathItem::path() const | - | ||||||||||||||||||||||||||||||
| 4384 | { | - | ||||||||||||||||||||||||||||||
| 4385 | const QGraphicsPathItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 4386 |     return never executed:   d->path;return d->path;never executed:  return d->path; | 0 | ||||||||||||||||||||||||||||||
| 4387 | } | - | ||||||||||||||||||||||||||||||
| 4388 | - | |||||||||||||||||||||||||||||||
| 4389 | - | |||||||||||||||||||||||||||||||
| 4390 | - | |||||||||||||||||||||||||||||||
| 4391 | - | |||||||||||||||||||||||||||||||
| 4392 | - | |||||||||||||||||||||||||||||||
| 4393 | - | |||||||||||||||||||||||||||||||
| 4394 | void QGraphicsPathItem::setPath(const QPainterPath &path) | - | ||||||||||||||||||||||||||||||
| 4395 | { | - | ||||||||||||||||||||||||||||||
| 4396 | QGraphicsPathItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 4397 |     if (d->path == path
  | 0 | ||||||||||||||||||||||||||||||
| 4398 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 4399 | prepareGeometryChange(); | - | ||||||||||||||||||||||||||||||
| 4400 | d->path = path; | - | ||||||||||||||||||||||||||||||
| 4401 | d->boundingRect = QRectF(); | - | ||||||||||||||||||||||||||||||
| 4402 | update(); | - | ||||||||||||||||||||||||||||||
| 4403 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4404 | - | |||||||||||||||||||||||||||||||
| 4405 | - | |||||||||||||||||||||||||||||||
| 4406 | - | |||||||||||||||||||||||||||||||
| 4407 | - | |||||||||||||||||||||||||||||||
| 4408 | QRectF QGraphicsPathItem::boundingRect() const | - | ||||||||||||||||||||||||||||||
| 4409 | { | - | ||||||||||||||||||||||||||||||
| 4410 | const QGraphicsPathItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 4411 |     if (d->boundingRect.isNull()
  | 0 | ||||||||||||||||||||||||||||||
| 4412 |         qreal pw = pen().style() == Qt::NoPen
  | 0 | ||||||||||||||||||||||||||||||
| 4413 |         if (pw == 0.0
  | 0 | ||||||||||||||||||||||||||||||
| 4414 |             d->boundingRect = d->path.controlPointRect(); never executed:  d->boundingRect = d->path.controlPointRect(); | 0 | ||||||||||||||||||||||||||||||
| 4415 | else { | - | ||||||||||||||||||||||||||||||
| 4416 | d->boundingRect = shape().controlPointRect(); | - | ||||||||||||||||||||||||||||||
| 4417 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4418 | } | - | ||||||||||||||||||||||||||||||
| 4419 |     return never executed:   d->boundingRect;return d->boundingRect;never executed:  return d->boundingRect; | 0 | ||||||||||||||||||||||||||||||
| 4420 | } | - | ||||||||||||||||||||||||||||||
| 4421 | - | |||||||||||||||||||||||||||||||
| 4422 | - | |||||||||||||||||||||||||||||||
| 4423 | - | |||||||||||||||||||||||||||||||
| 4424 | - | |||||||||||||||||||||||||||||||
| 4425 | QPainterPath QGraphicsPathItem::shape() const | - | ||||||||||||||||||||||||||||||
| 4426 | { | - | ||||||||||||||||||||||||||||||
| 4427 | const QGraphicsPathItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 4428 |     return never executed:   qt_graphicsItem_shapeFromPath(d->path, d->pen);return qt_graphicsItem_shapeFromPath(d->path, d->pen);never executed:  return qt_graphicsItem_shapeFromPath(d->path, d->pen); | 0 | ||||||||||||||||||||||||||||||
| 4429 | } | - | ||||||||||||||||||||||||||||||
| 4430 | - | |||||||||||||||||||||||||||||||
| 4431 | - | |||||||||||||||||||||||||||||||
| 4432 | - | |||||||||||||||||||||||||||||||
| 4433 | - | |||||||||||||||||||||||||||||||
| 4434 | bool QGraphicsPathItem::contains(const QPointF &point) const | - | ||||||||||||||||||||||||||||||
| 4435 | { | - | ||||||||||||||||||||||||||||||
| 4436 |     return never executed:   QAbstractGraphicsShapeItem::contains(point);return QAbstractGraphicsShapeItem::contains(point);never executed:  return QAbstractGraphicsShapeItem::contains(point); | 0 | ||||||||||||||||||||||||||||||
| 4437 | } | - | ||||||||||||||||||||||||||||||
| 4438 | - | |||||||||||||||||||||||||||||||
| 4439 | - | |||||||||||||||||||||||||||||||
| 4440 | - | |||||||||||||||||||||||||||||||
| 4441 | - | |||||||||||||||||||||||||||||||
| 4442 | void QGraphicsPathItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, | - | ||||||||||||||||||||||||||||||
| 4443 | QWidget *widget) | - | ||||||||||||||||||||||||||||||
| 4444 | { | - | ||||||||||||||||||||||||||||||
| 4445 | QGraphicsPathItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 4446 | (void)widget;; | - | ||||||||||||||||||||||||||||||
| 4447 | painter->setPen(d->pen); | - | ||||||||||||||||||||||||||||||
| 4448 | painter->setBrush(d->brush); | - | ||||||||||||||||||||||||||||||
| 4449 | painter->drawPath(d->path); | - | ||||||||||||||||||||||||||||||
| 4450 | - | |||||||||||||||||||||||||||||||
| 4451 |     if (option->state & QStyle::State_Selected
  | 0 | ||||||||||||||||||||||||||||||
| 4452 |         qt_graphicsItem_highlightSelected(this, painter, option); never executed:  qt_graphicsItem_highlightSelected(this, painter, option); | 0 | ||||||||||||||||||||||||||||||
| 4453 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4454 | - | |||||||||||||||||||||||||||||||
| 4455 | - | |||||||||||||||||||||||||||||||
| 4456 | - | |||||||||||||||||||||||||||||||
| 4457 | - | |||||||||||||||||||||||||||||||
| 4458 | bool QGraphicsPathItem::isObscuredBy(const QGraphicsItem *item) const | - | ||||||||||||||||||||||||||||||
| 4459 | { | - | ||||||||||||||||||||||||||||||
| 4460 |     return never executed:   QAbstractGraphicsShapeItem::isObscuredBy(item);return QAbstractGraphicsShapeItem::isObscuredBy(item);never executed:  return QAbstractGraphicsShapeItem::isObscuredBy(item); | 0 | ||||||||||||||||||||||||||||||
| 4461 | } | - | ||||||||||||||||||||||||||||||
| 4462 | - | |||||||||||||||||||||||||||||||
| 4463 | - | |||||||||||||||||||||||||||||||
| 4464 | - | |||||||||||||||||||||||||||||||
| 4465 | - | |||||||||||||||||||||||||||||||
| 4466 | QPainterPath QGraphicsPathItem::opaqueArea() const | - | ||||||||||||||||||||||||||||||
| 4467 | { | - | ||||||||||||||||||||||||||||||
| 4468 |     return never executed:   QAbstractGraphicsShapeItem::opaqueArea();return QAbstractGraphicsShapeItem::opaqueArea();never executed:  return QAbstractGraphicsShapeItem::opaqueArea(); | 0 | ||||||||||||||||||||||||||||||
| 4469 | } | - | ||||||||||||||||||||||||||||||
| 4470 | - | |||||||||||||||||||||||||||||||
| 4471 | - | |||||||||||||||||||||||||||||||
| 4472 | - | |||||||||||||||||||||||||||||||
| 4473 | - | |||||||||||||||||||||||||||||||
| 4474 | int QGraphicsPathItem::type() const | - | ||||||||||||||||||||||||||||||
| 4475 | { | - | ||||||||||||||||||||||||||||||
| 4476 |     return never executed:   Type;return Type;never executed:  return Type; | 0 | ||||||||||||||||||||||||||||||
| 4477 | } | - | ||||||||||||||||||||||||||||||
| 4478 | - | |||||||||||||||||||||||||||||||
| 4479 | - | |||||||||||||||||||||||||||||||
| 4480 | - | |||||||||||||||||||||||||||||||
| 4481 | - | |||||||||||||||||||||||||||||||
| 4482 | bool QGraphicsPathItem::supportsExtension(Extension extension) const | - | ||||||||||||||||||||||||||||||
| 4483 | { | - | ||||||||||||||||||||||||||||||
| 4484 | (void)extension;; | - | ||||||||||||||||||||||||||||||
| 4485 |     return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||
| 4486 | } | - | ||||||||||||||||||||||||||||||
| 4487 | - | |||||||||||||||||||||||||||||||
| 4488 | - | |||||||||||||||||||||||||||||||
| 4489 | - | |||||||||||||||||||||||||||||||
| 4490 | - | |||||||||||||||||||||||||||||||
| 4491 | void QGraphicsPathItem::setExtension(Extension extension, const QVariant &variant) | - | ||||||||||||||||||||||||||||||
| 4492 | { | - | ||||||||||||||||||||||||||||||
| 4493 | (void)extension;; | - | ||||||||||||||||||||||||||||||
| 4494 | (void)variant;; | - | ||||||||||||||||||||||||||||||
| 4495 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4496 | - | |||||||||||||||||||||||||||||||
| 4497 | - | |||||||||||||||||||||||||||||||
| 4498 | - | |||||||||||||||||||||||||||||||
| 4499 | - | |||||||||||||||||||||||||||||||
| 4500 | QVariant QGraphicsPathItem::extension(const QVariant &variant) const | - | ||||||||||||||||||||||||||||||
| 4501 | { | - | ||||||||||||||||||||||||||||||
| 4502 | (void)variant;; | - | ||||||||||||||||||||||||||||||
| 4503 |     return never executed:   QVariant();return QVariant();never executed:  return QVariant(); | 0 | ||||||||||||||||||||||||||||||
| 4504 | } | - | ||||||||||||||||||||||||||||||
| 4505 | class QGraphicsRectItemPrivate : public QAbstractGraphicsShapeItemPrivate | - | ||||||||||||||||||||||||||||||
| 4506 | { | - | ||||||||||||||||||||||||||||||
| 4507 | 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; | - | ||||||||||||||||||||||||||||||
| 4508 | public: | - | ||||||||||||||||||||||||||||||
| 4509 | QRectF rect; | - | ||||||||||||||||||||||||||||||
| 4510 | }; | - | ||||||||||||||||||||||||||||||
| 4511 | - | |||||||||||||||||||||||||||||||
| 4512 | - | |||||||||||||||||||||||||||||||
| 4513 | - | |||||||||||||||||||||||||||||||
| 4514 | - | |||||||||||||||||||||||||||||||
| 4515 | - | |||||||||||||||||||||||||||||||
| 4516 | - | |||||||||||||||||||||||||||||||
| 4517 | - | |||||||||||||||||||||||||||||||
| 4518 | QGraphicsRectItem::QGraphicsRectItem(const QRectF &rect, QGraphicsItem *parent) | - | ||||||||||||||||||||||||||||||
| 4519 | : QAbstractGraphicsShapeItem(*new QGraphicsRectItemPrivate, parent) | - | ||||||||||||||||||||||||||||||
| 4520 | { | - | ||||||||||||||||||||||||||||||
| 4521 | setRect(rect); | - | ||||||||||||||||||||||||||||||
| 4522 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4523 | QGraphicsRectItem::QGraphicsRectItem(qreal x, qreal y, qreal w, qreal h, | - | ||||||||||||||||||||||||||||||
| 4524 | QGraphicsItem *parent) | - | ||||||||||||||||||||||||||||||
| 4525 | : QAbstractGraphicsShapeItem(*new QGraphicsRectItemPrivate, parent) | - | ||||||||||||||||||||||||||||||
| 4526 | { | - | ||||||||||||||||||||||||||||||
| 4527 | setRect(QRectF(x, y, w, h)); | - | ||||||||||||||||||||||||||||||
| 4528 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4529 | - | |||||||||||||||||||||||||||||||
| 4530 | - | |||||||||||||||||||||||||||||||
| 4531 | - | |||||||||||||||||||||||||||||||
| 4532 | - | |||||||||||||||||||||||||||||||
| 4533 | - | |||||||||||||||||||||||||||||||
| 4534 | - | |||||||||||||||||||||||||||||||
| 4535 | - | |||||||||||||||||||||||||||||||
| 4536 | QGraphicsRectItem::QGraphicsRectItem(QGraphicsItem *parent) | - | ||||||||||||||||||||||||||||||
| 4537 | : QAbstractGraphicsShapeItem(*new QGraphicsRectItemPrivate, parent) | - | ||||||||||||||||||||||||||||||
| 4538 | { | - | ||||||||||||||||||||||||||||||
| 4539 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4540 | - | |||||||||||||||||||||||||||||||
| 4541 | - | |||||||||||||||||||||||||||||||
| 4542 | - | |||||||||||||||||||||||||||||||
| 4543 | - | |||||||||||||||||||||||||||||||
| 4544 | QGraphicsRectItem::~QGraphicsRectItem() | - | ||||||||||||||||||||||||||||||
| 4545 | { | - | ||||||||||||||||||||||||||||||
| 4546 | } | - | ||||||||||||||||||||||||||||||
| 4547 | - | |||||||||||||||||||||||||||||||
| 4548 | - | |||||||||||||||||||||||||||||||
| 4549 | - | |||||||||||||||||||||||||||||||
| 4550 | - | |||||||||||||||||||||||||||||||
| 4551 | - | |||||||||||||||||||||||||||||||
| 4552 | - | |||||||||||||||||||||||||||||||
| 4553 | QRectF QGraphicsRectItem::rect() const | - | ||||||||||||||||||||||||||||||
| 4554 | { | - | ||||||||||||||||||||||||||||||
| 4555 | const QGraphicsRectItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 4556 |     return never executed:   d->rect;return d->rect;never executed:  return d->rect; | 0 | ||||||||||||||||||||||||||||||
| 4557 | } | - | ||||||||||||||||||||||||||||||
| 4558 | void QGraphicsRectItem::setRect(const QRectF &rect) | - | ||||||||||||||||||||||||||||||
| 4559 | { | - | ||||||||||||||||||||||||||||||
| 4560 | QGraphicsRectItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 4561 |     if (d->rect == rect
  | 0 | ||||||||||||||||||||||||||||||
| 4562 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 4563 | prepareGeometryChange(); | - | ||||||||||||||||||||||||||||||
| 4564 | d->rect = rect; | - | ||||||||||||||||||||||||||||||
| 4565 | d->boundingRect = QRectF(); | - | ||||||||||||||||||||||||||||||
| 4566 | update(); | - | ||||||||||||||||||||||||||||||
| 4567 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4568 | QRectF QGraphicsRectItem::boundingRect() const | - | ||||||||||||||||||||||||||||||
| 4569 | { | - | ||||||||||||||||||||||||||||||
| 4570 | const QGraphicsRectItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 4571 |     if (d->boundingRect.isNull()
  | 0 | ||||||||||||||||||||||||||||||
| 4572 |         qreal halfpw = pen().style() == Qt::NoPen
  | 0 | ||||||||||||||||||||||||||||||
| 4573 | d->boundingRect = d->rect; | - | ||||||||||||||||||||||||||||||
| 4574 |         if (halfpw > 0.0
  | 0 | ||||||||||||||||||||||||||||||
| 4575 |             d->boundingRect.adjust(-halfpw, -halfpw, halfpw, halfpw); never executed:  d->boundingRect.adjust(-halfpw, -halfpw, halfpw, halfpw); | 0 | ||||||||||||||||||||||||||||||
| 4576 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4577 |     return never executed:   d->boundingRect;return d->boundingRect;never executed:  return d->boundingRect; | 0 | ||||||||||||||||||||||||||||||
| 4578 | } | - | ||||||||||||||||||||||||||||||
| 4579 | - | |||||||||||||||||||||||||||||||
| 4580 | - | |||||||||||||||||||||||||||||||
| 4581 | - | |||||||||||||||||||||||||||||||
| 4582 | - | |||||||||||||||||||||||||||||||
| 4583 | QPainterPath QGraphicsRectItem::shape() const | - | ||||||||||||||||||||||||||||||
| 4584 | { | - | ||||||||||||||||||||||||||||||
| 4585 | const QGraphicsRectItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 4586 | QPainterPath path; | - | ||||||||||||||||||||||||||||||
| 4587 | path.addRect(d->rect); | - | ||||||||||||||||||||||||||||||
| 4588 |     return never executed:   qt_graphicsItem_shapeFromPath(path, d->pen);return qt_graphicsItem_shapeFromPath(path, d->pen);never executed:  return qt_graphicsItem_shapeFromPath(path, d->pen); | 0 | ||||||||||||||||||||||||||||||
| 4589 | } | - | ||||||||||||||||||||||||||||||
| 4590 | - | |||||||||||||||||||||||||||||||
| 4591 | - | |||||||||||||||||||||||||||||||
| 4592 | - | |||||||||||||||||||||||||||||||
| 4593 | - | |||||||||||||||||||||||||||||||
| 4594 | bool QGraphicsRectItem::contains(const QPointF &point) const | - | ||||||||||||||||||||||||||||||
| 4595 | { | - | ||||||||||||||||||||||||||||||
| 4596 |     return never executed:   QAbstractGraphicsShapeItem::contains(point);return QAbstractGraphicsShapeItem::contains(point);never executed:  return QAbstractGraphicsShapeItem::contains(point); | 0 | ||||||||||||||||||||||||||||||
| 4597 | } | - | ||||||||||||||||||||||||||||||
| 4598 | - | |||||||||||||||||||||||||||||||
| 4599 | - | |||||||||||||||||||||||||||||||
| 4600 | - | |||||||||||||||||||||||||||||||
| 4601 | - | |||||||||||||||||||||||||||||||
| 4602 | void QGraphicsRectItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, | - | ||||||||||||||||||||||||||||||
| 4603 | QWidget *widget) | - | ||||||||||||||||||||||||||||||
| 4604 | { | - | ||||||||||||||||||||||||||||||
| 4605 | QGraphicsRectItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 4606 | (void)widget;; | - | ||||||||||||||||||||||||||||||
| 4607 | painter->setPen(d->pen); | - | ||||||||||||||||||||||||||||||
| 4608 | painter->setBrush(d->brush); | - | ||||||||||||||||||||||||||||||
| 4609 | painter->drawRect(d->rect); | - | ||||||||||||||||||||||||||||||
| 4610 | - | |||||||||||||||||||||||||||||||
| 4611 |     if (option->state & QStyle::State_Selected
  | 0 | ||||||||||||||||||||||||||||||
| 4612 |         qt_graphicsItem_highlightSelected(this, painter, option); never executed:  qt_graphicsItem_highlightSelected(this, painter, option); | 0 | ||||||||||||||||||||||||||||||
| 4613 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4614 | - | |||||||||||||||||||||||||||||||
| 4615 | - | |||||||||||||||||||||||||||||||
| 4616 | - | |||||||||||||||||||||||||||||||
| 4617 | - | |||||||||||||||||||||||||||||||
| 4618 | bool QGraphicsRectItem::isObscuredBy(const QGraphicsItem *item) const | - | ||||||||||||||||||||||||||||||
| 4619 | { | - | ||||||||||||||||||||||||||||||
| 4620 |     return never executed:   QAbstractGraphicsShapeItem::isObscuredBy(item);return QAbstractGraphicsShapeItem::isObscuredBy(item);never executed:  return QAbstractGraphicsShapeItem::isObscuredBy(item); | 0 | ||||||||||||||||||||||||||||||
| 4621 | } | - | ||||||||||||||||||||||||||||||
| 4622 | - | |||||||||||||||||||||||||||||||
| 4623 | - | |||||||||||||||||||||||||||||||
| 4624 | - | |||||||||||||||||||||||||||||||
| 4625 | - | |||||||||||||||||||||||||||||||
| 4626 | QPainterPath QGraphicsRectItem::opaqueArea() const | - | ||||||||||||||||||||||||||||||
| 4627 | { | - | ||||||||||||||||||||||||||||||
| 4628 |     return never executed:   QAbstractGraphicsShapeItem::opaqueArea();return QAbstractGraphicsShapeItem::opaqueArea();never executed:  return QAbstractGraphicsShapeItem::opaqueArea(); | 0 | ||||||||||||||||||||||||||||||
| 4629 | } | - | ||||||||||||||||||||||||||||||
| 4630 | - | |||||||||||||||||||||||||||||||
| 4631 | - | |||||||||||||||||||||||||||||||
| 4632 | - | |||||||||||||||||||||||||||||||
| 4633 | - | |||||||||||||||||||||||||||||||
| 4634 | int QGraphicsRectItem::type() const | - | ||||||||||||||||||||||||||||||
| 4635 | { | - | ||||||||||||||||||||||||||||||
| 4636 |     return never executed:   Type;return Type;never executed:  return Type; | 0 | ||||||||||||||||||||||||||||||
| 4637 | } | - | ||||||||||||||||||||||||||||||
| 4638 | - | |||||||||||||||||||||||||||||||
| 4639 | - | |||||||||||||||||||||||||||||||
| 4640 | - | |||||||||||||||||||||||||||||||
| 4641 | - | |||||||||||||||||||||||||||||||
| 4642 | bool QGraphicsRectItem::supportsExtension(Extension extension) const | - | ||||||||||||||||||||||||||||||
| 4643 | { | - | ||||||||||||||||||||||||||||||
| 4644 | (void)extension;; | - | ||||||||||||||||||||||||||||||
| 4645 |     return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||
| 4646 | } | - | ||||||||||||||||||||||||||||||
| 4647 | - | |||||||||||||||||||||||||||||||
| 4648 | - | |||||||||||||||||||||||||||||||
| 4649 | - | |||||||||||||||||||||||||||||||
| 4650 | - | |||||||||||||||||||||||||||||||
| 4651 | void QGraphicsRectItem::setExtension(Extension extension, const QVariant &variant) | - | ||||||||||||||||||||||||||||||
| 4652 | { | - | ||||||||||||||||||||||||||||||
| 4653 | (void)extension;; | - | ||||||||||||||||||||||||||||||
| 4654 | (void)variant;; | - | ||||||||||||||||||||||||||||||
| 4655 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4656 | - | |||||||||||||||||||||||||||||||
| 4657 | - | |||||||||||||||||||||||||||||||
| 4658 | - | |||||||||||||||||||||||||||||||
| 4659 | - | |||||||||||||||||||||||||||||||
| 4660 | QVariant QGraphicsRectItem::extension(const QVariant &variant) const | - | ||||||||||||||||||||||||||||||
| 4661 | { | - | ||||||||||||||||||||||||||||||
| 4662 | (void)variant;; | - | ||||||||||||||||||||||||||||||
| 4663 |     return never executed:   QVariant();return QVariant();never executed:  return QVariant(); | 0 | ||||||||||||||||||||||||||||||
| 4664 | } | - | ||||||||||||||||||||||||||||||
| 4665 | class QGraphicsEllipseItemPrivate : public QAbstractGraphicsShapeItemPrivate | - | ||||||||||||||||||||||||||||||
| 4666 | { | - | ||||||||||||||||||||||||||||||
| 4667 | 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; | - | ||||||||||||||||||||||||||||||
| 4668 | public: | - | ||||||||||||||||||||||||||||||
| 4669 | inline QGraphicsEllipseItemPrivate() | - | ||||||||||||||||||||||||||||||
| 4670 | : startAngle(0), spanAngle(360 * 16) | - | ||||||||||||||||||||||||||||||
| 4671 |     { } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4672 | - | |||||||||||||||||||||||||||||||
| 4673 | QRectF rect; | - | ||||||||||||||||||||||||||||||
| 4674 | int startAngle; | - | ||||||||||||||||||||||||||||||
| 4675 | int spanAngle; | - | ||||||||||||||||||||||||||||||
| 4676 | }; | - | ||||||||||||||||||||||||||||||
| 4677 | - | |||||||||||||||||||||||||||||||
| 4678 | - | |||||||||||||||||||||||||||||||
| 4679 | - | |||||||||||||||||||||||||||||||
| 4680 | - | |||||||||||||||||||||||||||||||
| 4681 | - | |||||||||||||||||||||||||||||||
| 4682 | - | |||||||||||||||||||||||||||||||
| 4683 | - | |||||||||||||||||||||||||||||||
| 4684 | QGraphicsEllipseItem::QGraphicsEllipseItem(const QRectF &rect, QGraphicsItem *parent) | - | ||||||||||||||||||||||||||||||
| 4685 | : QAbstractGraphicsShapeItem(*new QGraphicsEllipseItemPrivate, parent) | - | ||||||||||||||||||||||||||||||
| 4686 | { | - | ||||||||||||||||||||||||||||||
| 4687 | setRect(rect); | - | ||||||||||||||||||||||||||||||
| 4688 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4689 | QGraphicsEllipseItem::QGraphicsEllipseItem(qreal x, qreal y, qreal w, qreal h, | - | ||||||||||||||||||||||||||||||
| 4690 | QGraphicsItem *parent) | - | ||||||||||||||||||||||||||||||
| 4691 | : QAbstractGraphicsShapeItem(*new QGraphicsEllipseItemPrivate, parent) | - | ||||||||||||||||||||||||||||||
| 4692 | { | - | ||||||||||||||||||||||||||||||
| 4693 | setRect(x,y,w,h); | - | ||||||||||||||||||||||||||||||
| 4694 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4695 | QGraphicsEllipseItem::QGraphicsEllipseItem(QGraphicsItem *parent) | - | ||||||||||||||||||||||||||||||
| 4696 | : QAbstractGraphicsShapeItem(*new QGraphicsEllipseItemPrivate, parent) | - | ||||||||||||||||||||||||||||||
| 4697 | { | - | ||||||||||||||||||||||||||||||
| 4698 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4699 | - | |||||||||||||||||||||||||||||||
| 4700 | - | |||||||||||||||||||||||||||||||
| 4701 | - | |||||||||||||||||||||||||||||||
| 4702 | - | |||||||||||||||||||||||||||||||
| 4703 | QGraphicsEllipseItem::~QGraphicsEllipseItem() | - | ||||||||||||||||||||||||||||||
| 4704 | { | - | ||||||||||||||||||||||||||||||
| 4705 | } | - | ||||||||||||||||||||||||||||||
| 4706 | - | |||||||||||||||||||||||||||||||
| 4707 | - | |||||||||||||||||||||||||||||||
| 4708 | - | |||||||||||||||||||||||||||||||
| 4709 | - | |||||||||||||||||||||||||||||||
| 4710 | - | |||||||||||||||||||||||||||||||
| 4711 | - | |||||||||||||||||||||||||||||||
| 4712 | QRectF QGraphicsEllipseItem::rect() const | - | ||||||||||||||||||||||||||||||
| 4713 | { | - | ||||||||||||||||||||||||||||||
| 4714 | const QGraphicsEllipseItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 4715 |     return never executed:   d->rect;return d->rect;never executed:  return d->rect; | 0 | ||||||||||||||||||||||||||||||
| 4716 | } | - | ||||||||||||||||||||||||||||||
| 4717 | void QGraphicsEllipseItem::setRect(const QRectF &rect) | - | ||||||||||||||||||||||||||||||
| 4718 | { | - | ||||||||||||||||||||||||||||||
| 4719 | QGraphicsEllipseItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 4720 |     if (d->rect == rect
  | 0 | ||||||||||||||||||||||||||||||
| 4721 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 4722 | prepareGeometryChange(); | - | ||||||||||||||||||||||||||||||
| 4723 | d->rect = rect; | - | ||||||||||||||||||||||||||||||
| 4724 | d->boundingRect = QRectF(); | - | ||||||||||||||||||||||||||||||
| 4725 | update(); | - | ||||||||||||||||||||||||||||||
| 4726 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4727 | int QGraphicsEllipseItem::startAngle() const | - | ||||||||||||||||||||||||||||||
| 4728 | { | - | ||||||||||||||||||||||||||||||
| 4729 | const QGraphicsEllipseItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 4730 |     return never executed:   d->startAngle;return d->startAngle;never executed:  return d->startAngle; | 0 | ||||||||||||||||||||||||||||||
| 4731 | } | - | ||||||||||||||||||||||||||||||
| 4732 | void QGraphicsEllipseItem::setStartAngle(int angle) | - | ||||||||||||||||||||||||||||||
| 4733 | { | - | ||||||||||||||||||||||||||||||
| 4734 | QGraphicsEllipseItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 4735 |     if (angle != d->startAngle
  | 0 | ||||||||||||||||||||||||||||||
| 4736 | prepareGeometryChange(); | - | ||||||||||||||||||||||||||||||
| 4737 | d->boundingRect = QRectF(); | - | ||||||||||||||||||||||||||||||
| 4738 | d->startAngle = angle; | - | ||||||||||||||||||||||||||||||
| 4739 | update(); | - | ||||||||||||||||||||||||||||||
| 4740 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4741 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4742 | int QGraphicsEllipseItem::spanAngle() const | - | ||||||||||||||||||||||||||||||
| 4743 | { | - | ||||||||||||||||||||||||||||||
| 4744 | const QGraphicsEllipseItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 4745 |     return never executed:   d->spanAngle;return d->spanAngle;never executed:  return d->spanAngle; | 0 | ||||||||||||||||||||||||||||||
| 4746 | } | - | ||||||||||||||||||||||||||||||
| 4747 | void QGraphicsEllipseItem::setSpanAngle(int angle) | - | ||||||||||||||||||||||||||||||
| 4748 | { | - | ||||||||||||||||||||||||||||||
| 4749 | QGraphicsEllipseItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 4750 |     if (angle != d->spanAngle
  | 0 | ||||||||||||||||||||||||||||||
| 4751 | prepareGeometryChange(); | - | ||||||||||||||||||||||||||||||
| 4752 | d->boundingRect = QRectF(); | - | ||||||||||||||||||||||||||||||
| 4753 | d->spanAngle = angle; | - | ||||||||||||||||||||||||||||||
| 4754 | update(); | - | ||||||||||||||||||||||||||||||
| 4755 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4756 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4757 | - | |||||||||||||||||||||||||||||||
| 4758 | - | |||||||||||||||||||||||||||||||
| 4759 | - | |||||||||||||||||||||||||||||||
| 4760 | - | |||||||||||||||||||||||||||||||
| 4761 | QRectF QGraphicsEllipseItem::boundingRect() const | - | ||||||||||||||||||||||||||||||
| 4762 | { | - | ||||||||||||||||||||||||||||||
| 4763 | const QGraphicsEllipseItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 4764 |     if (d->boundingRect.isNull()
  | 0 | ||||||||||||||||||||||||||||||
| 4765 |         qreal pw = pen().style() == Qt::NoPen
  | 0 | ||||||||||||||||||||||||||||||
| 4766 |         if (pw == 0.0
 
  | 0 | ||||||||||||||||||||||||||||||
| 4767 |             d->boundingRect = d->rect; never executed:  d->boundingRect = d->rect; | 0 | ||||||||||||||||||||||||||||||
| 4768 | else | - | ||||||||||||||||||||||||||||||
| 4769 |             d->boundingRect = shape().controlPointRect(); never executed:  d->boundingRect = shape().controlPointRect(); | 0 | ||||||||||||||||||||||||||||||
| 4770 | } | - | ||||||||||||||||||||||||||||||
| 4771 |     return never executed:   d->boundingRect;return d->boundingRect;never executed:  return d->boundingRect; | 0 | ||||||||||||||||||||||||||||||
| 4772 | } | - | ||||||||||||||||||||||||||||||
| 4773 | - | |||||||||||||||||||||||||||||||
| 4774 | - | |||||||||||||||||||||||||||||||
| 4775 | - | |||||||||||||||||||||||||||||||
| 4776 | - | |||||||||||||||||||||||||||||||
| 4777 | QPainterPath QGraphicsEllipseItem::shape() const | - | ||||||||||||||||||||||||||||||
| 4778 | { | - | ||||||||||||||||||||||||||||||
| 4779 | const QGraphicsEllipseItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 4780 | QPainterPath path; | - | ||||||||||||||||||||||||||||||
| 4781 |     if (d->rect.isNull()
  | 0 | ||||||||||||||||||||||||||||||
| 4782 |         return never executed:   path;return path;never executed:  return path; | 0 | ||||||||||||||||||||||||||||||
| 4783 |     if (d->spanAngle != 360 * 16
  | 0 | ||||||||||||||||||||||||||||||
| 4784 | path.moveTo(d->rect.center()); | - | ||||||||||||||||||||||||||||||
| 4785 | path.arcTo(d->rect, d->startAngle / 16.0, d->spanAngle / 16.0); | - | ||||||||||||||||||||||||||||||
| 4786 |     } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||
| 4787 | path.addEllipse(d->rect); | - | ||||||||||||||||||||||||||||||
| 4788 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4789 | - | |||||||||||||||||||||||||||||||
| 4790 |     return never executed:   qt_graphicsItem_shapeFromPath(path, d->pen);return qt_graphicsItem_shapeFromPath(path, d->pen);never executed:  return qt_graphicsItem_shapeFromPath(path, d->pen); | 0 | ||||||||||||||||||||||||||||||
| 4791 | } | - | ||||||||||||||||||||||||||||||
| 4792 | - | |||||||||||||||||||||||||||||||
| 4793 | - | |||||||||||||||||||||||||||||||
| 4794 | - | |||||||||||||||||||||||||||||||
| 4795 | - | |||||||||||||||||||||||||||||||
| 4796 | bool QGraphicsEllipseItem::contains(const QPointF &point) const | - | ||||||||||||||||||||||||||||||
| 4797 | { | - | ||||||||||||||||||||||||||||||
| 4798 |     return never executed:   QAbstractGraphicsShapeItem::contains(point);return QAbstractGraphicsShapeItem::contains(point);never executed:  return QAbstractGraphicsShapeItem::contains(point); | 0 | ||||||||||||||||||||||||||||||
| 4799 | } | - | ||||||||||||||||||||||||||||||
| 4800 | - | |||||||||||||||||||||||||||||||
| 4801 | - | |||||||||||||||||||||||||||||||
| 4802 | - | |||||||||||||||||||||||||||||||
| 4803 | - | |||||||||||||||||||||||||||||||
| 4804 | void QGraphicsEllipseItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, | - | ||||||||||||||||||||||||||||||
| 4805 | QWidget *widget) | - | ||||||||||||||||||||||||||||||
| 4806 | { | - | ||||||||||||||||||||||||||||||
| 4807 | QGraphicsEllipseItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 4808 | (void)widget;; | - | ||||||||||||||||||||||||||||||
| 4809 | painter->setPen(d->pen); | - | ||||||||||||||||||||||||||||||
| 4810 | painter->setBrush(d->brush); | - | ||||||||||||||||||||||||||||||
| 4811 |     if ((
 
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 4812 |         painter->drawEllipse(d->rect); never executed:  painter->drawEllipse(d->rect); | 0 | ||||||||||||||||||||||||||||||
| 4813 | else | - | ||||||||||||||||||||||||||||||
| 4814 |         painter->drawPie(d->rect, d->startAngle, d->spanAngle); never executed:  painter->drawPie(d->rect, d->startAngle, d->spanAngle); | 0 | ||||||||||||||||||||||||||||||
| 4815 | - | |||||||||||||||||||||||||||||||
| 4816 |     if (option->state & QStyle::State_Selected
  | 0 | ||||||||||||||||||||||||||||||
| 4817 |         qt_graphicsItem_highlightSelected(this, painter, option); never executed:  qt_graphicsItem_highlightSelected(this, painter, option); | 0 | ||||||||||||||||||||||||||||||
| 4818 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4819 | - | |||||||||||||||||||||||||||||||
| 4820 | - | |||||||||||||||||||||||||||||||
| 4821 | - | |||||||||||||||||||||||||||||||
| 4822 | - | |||||||||||||||||||||||||||||||
| 4823 | bool QGraphicsEllipseItem::isObscuredBy(const QGraphicsItem *item) const | - | ||||||||||||||||||||||||||||||
| 4824 | { | - | ||||||||||||||||||||||||||||||
| 4825 |     return never executed:   QAbstractGraphicsShapeItem::isObscuredBy(item);return QAbstractGraphicsShapeItem::isObscuredBy(item);never executed:  return QAbstractGraphicsShapeItem::isObscuredBy(item); | 0 | ||||||||||||||||||||||||||||||
| 4826 | } | - | ||||||||||||||||||||||||||||||
| 4827 | - | |||||||||||||||||||||||||||||||
| 4828 | - | |||||||||||||||||||||||||||||||
| 4829 | - | |||||||||||||||||||||||||||||||
| 4830 | - | |||||||||||||||||||||||||||||||
| 4831 | QPainterPath QGraphicsEllipseItem::opaqueArea() const | - | ||||||||||||||||||||||||||||||
| 4832 | { | - | ||||||||||||||||||||||||||||||
| 4833 |     return never executed:   QAbstractGraphicsShapeItem::opaqueArea();return QAbstractGraphicsShapeItem::opaqueArea();never executed:  return QAbstractGraphicsShapeItem::opaqueArea(); | 0 | ||||||||||||||||||||||||||||||
| 4834 | } | - | ||||||||||||||||||||||||||||||
| 4835 | - | |||||||||||||||||||||||||||||||
| 4836 | - | |||||||||||||||||||||||||||||||
| 4837 | - | |||||||||||||||||||||||||||||||
| 4838 | - | |||||||||||||||||||||||||||||||
| 4839 | int QGraphicsEllipseItem::type() const | - | ||||||||||||||||||||||||||||||
| 4840 | { | - | ||||||||||||||||||||||||||||||
| 4841 |     return never executed:   Type;return Type;never executed:  return Type; | 0 | ||||||||||||||||||||||||||||||
| 4842 | } | - | ||||||||||||||||||||||||||||||
| 4843 | - | |||||||||||||||||||||||||||||||
| 4844 | - | |||||||||||||||||||||||||||||||
| 4845 | - | |||||||||||||||||||||||||||||||
| 4846 | - | |||||||||||||||||||||||||||||||
| 4847 | - | |||||||||||||||||||||||||||||||
| 4848 | bool QGraphicsEllipseItem::supportsExtension(Extension extension) const | - | ||||||||||||||||||||||||||||||
| 4849 | { | - | ||||||||||||||||||||||||||||||
| 4850 | (void)extension;; | - | ||||||||||||||||||||||||||||||
| 4851 |     return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||
| 4852 | } | - | ||||||||||||||||||||||||||||||
| 4853 | - | |||||||||||||||||||||||||||||||
| 4854 | - | |||||||||||||||||||||||||||||||
| 4855 | - | |||||||||||||||||||||||||||||||
| 4856 | - | |||||||||||||||||||||||||||||||
| 4857 | void QGraphicsEllipseItem::setExtension(Extension extension, const QVariant &variant) | - | ||||||||||||||||||||||||||||||
| 4858 | { | - | ||||||||||||||||||||||||||||||
| 4859 | (void)extension;; | - | ||||||||||||||||||||||||||||||
| 4860 | (void)variant;; | - | ||||||||||||||||||||||||||||||
| 4861 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4862 | - | |||||||||||||||||||||||||||||||
| 4863 | - | |||||||||||||||||||||||||||||||
| 4864 | - | |||||||||||||||||||||||||||||||
| 4865 | - | |||||||||||||||||||||||||||||||
| 4866 | QVariant QGraphicsEllipseItem::extension(const QVariant &variant) const | - | ||||||||||||||||||||||||||||||
| 4867 | { | - | ||||||||||||||||||||||||||||||
| 4868 | (void)variant;; | - | ||||||||||||||||||||||||||||||
| 4869 |     return never executed:   QVariant();return QVariant();never executed:  return QVariant(); | 0 | ||||||||||||||||||||||||||||||
| 4870 | } | - | ||||||||||||||||||||||||||||||
| 4871 | class QGraphicsPolygonItemPrivate : public QAbstractGraphicsShapeItemPrivate | - | ||||||||||||||||||||||||||||||
| 4872 | { | - | ||||||||||||||||||||||||||||||
| 4873 | 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; | - | ||||||||||||||||||||||||||||||
| 4874 | public: | - | ||||||||||||||||||||||||||||||
| 4875 | inline QGraphicsPolygonItemPrivate() | - | ||||||||||||||||||||||||||||||
| 4876 | : fillRule(Qt::OddEvenFill) | - | ||||||||||||||||||||||||||||||
| 4877 |     { } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4878 | - | |||||||||||||||||||||||||||||||
| 4879 | QPolygonF polygon; | - | ||||||||||||||||||||||||||||||
| 4880 | Qt::FillRule fillRule; | - | ||||||||||||||||||||||||||||||
| 4881 | }; | - | ||||||||||||||||||||||||||||||
| 4882 | - | |||||||||||||||||||||||||||||||
| 4883 | - | |||||||||||||||||||||||||||||||
| 4884 | - | |||||||||||||||||||||||||||||||
| 4885 | - | |||||||||||||||||||||||||||||||
| 4886 | - | |||||||||||||||||||||||||||||||
| 4887 | - | |||||||||||||||||||||||||||||||
| 4888 | - | |||||||||||||||||||||||||||||||
| 4889 | QGraphicsPolygonItem::QGraphicsPolygonItem(const QPolygonF &polygon, QGraphicsItem *parent) | - | ||||||||||||||||||||||||||||||
| 4890 | : QAbstractGraphicsShapeItem(*new QGraphicsPolygonItemPrivate, parent) | - | ||||||||||||||||||||||||||||||
| 4891 | { | - | ||||||||||||||||||||||||||||||
| 4892 | setPolygon(polygon); | - | ||||||||||||||||||||||||||||||
| 4893 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4894 | - | |||||||||||||||||||||||||||||||
| 4895 | - | |||||||||||||||||||||||||||||||
| 4896 | - | |||||||||||||||||||||||||||||||
| 4897 | - | |||||||||||||||||||||||||||||||
| 4898 | - | |||||||||||||||||||||||||||||||
| 4899 | - | |||||||||||||||||||||||||||||||
| 4900 | - | |||||||||||||||||||||||||||||||
| 4901 | QGraphicsPolygonItem::QGraphicsPolygonItem(QGraphicsItem *parent) | - | ||||||||||||||||||||||||||||||
| 4902 | : QAbstractGraphicsShapeItem(*new QGraphicsPolygonItemPrivate, parent) | - | ||||||||||||||||||||||||||||||
| 4903 | { | - | ||||||||||||||||||||||||||||||
| 4904 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4905 | - | |||||||||||||||||||||||||||||||
| 4906 | - | |||||||||||||||||||||||||||||||
| 4907 | - | |||||||||||||||||||||||||||||||
| 4908 | - | |||||||||||||||||||||||||||||||
| 4909 | QGraphicsPolygonItem::~QGraphicsPolygonItem() | - | ||||||||||||||||||||||||||||||
| 4910 | { | - | ||||||||||||||||||||||||||||||
| 4911 | } | - | ||||||||||||||||||||||||||||||
| 4912 | - | |||||||||||||||||||||||||||||||
| 4913 | - | |||||||||||||||||||||||||||||||
| 4914 | - | |||||||||||||||||||||||||||||||
| 4915 | - | |||||||||||||||||||||||||||||||
| 4916 | - | |||||||||||||||||||||||||||||||
| 4917 | - | |||||||||||||||||||||||||||||||
| 4918 | - | |||||||||||||||||||||||||||||||
| 4919 | QPolygonF QGraphicsPolygonItem::polygon() const | - | ||||||||||||||||||||||||||||||
| 4920 | { | - | ||||||||||||||||||||||||||||||
| 4921 | const QGraphicsPolygonItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 4922 |     return never executed:   d->polygon;return d->polygon;never executed:  return d->polygon; | 0 | ||||||||||||||||||||||||||||||
| 4923 | } | - | ||||||||||||||||||||||||||||||
| 4924 | - | |||||||||||||||||||||||||||||||
| 4925 | - | |||||||||||||||||||||||||||||||
| 4926 | - | |||||||||||||||||||||||||||||||
| 4927 | - | |||||||||||||||||||||||||||||||
| 4928 | - | |||||||||||||||||||||||||||||||
| 4929 | - | |||||||||||||||||||||||||||||||
| 4930 | void QGraphicsPolygonItem::setPolygon(const QPolygonF &polygon) | - | ||||||||||||||||||||||||||||||
| 4931 | { | - | ||||||||||||||||||||||||||||||
| 4932 | QGraphicsPolygonItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 4933 |     if (d->polygon == polygon
  | 0 | ||||||||||||||||||||||||||||||
| 4934 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 4935 | prepareGeometryChange(); | - | ||||||||||||||||||||||||||||||
| 4936 | d->polygon = polygon; | - | ||||||||||||||||||||||||||||||
| 4937 | d->boundingRect = QRectF(); | - | ||||||||||||||||||||||||||||||
| 4938 | update(); | - | ||||||||||||||||||||||||||||||
| 4939 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4940 | - | |||||||||||||||||||||||||||||||
| 4941 | - | |||||||||||||||||||||||||||||||
| 4942 | - | |||||||||||||||||||||||||||||||
| 4943 | - | |||||||||||||||||||||||||||||||
| 4944 | - | |||||||||||||||||||||||||||||||
| 4945 | - | |||||||||||||||||||||||||||||||
| 4946 | - | |||||||||||||||||||||||||||||||
| 4947 | Qt::FillRule QGraphicsPolygonItem::fillRule() const | - | ||||||||||||||||||||||||||||||
| 4948 | { | - | ||||||||||||||||||||||||||||||
| 4949 | const QGraphicsPolygonItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 4950 |      return never executed:   d->fillRule;return d->fillRule;never executed:  return d->fillRule; | 0 | ||||||||||||||||||||||||||||||
| 4951 | } | - | ||||||||||||||||||||||||||||||
| 4952 | - | |||||||||||||||||||||||||||||||
| 4953 | - | |||||||||||||||||||||||||||||||
| 4954 | - | |||||||||||||||||||||||||||||||
| 4955 | - | |||||||||||||||||||||||||||||||
| 4956 | - | |||||||||||||||||||||||||||||||
| 4957 | - | |||||||||||||||||||||||||||||||
| 4958 | - | |||||||||||||||||||||||||||||||
| 4959 | void QGraphicsPolygonItem::setFillRule(Qt::FillRule rule) | - | ||||||||||||||||||||||||||||||
| 4960 | { | - | ||||||||||||||||||||||||||||||
| 4961 | QGraphicsPolygonItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 4962 |      if (rule != d->fillRule
  | 0 | ||||||||||||||||||||||||||||||
| 4963 | d->fillRule = rule; | - | ||||||||||||||||||||||||||||||
| 4964 | update(); | - | ||||||||||||||||||||||||||||||
| 4965 |      } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4966 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 4967 | - | |||||||||||||||||||||||||||||||
| 4968 | - | |||||||||||||||||||||||||||||||
| 4969 | - | |||||||||||||||||||||||||||||||
| 4970 | - | |||||||||||||||||||||||||||||||
| 4971 | QRectF QGraphicsPolygonItem::boundingRect() const | - | ||||||||||||||||||||||||||||||
| 4972 | { | - | ||||||||||||||||||||||||||||||
| 4973 | const QGraphicsPolygonItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 4974 |     if (d->boundingRect.isNull()
  | 0 | ||||||||||||||||||||||||||||||
| 4975 |         qreal pw = pen().style() == Qt::NoPen
  | 0 | ||||||||||||||||||||||||||||||
| 4976 |         if (pw == 0.0
  | 0 | ||||||||||||||||||||||||||||||
| 4977 |             d->boundingRect = d->polygon.boundingRect(); never executed:  d->boundingRect = d->polygon.boundingRect(); | 0 | ||||||||||||||||||||||||||||||
| 4978 | else | - | ||||||||||||||||||||||||||||||
| 4979 |             d->boundingRect = shape().controlPointRect(); never executed:  d->boundingRect = shape().controlPointRect(); | 0 | ||||||||||||||||||||||||||||||
| 4980 | } | - | ||||||||||||||||||||||||||||||
| 4981 |     return never executed:   d->boundingRect;return d->boundingRect;never executed:  return d->boundingRect; | 0 | ||||||||||||||||||||||||||||||
| 4982 | } | - | ||||||||||||||||||||||||||||||
| 4983 | - | |||||||||||||||||||||||||||||||
| 4984 | - | |||||||||||||||||||||||||||||||
| 4985 | - | |||||||||||||||||||||||||||||||
| 4986 | - | |||||||||||||||||||||||||||||||
| 4987 | QPainterPath QGraphicsPolygonItem::shape() const | - | ||||||||||||||||||||||||||||||
| 4988 | { | - | ||||||||||||||||||||||||||||||
| 4989 | const QGraphicsPolygonItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 4990 | QPainterPath path; | - | ||||||||||||||||||||||||||||||
| 4991 | path.addPolygon(d->polygon); | - | ||||||||||||||||||||||||||||||
| 4992 |     return never executed:   qt_graphicsItem_shapeFromPath(path, d->pen);return qt_graphicsItem_shapeFromPath(path, d->pen);never executed:  return qt_graphicsItem_shapeFromPath(path, d->pen); | 0 | ||||||||||||||||||||||||||||||
| 4993 | } | - | ||||||||||||||||||||||||||||||
| 4994 | - | |||||||||||||||||||||||||||||||
| 4995 | - | |||||||||||||||||||||||||||||||
| 4996 | - | |||||||||||||||||||||||||||||||
| 4997 | - | |||||||||||||||||||||||||||||||
| 4998 | bool QGraphicsPolygonItem::contains(const QPointF &point) const | - | ||||||||||||||||||||||||||||||
| 4999 | { | - | ||||||||||||||||||||||||||||||
| 5000 |     return never executed:   QAbstractGraphicsShapeItem::contains(point);return QAbstractGraphicsShapeItem::contains(point);never executed:  return QAbstractGraphicsShapeItem::contains(point); | 0 | ||||||||||||||||||||||||||||||
| 5001 | } | - | ||||||||||||||||||||||||||||||
| 5002 | - | |||||||||||||||||||||||||||||||
| 5003 | - | |||||||||||||||||||||||||||||||
| 5004 | - | |||||||||||||||||||||||||||||||
| 5005 | - | |||||||||||||||||||||||||||||||
| 5006 | void QGraphicsPolygonItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) | - | ||||||||||||||||||||||||||||||
| 5007 | { | - | ||||||||||||||||||||||||||||||
| 5008 | QGraphicsPolygonItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 5009 | (void)widget;; | - | ||||||||||||||||||||||||||||||
| 5010 | painter->setPen(d->pen); | - | ||||||||||||||||||||||||||||||
| 5011 | painter->setBrush(d->brush); | - | ||||||||||||||||||||||||||||||
| 5012 | painter->drawPolygon(d->polygon, d->fillRule); | - | ||||||||||||||||||||||||||||||
| 5013 | - | |||||||||||||||||||||||||||||||
| 5014 |     if (option->state & QStyle::State_Selected
  | 0 | ||||||||||||||||||||||||||||||
| 5015 |         qt_graphicsItem_highlightSelected(this, painter, option); never executed:  qt_graphicsItem_highlightSelected(this, painter, option); | 0 | ||||||||||||||||||||||||||||||
| 5016 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5017 | - | |||||||||||||||||||||||||||||||
| 5018 | - | |||||||||||||||||||||||||||||||
| 5019 | - | |||||||||||||||||||||||||||||||
| 5020 | - | |||||||||||||||||||||||||||||||
| 5021 | bool QGraphicsPolygonItem::isObscuredBy(const QGraphicsItem *item) const | - | ||||||||||||||||||||||||||||||
| 5022 | { | - | ||||||||||||||||||||||||||||||
| 5023 |     return never executed:   QAbstractGraphicsShapeItem::isObscuredBy(item);return QAbstractGraphicsShapeItem::isObscuredBy(item);never executed:  return QAbstractGraphicsShapeItem::isObscuredBy(item); | 0 | ||||||||||||||||||||||||||||||
| 5024 | } | - | ||||||||||||||||||||||||||||||
| 5025 | - | |||||||||||||||||||||||||||||||
| 5026 | - | |||||||||||||||||||||||||||||||
| 5027 | - | |||||||||||||||||||||||||||||||
| 5028 | - | |||||||||||||||||||||||||||||||
| 5029 | QPainterPath QGraphicsPolygonItem::opaqueArea() const | - | ||||||||||||||||||||||||||||||
| 5030 | { | - | ||||||||||||||||||||||||||||||
| 5031 |     return never executed:   QAbstractGraphicsShapeItem::opaqueArea();return QAbstractGraphicsShapeItem::opaqueArea();never executed:  return QAbstractGraphicsShapeItem::opaqueArea(); | 0 | ||||||||||||||||||||||||||||||
| 5032 | } | - | ||||||||||||||||||||||||||||||
| 5033 | - | |||||||||||||||||||||||||||||||
| 5034 | - | |||||||||||||||||||||||||||||||
| 5035 | - | |||||||||||||||||||||||||||||||
| 5036 | - | |||||||||||||||||||||||||||||||
| 5037 | int QGraphicsPolygonItem::type() const | - | ||||||||||||||||||||||||||||||
| 5038 | { | - | ||||||||||||||||||||||||||||||
| 5039 |     return never executed:   Type;return Type;never executed:  return Type; | 0 | ||||||||||||||||||||||||||||||
| 5040 | } | - | ||||||||||||||||||||||||||||||
| 5041 | - | |||||||||||||||||||||||||||||||
| 5042 | - | |||||||||||||||||||||||||||||||
| 5043 | - | |||||||||||||||||||||||||||||||
| 5044 | - | |||||||||||||||||||||||||||||||
| 5045 | bool QGraphicsPolygonItem::supportsExtension(Extension extension) const | - | ||||||||||||||||||||||||||||||
| 5046 | { | - | ||||||||||||||||||||||||||||||
| 5047 | (void)extension;; | - | ||||||||||||||||||||||||||||||
| 5048 |     return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||
| 5049 | } | - | ||||||||||||||||||||||||||||||
| 5050 | - | |||||||||||||||||||||||||||||||
| 5051 | - | |||||||||||||||||||||||||||||||
| 5052 | - | |||||||||||||||||||||||||||||||
| 5053 | - | |||||||||||||||||||||||||||||||
| 5054 | void QGraphicsPolygonItem::setExtension(Extension extension, const QVariant &variant) | - | ||||||||||||||||||||||||||||||
| 5055 | { | - | ||||||||||||||||||||||||||||||
| 5056 | (void)extension;; | - | ||||||||||||||||||||||||||||||
| 5057 | (void)variant;; | - | ||||||||||||||||||||||||||||||
| 5058 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5059 | - | |||||||||||||||||||||||||||||||
| 5060 | - | |||||||||||||||||||||||||||||||
| 5061 | - | |||||||||||||||||||||||||||||||
| 5062 | - | |||||||||||||||||||||||||||||||
| 5063 | QVariant QGraphicsPolygonItem::extension(const QVariant &variant) const | - | ||||||||||||||||||||||||||||||
| 5064 | { | - | ||||||||||||||||||||||||||||||
| 5065 | (void)variant;; | - | ||||||||||||||||||||||||||||||
| 5066 |     return never executed:   QVariant();return QVariant();never executed:  return QVariant(); | 0 | ||||||||||||||||||||||||||||||
| 5067 | } | - | ||||||||||||||||||||||||||||||
| 5068 | class QGraphicsLineItemPrivate : public QGraphicsItemPrivate | - | ||||||||||||||||||||||||||||||
| 5069 | { | - | ||||||||||||||||||||||||||||||
| 5070 | 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; | - | ||||||||||||||||||||||||||||||
| 5071 | public: | - | ||||||||||||||||||||||||||||||
| 5072 | QLineF line; | - | ||||||||||||||||||||||||||||||
| 5073 | QPen pen; | - | ||||||||||||||||||||||||||||||
| 5074 | }; | - | ||||||||||||||||||||||||||||||
| 5075 | - | |||||||||||||||||||||||||||||||
| 5076 | - | |||||||||||||||||||||||||||||||
| 5077 | - | |||||||||||||||||||||||||||||||
| 5078 | - | |||||||||||||||||||||||||||||||
| 5079 | - | |||||||||||||||||||||||||||||||
| 5080 | - | |||||||||||||||||||||||||||||||
| 5081 | - | |||||||||||||||||||||||||||||||
| 5082 | QGraphicsLineItem::QGraphicsLineItem(const QLineF &line, QGraphicsItem *parent) | - | ||||||||||||||||||||||||||||||
| 5083 | : QGraphicsItem(*new QGraphicsLineItemPrivate, parent) | - | ||||||||||||||||||||||||||||||
| 5084 | { | - | ||||||||||||||||||||||||||||||
| 5085 | setLine(line); | - | ||||||||||||||||||||||||||||||
| 5086 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5087 | QGraphicsLineItem::QGraphicsLineItem(qreal x1, qreal y1, qreal x2, qreal y2, QGraphicsItem *parent) | - | ||||||||||||||||||||||||||||||
| 5088 | : QGraphicsItem(*new QGraphicsLineItemPrivate, parent) | - | ||||||||||||||||||||||||||||||
| 5089 | { | - | ||||||||||||||||||||||||||||||
| 5090 | setLine(x1, y1, x2, y2); | - | ||||||||||||||||||||||||||||||
| 5091 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5092 | QGraphicsLineItem::QGraphicsLineItem(QGraphicsItem *parent) | - | ||||||||||||||||||||||||||||||
| 5093 | : QGraphicsItem(*new QGraphicsLineItemPrivate, parent) | - | ||||||||||||||||||||||||||||||
| 5094 | { | - | ||||||||||||||||||||||||||||||
| 5095 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5096 | - | |||||||||||||||||||||||||||||||
| 5097 | - | |||||||||||||||||||||||||||||||
| 5098 | - | |||||||||||||||||||||||||||||||
| 5099 | - | |||||||||||||||||||||||||||||||
| 5100 | QGraphicsLineItem::~QGraphicsLineItem() | - | ||||||||||||||||||||||||||||||
| 5101 | { | - | ||||||||||||||||||||||||||||||
| 5102 | } | - | ||||||||||||||||||||||||||||||
| 5103 | - | |||||||||||||||||||||||||||||||
| 5104 | - | |||||||||||||||||||||||||||||||
| 5105 | - | |||||||||||||||||||||||||||||||
| 5106 | - | |||||||||||||||||||||||||||||||
| 5107 | - | |||||||||||||||||||||||||||||||
| 5108 | - | |||||||||||||||||||||||||||||||
| 5109 | - | |||||||||||||||||||||||||||||||
| 5110 | QPen QGraphicsLineItem::pen() const | - | ||||||||||||||||||||||||||||||
| 5111 | { | - | ||||||||||||||||||||||||||||||
| 5112 | const QGraphicsLineItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 5113 |     return never executed:   d->pen;return d->pen;never executed:  return d->pen; | 0 | ||||||||||||||||||||||||||||||
| 5114 | } | - | ||||||||||||||||||||||||||||||
| 5115 | - | |||||||||||||||||||||||||||||||
| 5116 | - | |||||||||||||||||||||||||||||||
| 5117 | - | |||||||||||||||||||||||||||||||
| 5118 | - | |||||||||||||||||||||||||||||||
| 5119 | - | |||||||||||||||||||||||||||||||
| 5120 | - | |||||||||||||||||||||||||||||||
| 5121 | - | |||||||||||||||||||||||||||||||
| 5122 | void QGraphicsLineItem::setPen(const QPen &pen) | - | ||||||||||||||||||||||||||||||
| 5123 | { | - | ||||||||||||||||||||||||||||||
| 5124 | QGraphicsLineItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 5125 |     if (d->pen == pen
  | 0 | ||||||||||||||||||||||||||||||
| 5126 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 5127 | prepareGeometryChange(); | - | ||||||||||||||||||||||||||||||
| 5128 | d->pen = pen; | - | ||||||||||||||||||||||||||||||
| 5129 | update(); | - | ||||||||||||||||||||||||||||||
| 5130 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5131 | - | |||||||||||||||||||||||||||||||
| 5132 | - | |||||||||||||||||||||||||||||||
| 5133 | - | |||||||||||||||||||||||||||||||
| 5134 | - | |||||||||||||||||||||||||||||||
| 5135 | - | |||||||||||||||||||||||||||||||
| 5136 | - | |||||||||||||||||||||||||||||||
| 5137 | QLineF QGraphicsLineItem::line() const | - | ||||||||||||||||||||||||||||||
| 5138 | { | - | ||||||||||||||||||||||||||||||
| 5139 | const QGraphicsLineItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 5140 |     return never executed:   d->line;return d->line;never executed:  return d->line; | 0 | ||||||||||||||||||||||||||||||
| 5141 | } | - | ||||||||||||||||||||||||||||||
| 5142 | - | |||||||||||||||||||||||||||||||
| 5143 | - | |||||||||||||||||||||||||||||||
| 5144 | - | |||||||||||||||||||||||||||||||
| 5145 | - | |||||||||||||||||||||||||||||||
| 5146 | - | |||||||||||||||||||||||||||||||
| 5147 | - | |||||||||||||||||||||||||||||||
| 5148 | void QGraphicsLineItem::setLine(const QLineF &line) | - | ||||||||||||||||||||||||||||||
| 5149 | { | - | ||||||||||||||||||||||||||||||
| 5150 | QGraphicsLineItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 5151 |     if (d->line == line
  | 0 | ||||||||||||||||||||||||||||||
| 5152 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 5153 | prepareGeometryChange(); | - | ||||||||||||||||||||||||||||||
| 5154 | d->line = line; | - | ||||||||||||||||||||||||||||||
| 5155 | update(); | - | ||||||||||||||||||||||||||||||
| 5156 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5157 | QRectF QGraphicsLineItem::boundingRect() const | - | ||||||||||||||||||||||||||||||
| 5158 | { | - | ||||||||||||||||||||||||||||||
| 5159 | const QGraphicsLineItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 5160 |     if (d->pen.widthF() == 0.0
  | 0 | ||||||||||||||||||||||||||||||
| 5161 | const qreal x1 = d->line.p1().x(); | - | ||||||||||||||||||||||||||||||
| 5162 | const qreal x2 = d->line.p2().x(); | - | ||||||||||||||||||||||||||||||
| 5163 | const qreal y1 = d->line.p1().y(); | - | ||||||||||||||||||||||||||||||
| 5164 | const qreal y2 = d->line.p2().y(); | - | ||||||||||||||||||||||||||||||
| 5165 | qreal lx = qMin(x1, x2); | - | ||||||||||||||||||||||||||||||
| 5166 | qreal rx = qMax(x1, x2); | - | ||||||||||||||||||||||||||||||
| 5167 | qreal ty = qMin(y1, y2); | - | ||||||||||||||||||||||||||||||
| 5168 | qreal by = qMax(y1, y2); | - | ||||||||||||||||||||||||||||||
| 5169 |         return never executed:   QRectF(lx, ty, rx - lx, by - ty);return QRectF(lx, ty, rx - lx, by - ty);never executed:  return QRectF(lx, ty, rx - lx, by - ty); | 0 | ||||||||||||||||||||||||||||||
| 5170 | } | - | ||||||||||||||||||||||||||||||
| 5171 |     return never executed:   shape().controlPointRect();return shape().controlPointRect();never executed:  return shape().controlPointRect(); | 0 | ||||||||||||||||||||||||||||||
| 5172 | } | - | ||||||||||||||||||||||||||||||
| 5173 | - | |||||||||||||||||||||||||||||||
| 5174 | - | |||||||||||||||||||||||||||||||
| 5175 | - | |||||||||||||||||||||||||||||||
| 5176 | - | |||||||||||||||||||||||||||||||
| 5177 | QPainterPath QGraphicsLineItem::shape() const | - | ||||||||||||||||||||||||||||||
| 5178 | { | - | ||||||||||||||||||||||||||||||
| 5179 | const QGraphicsLineItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 5180 | QPainterPath path; | - | ||||||||||||||||||||||||||||||
| 5181 |     if (d->line == QLineF()
  | 0 | ||||||||||||||||||||||||||||||
| 5182 |         return never executed:   path;return path;never executed:  return path; | 0 | ||||||||||||||||||||||||||||||
| 5183 | - | |||||||||||||||||||||||||||||||
| 5184 | path.moveTo(d->line.p1()); | - | ||||||||||||||||||||||||||||||
| 5185 | path.lineTo(d->line.p2()); | - | ||||||||||||||||||||||||||||||
| 5186 |     return never executed:   qt_graphicsItem_shapeFromPath(path, d->pen);return qt_graphicsItem_shapeFromPath(path, d->pen);never executed:  return qt_graphicsItem_shapeFromPath(path, d->pen); | 0 | ||||||||||||||||||||||||||||||
| 5187 | } | - | ||||||||||||||||||||||||||||||
| 5188 | - | |||||||||||||||||||||||||||||||
| 5189 | - | |||||||||||||||||||||||||||||||
| 5190 | - | |||||||||||||||||||||||||||||||
| 5191 | - | |||||||||||||||||||||||||||||||
| 5192 | bool QGraphicsLineItem::contains(const QPointF &point) const | - | ||||||||||||||||||||||||||||||
| 5193 | { | - | ||||||||||||||||||||||||||||||
| 5194 |     return never executed:   QGraphicsItem::contains(point);return QGraphicsItem::contains(point);never executed:  return QGraphicsItem::contains(point); | 0 | ||||||||||||||||||||||||||||||
| 5195 | } | - | ||||||||||||||||||||||||||||||
| 5196 | - | |||||||||||||||||||||||||||||||
| 5197 | - | |||||||||||||||||||||||||||||||
| 5198 | - | |||||||||||||||||||||||||||||||
| 5199 | - | |||||||||||||||||||||||||||||||
| 5200 | void QGraphicsLineItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) | - | ||||||||||||||||||||||||||||||
| 5201 | { | - | ||||||||||||||||||||||||||||||
| 5202 | QGraphicsLineItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 5203 | (void)widget;; | - | ||||||||||||||||||||||||||||||
| 5204 | painter->setPen(d->pen); | - | ||||||||||||||||||||||||||||||
| 5205 | painter->drawLine(d->line); | - | ||||||||||||||||||||||||||||||
| 5206 | - | |||||||||||||||||||||||||||||||
| 5207 |     if (option->state & QStyle::State_Selected
  | 0 | ||||||||||||||||||||||||||||||
| 5208 |         qt_graphicsItem_highlightSelected(this, painter, option); never executed:  qt_graphicsItem_highlightSelected(this, painter, option); | 0 | ||||||||||||||||||||||||||||||
| 5209 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5210 | - | |||||||||||||||||||||||||||||||
| 5211 | - | |||||||||||||||||||||||||||||||
| 5212 | - | |||||||||||||||||||||||||||||||
| 5213 | - | |||||||||||||||||||||||||||||||
| 5214 | bool QGraphicsLineItem::isObscuredBy(const QGraphicsItem *item) const | - | ||||||||||||||||||||||||||||||
| 5215 | { | - | ||||||||||||||||||||||||||||||
| 5216 |     return never executed:   QGraphicsItem::isObscuredBy(item);return QGraphicsItem::isObscuredBy(item);never executed:  return QGraphicsItem::isObscuredBy(item); | 0 | ||||||||||||||||||||||||||||||
| 5217 | } | - | ||||||||||||||||||||||||||||||
| 5218 | - | |||||||||||||||||||||||||||||||
| 5219 | - | |||||||||||||||||||||||||||||||
| 5220 | - | |||||||||||||||||||||||||||||||
| 5221 | - | |||||||||||||||||||||||||||||||
| 5222 | QPainterPath QGraphicsLineItem::opaqueArea() const | - | ||||||||||||||||||||||||||||||
| 5223 | { | - | ||||||||||||||||||||||||||||||
| 5224 |     return never executed:   QGraphicsItem::opaqueArea();return QGraphicsItem::opaqueArea();never executed:  return QGraphicsItem::opaqueArea(); | 0 | ||||||||||||||||||||||||||||||
| 5225 | } | - | ||||||||||||||||||||||||||||||
| 5226 | - | |||||||||||||||||||||||||||||||
| 5227 | - | |||||||||||||||||||||||||||||||
| 5228 | - | |||||||||||||||||||||||||||||||
| 5229 | - | |||||||||||||||||||||||||||||||
| 5230 | int QGraphicsLineItem::type() const | - | ||||||||||||||||||||||||||||||
| 5231 | { | - | ||||||||||||||||||||||||||||||
| 5232 |     return never executed:   Type;return Type;never executed:  return Type; | 0 | ||||||||||||||||||||||||||||||
| 5233 | } | - | ||||||||||||||||||||||||||||||
| 5234 | - | |||||||||||||||||||||||||||||||
| 5235 | - | |||||||||||||||||||||||||||||||
| 5236 | - | |||||||||||||||||||||||||||||||
| 5237 | - | |||||||||||||||||||||||||||||||
| 5238 | bool QGraphicsLineItem::supportsExtension(Extension extension) const | - | ||||||||||||||||||||||||||||||
| 5239 | { | - | ||||||||||||||||||||||||||||||
| 5240 | (void)extension;; | - | ||||||||||||||||||||||||||||||
| 5241 |     return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||
| 5242 | } | - | ||||||||||||||||||||||||||||||
| 5243 | - | |||||||||||||||||||||||||||||||
| 5244 | - | |||||||||||||||||||||||||||||||
| 5245 | - | |||||||||||||||||||||||||||||||
| 5246 | - | |||||||||||||||||||||||||||||||
| 5247 | void QGraphicsLineItem::setExtension(Extension extension, const QVariant &variant) | - | ||||||||||||||||||||||||||||||
| 5248 | { | - | ||||||||||||||||||||||||||||||
| 5249 | (void)extension;; | - | ||||||||||||||||||||||||||||||
| 5250 | (void)variant;; | - | ||||||||||||||||||||||||||||||
| 5251 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5252 | - | |||||||||||||||||||||||||||||||
| 5253 | - | |||||||||||||||||||||||||||||||
| 5254 | - | |||||||||||||||||||||||||||||||
| 5255 | - | |||||||||||||||||||||||||||||||
| 5256 | QVariant QGraphicsLineItem::extension(const QVariant &variant) const | - | ||||||||||||||||||||||||||||||
| 5257 | { | - | ||||||||||||||||||||||||||||||
| 5258 | (void)variant;; | - | ||||||||||||||||||||||||||||||
| 5259 |     return never executed:   QVariant();return QVariant();never executed:  return QVariant(); | 0 | ||||||||||||||||||||||||||||||
| 5260 | } | - | ||||||||||||||||||||||||||||||
| 5261 | extern QPainterPath qt_regionToPath(const QRegion ®ion); | - | ||||||||||||||||||||||||||||||
| 5262 | - | |||||||||||||||||||||||||||||||
| 5263 | class QGraphicsPixmapItemPrivate : public QGraphicsItemPrivate | - | ||||||||||||||||||||||||||||||
| 5264 | { | - | ||||||||||||||||||||||||||||||
| 5265 | 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; | - | ||||||||||||||||||||||||||||||
| 5266 | public: | - | ||||||||||||||||||||||||||||||
| 5267 | QGraphicsPixmapItemPrivate() | - | ||||||||||||||||||||||||||||||
| 5268 | : transformationMode(Qt::FastTransformation), | - | ||||||||||||||||||||||||||||||
| 5269 | shapeMode(QGraphicsPixmapItem::MaskShape), | - | ||||||||||||||||||||||||||||||
| 5270 | hasShape(false) | - | ||||||||||||||||||||||||||||||
| 5271 |     {} never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5272 | - | |||||||||||||||||||||||||||||||
| 5273 | QPixmap pixmap; | - | ||||||||||||||||||||||||||||||
| 5274 | Qt::TransformationMode transformationMode; | - | ||||||||||||||||||||||||||||||
| 5275 | QPointF offset; | - | ||||||||||||||||||||||||||||||
| 5276 | QGraphicsPixmapItem::ShapeMode shapeMode; | - | ||||||||||||||||||||||||||||||
| 5277 | QPainterPath shape; | - | ||||||||||||||||||||||||||||||
| 5278 | bool hasShape; | - | ||||||||||||||||||||||||||||||
| 5279 | - | |||||||||||||||||||||||||||||||
| 5280 | void updateShape() | - | ||||||||||||||||||||||||||||||
| 5281 | { | - | ||||||||||||||||||||||||||||||
| 5282 | shape = QPainterPath(); | - | ||||||||||||||||||||||||||||||
| 5283 | switch (shapeMode) { | - | ||||||||||||||||||||||||||||||
| 5284 |         case never executed:   QGraphicsPixmapItem::MaskShape:case QGraphicsPixmapItem::MaskShape:never executed:   {case QGraphicsPixmapItem::MaskShape: | 0 | ||||||||||||||||||||||||||||||
| 5285 | QBitmap mask = pixmap.mask(); | - | ||||||||||||||||||||||||||||||
| 5286 |             if (!mask.isNull()
  | 0 | ||||||||||||||||||||||||||||||
| 5287 | shape = qt_regionToPath(QRegion(mask).translated(offset.toPoint())); | - | ||||||||||||||||||||||||||||||
| 5288 |                 break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 5289 | } | - | ||||||||||||||||||||||||||||||
| 5290 | - | |||||||||||||||||||||||||||||||
| 5291 | } | - | ||||||||||||||||||||||||||||||
| 5292 |         case never executed:   QGraphicsPixmapItem::BoundingRectShape:case QGraphicsPixmapItem::BoundingRectShape:never executed:  case QGraphicsPixmapItem::BoundingRectShape:code before this statement never executed:  case QGraphicsPixmapItem::BoundingRectShape: | 0 | ||||||||||||||||||||||||||||||
| 5293 | shape.addRect(QRectF(offset.x(), offset.y(), pixmap.width(), pixmap.height())); | - | ||||||||||||||||||||||||||||||
| 5294 |             break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 5295 |         case never executed:   QGraphicsPixmapItem::HeuristicMaskShape:case QGraphicsPixmapItem::HeuristicMaskShape:never executed:  case QGraphicsPixmapItem::HeuristicMaskShape: | 0 | ||||||||||||||||||||||||||||||
| 5296 | - | |||||||||||||||||||||||||||||||
| 5297 | shape = qt_regionToPath(QRegion(pixmap.createHeuristicMask()).translated(offset.toPoint())); | - | ||||||||||||||||||||||||||||||
| 5298 | - | |||||||||||||||||||||||||||||||
| 5299 | - | |||||||||||||||||||||||||||||||
| 5300 | - | |||||||||||||||||||||||||||||||
| 5301 |             break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 5302 | } | - | ||||||||||||||||||||||||||||||
| 5303 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5304 | }; | - | ||||||||||||||||||||||||||||||
| 5305 | - | |||||||||||||||||||||||||||||||
| 5306 | - | |||||||||||||||||||||||||||||||
| 5307 | - | |||||||||||||||||||||||||||||||
| 5308 | - | |||||||||||||||||||||||||||||||
| 5309 | - | |||||||||||||||||||||||||||||||
| 5310 | - | |||||||||||||||||||||||||||||||
| 5311 | - | |||||||||||||||||||||||||||||||
| 5312 | QGraphicsPixmapItem::QGraphicsPixmapItem(const QPixmap &pixmap, QGraphicsItem *parent) | - | ||||||||||||||||||||||||||||||
| 5313 | : QGraphicsItem(*new QGraphicsPixmapItemPrivate, parent) | - | ||||||||||||||||||||||||||||||
| 5314 | { | - | ||||||||||||||||||||||||||||||
| 5315 | setPixmap(pixmap); | - | ||||||||||||||||||||||||||||||
| 5316 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5317 | - | |||||||||||||||||||||||||||||||
| 5318 | - | |||||||||||||||||||||||||||||||
| 5319 | - | |||||||||||||||||||||||||||||||
| 5320 | - | |||||||||||||||||||||||||||||||
| 5321 | - | |||||||||||||||||||||||||||||||
| 5322 | - | |||||||||||||||||||||||||||||||
| 5323 | - | |||||||||||||||||||||||||||||||
| 5324 | QGraphicsPixmapItem::QGraphicsPixmapItem(QGraphicsItem *parent) | - | ||||||||||||||||||||||||||||||
| 5325 | : QGraphicsItem(*new QGraphicsPixmapItemPrivate, parent) | - | ||||||||||||||||||||||||||||||
| 5326 | { | - | ||||||||||||||||||||||||||||||
| 5327 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5328 | - | |||||||||||||||||||||||||||||||
| 5329 | - | |||||||||||||||||||||||||||||||
| 5330 | - | |||||||||||||||||||||||||||||||
| 5331 | - | |||||||||||||||||||||||||||||||
| 5332 | QGraphicsPixmapItem::~QGraphicsPixmapItem() | - | ||||||||||||||||||||||||||||||
| 5333 | { | - | ||||||||||||||||||||||||||||||
| 5334 | } | - | ||||||||||||||||||||||||||||||
| 5335 | - | |||||||||||||||||||||||||||||||
| 5336 | - | |||||||||||||||||||||||||||||||
| 5337 | - | |||||||||||||||||||||||||||||||
| 5338 | - | |||||||||||||||||||||||||||||||
| 5339 | - | |||||||||||||||||||||||||||||||
| 5340 | - | |||||||||||||||||||||||||||||||
| 5341 | void QGraphicsPixmapItem::setPixmap(const QPixmap &pixmap) | - | ||||||||||||||||||||||||||||||
| 5342 | { | - | ||||||||||||||||||||||||||||||
| 5343 | QGraphicsPixmapItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 5344 | prepareGeometryChange(); | - | ||||||||||||||||||||||||||||||
| 5345 | d->pixmap = pixmap; | - | ||||||||||||||||||||||||||||||
| 5346 | d->hasShape = false; | - | ||||||||||||||||||||||||||||||
| 5347 | update(); | - | ||||||||||||||||||||||||||||||
| 5348 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5349 | - | |||||||||||||||||||||||||||||||
| 5350 | - | |||||||||||||||||||||||||||||||
| 5351 | - | |||||||||||||||||||||||||||||||
| 5352 | - | |||||||||||||||||||||||||||||||
| 5353 | - | |||||||||||||||||||||||||||||||
| 5354 | - | |||||||||||||||||||||||||||||||
| 5355 | - | |||||||||||||||||||||||||||||||
| 5356 | QPixmap QGraphicsPixmapItem::pixmap() const | - | ||||||||||||||||||||||||||||||
| 5357 | { | - | ||||||||||||||||||||||||||||||
| 5358 | const QGraphicsPixmapItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 5359 |     return never executed:   d->pixmap;return d->pixmap;never executed:  return d->pixmap; | 0 | ||||||||||||||||||||||||||||||
| 5360 | } | - | ||||||||||||||||||||||||||||||
| 5361 | Qt::TransformationMode QGraphicsPixmapItem::transformationMode() const | - | ||||||||||||||||||||||||||||||
| 5362 | { | - | ||||||||||||||||||||||||||||||
| 5363 | const QGraphicsPixmapItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 5364 |     return never executed:   d->transformationMode;return d->transformationMode;never executed:  return d->transformationMode; | 0 | ||||||||||||||||||||||||||||||
| 5365 | } | - | ||||||||||||||||||||||||||||||
| 5366 | void QGraphicsPixmapItem::setTransformationMode(Qt::TransformationMode mode) | - | ||||||||||||||||||||||||||||||
| 5367 | { | - | ||||||||||||||||||||||||||||||
| 5368 | QGraphicsPixmapItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 5369 |     if (mode != d->transformationMode
  | 0 | ||||||||||||||||||||||||||||||
| 5370 | d->transformationMode = mode; | - | ||||||||||||||||||||||||||||||
| 5371 | update(); | - | ||||||||||||||||||||||||||||||
| 5372 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5373 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5374 | - | |||||||||||||||||||||||||||||||
| 5375 | - | |||||||||||||||||||||||||||||||
| 5376 | - | |||||||||||||||||||||||||||||||
| 5377 | - | |||||||||||||||||||||||||||||||
| 5378 | - | |||||||||||||||||||||||||||||||
| 5379 | - | |||||||||||||||||||||||||||||||
| 5380 | - | |||||||||||||||||||||||||||||||
| 5381 | QPointF QGraphicsPixmapItem::offset() const | - | ||||||||||||||||||||||||||||||
| 5382 | { | - | ||||||||||||||||||||||||||||||
| 5383 | const QGraphicsPixmapItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 5384 |     return never executed:   d->offset;return d->offset;never executed:  return d->offset; | 0 | ||||||||||||||||||||||||||||||
| 5385 | } | - | ||||||||||||||||||||||||||||||
| 5386 | - | |||||||||||||||||||||||||||||||
| 5387 | - | |||||||||||||||||||||||||||||||
| 5388 | - | |||||||||||||||||||||||||||||||
| 5389 | - | |||||||||||||||||||||||||||||||
| 5390 | - | |||||||||||||||||||||||||||||||
| 5391 | - | |||||||||||||||||||||||||||||||
| 5392 | - | |||||||||||||||||||||||||||||||
| 5393 | void QGraphicsPixmapItem::setOffset(const QPointF &offset) | - | ||||||||||||||||||||||||||||||
| 5394 | { | - | ||||||||||||||||||||||||||||||
| 5395 | QGraphicsPixmapItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 5396 |     if (d->offset == offset
  | 0 | ||||||||||||||||||||||||||||||
| 5397 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 5398 | prepareGeometryChange(); | - | ||||||||||||||||||||||||||||||
| 5399 | d->offset = offset; | - | ||||||||||||||||||||||||||||||
| 5400 | d->hasShape = false; | - | ||||||||||||||||||||||||||||||
| 5401 | update(); | - | ||||||||||||||||||||||||||||||
| 5402 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5403 | QRectF QGraphicsPixmapItem::boundingRect() const | - | ||||||||||||||||||||||||||||||
| 5404 | { | - | ||||||||||||||||||||||||||||||
| 5405 | const QGraphicsPixmapItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 5406 |     if (d->pixmap.isNull()
  | 0 | ||||||||||||||||||||||||||||||
| 5407 |         return never executed:   QRectF();return QRectF();never executed:  return QRectF(); | 0 | ||||||||||||||||||||||||||||||
| 5408 |     if (d->flags & ItemIsSelectable
  | 0 | ||||||||||||||||||||||||||||||
| 5409 | qreal pw = 1.0; | - | ||||||||||||||||||||||||||||||
| 5410 |         return never executed:   QRectF(d->offset, d->pixmap.size() / d->pixmap.devicePixelRatio()).adjusted(-pw/2, -pw/2, pw/2, pw/2);return 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 | ||||||||||||||||||||||||||||||
| 5411 | } else { | - | ||||||||||||||||||||||||||||||
| 5412 |         return never executed:   QRectF(d->offset, d->pixmap.size() / d->pixmap.devicePixelRatio());return QRectF(d->offset, d->pixmap.size() / d->pixmap.devicePixelRatio());never executed:  return QRectF(d->offset, d->pixmap.size() / d->pixmap.devicePixelRatio()); | 0 | ||||||||||||||||||||||||||||||
| 5413 | } | - | ||||||||||||||||||||||||||||||
| 5414 | } | - | ||||||||||||||||||||||||||||||
| 5415 | - | |||||||||||||||||||||||||||||||
| 5416 | - | |||||||||||||||||||||||||||||||
| 5417 | - | |||||||||||||||||||||||||||||||
| 5418 | - | |||||||||||||||||||||||||||||||
| 5419 | QPainterPath QGraphicsPixmapItem::shape() const | - | ||||||||||||||||||||||||||||||
| 5420 | { | - | ||||||||||||||||||||||||||||||
| 5421 | const QGraphicsPixmapItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 5422 |     if (!d->hasShape
  | 0 | ||||||||||||||||||||||||||||||
| 5423 | QGraphicsPixmapItemPrivate *thatD = const_cast<QGraphicsPixmapItemPrivate *>(d); | - | ||||||||||||||||||||||||||||||
| 5424 | thatD->updateShape(); | - | ||||||||||||||||||||||||||||||
| 5425 | thatD->hasShape = true; | - | ||||||||||||||||||||||||||||||
| 5426 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5427 |     return never executed:   d_func()->shape;return d_func()->shape;never executed:  return d_func()->shape; | 0 | ||||||||||||||||||||||||||||||
| 5428 | } | - | ||||||||||||||||||||||||||||||
| 5429 | - | |||||||||||||||||||||||||||||||
| 5430 | - | |||||||||||||||||||||||||||||||
| 5431 | - | |||||||||||||||||||||||||||||||
| 5432 | - | |||||||||||||||||||||||||||||||
| 5433 | bool QGraphicsPixmapItem::contains(const QPointF &point) const | - | ||||||||||||||||||||||||||||||
| 5434 | { | - | ||||||||||||||||||||||||||||||
| 5435 |     return never executed:   QGraphicsItem::contains(point);return QGraphicsItem::contains(point);never executed:  return QGraphicsItem::contains(point); | 0 | ||||||||||||||||||||||||||||||
| 5436 | } | - | ||||||||||||||||||||||||||||||
| 5437 | - | |||||||||||||||||||||||||||||||
| 5438 | - | |||||||||||||||||||||||||||||||
| 5439 | - | |||||||||||||||||||||||||||||||
| 5440 | - | |||||||||||||||||||||||||||||||
| 5441 | void QGraphicsPixmapItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, | - | ||||||||||||||||||||||||||||||
| 5442 | QWidget *widget) | - | ||||||||||||||||||||||||||||||
| 5443 | { | - | ||||||||||||||||||||||||||||||
| 5444 | QGraphicsPixmapItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 5445 | (void)widget;; | - | ||||||||||||||||||||||||||||||
| 5446 | - | |||||||||||||||||||||||||||||||
| 5447 | painter->setRenderHint(QPainter::SmoothPixmapTransform, | - | ||||||||||||||||||||||||||||||
| 5448 | (d->transformationMode == Qt::SmoothTransformation)); | - | ||||||||||||||||||||||||||||||
| 5449 | - | |||||||||||||||||||||||||||||||
| 5450 | painter->drawPixmap(d->offset, d->pixmap); | - | ||||||||||||||||||||||||||||||
| 5451 | - | |||||||||||||||||||||||||||||||
| 5452 |     if (option->state & QStyle::State_Selected
  | 0 | ||||||||||||||||||||||||||||||
| 5453 |         qt_graphicsItem_highlightSelected(this, painter, option); never executed:  qt_graphicsItem_highlightSelected(this, painter, option); | 0 | ||||||||||||||||||||||||||||||
| 5454 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5455 | - | |||||||||||||||||||||||||||||||
| 5456 | - | |||||||||||||||||||||||||||||||
| 5457 | - | |||||||||||||||||||||||||||||||
| 5458 | - | |||||||||||||||||||||||||||||||
| 5459 | bool QGraphicsPixmapItem::isObscuredBy(const QGraphicsItem *item) const | - | ||||||||||||||||||||||||||||||
| 5460 | { | - | ||||||||||||||||||||||||||||||
| 5461 |     return never executed:   QGraphicsItem::isObscuredBy(item);return QGraphicsItem::isObscuredBy(item);never executed:  return QGraphicsItem::isObscuredBy(item); | 0 | ||||||||||||||||||||||||||||||
| 5462 | } | - | ||||||||||||||||||||||||||||||
| 5463 | - | |||||||||||||||||||||||||||||||
| 5464 | - | |||||||||||||||||||||||||||||||
| 5465 | - | |||||||||||||||||||||||||||||||
| 5466 | - | |||||||||||||||||||||||||||||||
| 5467 | QPainterPath QGraphicsPixmapItem::opaqueArea() const | - | ||||||||||||||||||||||||||||||
| 5468 | { | - | ||||||||||||||||||||||||||||||
| 5469 |     return never executed:   shape();return shape();never executed:  return shape(); | 0 | ||||||||||||||||||||||||||||||
| 5470 | } | - | ||||||||||||||||||||||||||||||
| 5471 | - | |||||||||||||||||||||||||||||||
| 5472 | - | |||||||||||||||||||||||||||||||
| 5473 | - | |||||||||||||||||||||||||||||||
| 5474 | - | |||||||||||||||||||||||||||||||
| 5475 | int QGraphicsPixmapItem::type() const | - | ||||||||||||||||||||||||||||||
| 5476 | { | - | ||||||||||||||||||||||||||||||
| 5477 |     return never executed:   Type;return Type;never executed:  return Type; | 0 | ||||||||||||||||||||||||||||||
| 5478 | } | - | ||||||||||||||||||||||||||||||
| 5479 | - | |||||||||||||||||||||||||||||||
| 5480 | - | |||||||||||||||||||||||||||||||
| 5481 | - | |||||||||||||||||||||||||||||||
| 5482 | - | |||||||||||||||||||||||||||||||
| 5483 | - | |||||||||||||||||||||||||||||||
| 5484 | - | |||||||||||||||||||||||||||||||
| 5485 | - | |||||||||||||||||||||||||||||||
| 5486 | QGraphicsPixmapItem::ShapeMode QGraphicsPixmapItem::shapeMode() const | - | ||||||||||||||||||||||||||||||
| 5487 | { | - | ||||||||||||||||||||||||||||||
| 5488 |     return never executed:   d_func()->shapeMode;return d_func()->shapeMode;never executed:  return d_func()->shapeMode; | 0 | ||||||||||||||||||||||||||||||
| 5489 | } | - | ||||||||||||||||||||||||||||||
| 5490 | - | |||||||||||||||||||||||||||||||
| 5491 | - | |||||||||||||||||||||||||||||||
| 5492 | - | |||||||||||||||||||||||||||||||
| 5493 | - | |||||||||||||||||||||||||||||||
| 5494 | - | |||||||||||||||||||||||||||||||
| 5495 | - | |||||||||||||||||||||||||||||||
| 5496 | - | |||||||||||||||||||||||||||||||
| 5497 | void QGraphicsPixmapItem::setShapeMode(ShapeMode mode) | - | ||||||||||||||||||||||||||||||
| 5498 | { | - | ||||||||||||||||||||||||||||||
| 5499 | QGraphicsPixmapItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 5500 |     if (d->shapeMode == mode
  | 0 | ||||||||||||||||||||||||||||||
| 5501 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 5502 | d->shapeMode = mode; | - | ||||||||||||||||||||||||||||||
| 5503 | d->hasShape = false; | - | ||||||||||||||||||||||||||||||
| 5504 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5505 | - | |||||||||||||||||||||||||||||||
| 5506 | - | |||||||||||||||||||||||||||||||
| 5507 | - | |||||||||||||||||||||||||||||||
| 5508 | - | |||||||||||||||||||||||||||||||
| 5509 | bool QGraphicsPixmapItem::supportsExtension(Extension extension) const | - | ||||||||||||||||||||||||||||||
| 5510 | { | - | ||||||||||||||||||||||||||||||
| 5511 | (void)extension;; | - | ||||||||||||||||||||||||||||||
| 5512 |     return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||
| 5513 | } | - | ||||||||||||||||||||||||||||||
| 5514 | - | |||||||||||||||||||||||||||||||
| 5515 | - | |||||||||||||||||||||||||||||||
| 5516 | - | |||||||||||||||||||||||||||||||
| 5517 | - | |||||||||||||||||||||||||||||||
| 5518 | void QGraphicsPixmapItem::setExtension(Extension extension, const QVariant &variant) | - | ||||||||||||||||||||||||||||||
| 5519 | { | - | ||||||||||||||||||||||||||||||
| 5520 | (void)extension;; | - | ||||||||||||||||||||||||||||||
| 5521 | (void)variant;; | - | ||||||||||||||||||||||||||||||
| 5522 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5523 | - | |||||||||||||||||||||||||||||||
| 5524 | - | |||||||||||||||||||||||||||||||
| 5525 | - | |||||||||||||||||||||||||||||||
| 5526 | - | |||||||||||||||||||||||||||||||
| 5527 | QVariant QGraphicsPixmapItem::extension(const QVariant &variant) const | - | ||||||||||||||||||||||||||||||
| 5528 | { | - | ||||||||||||||||||||||||||||||
| 5529 | (void)variant;; | - | ||||||||||||||||||||||||||||||
| 5530 |     return never executed:   QVariant();return QVariant();never executed:  return QVariant(); | 0 | ||||||||||||||||||||||||||||||
| 5531 | } | - | ||||||||||||||||||||||||||||||
| 5532 | class QGraphicsTextItemPrivate | - | ||||||||||||||||||||||||||||||
| 5533 | { | - | ||||||||||||||||||||||||||||||
| 5534 | public: | - | ||||||||||||||||||||||||||||||
| 5535 | QGraphicsTextItemPrivate() | - | ||||||||||||||||||||||||||||||
| 5536 | : control(0), pageNumber(0), useDefaultImpl(false), tabChangesFocus(false), clickCausedFocus(0) | - | ||||||||||||||||||||||||||||||
| 5537 |     { } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5538 | - | |||||||||||||||||||||||||||||||
| 5539 | mutable QWidgetTextControl *control; | - | ||||||||||||||||||||||||||||||
| 5540 | QWidgetTextControl *textControl() const; | - | ||||||||||||||||||||||||||||||
| 5541 | - | |||||||||||||||||||||||||||||||
| 5542 | inline QPointF controlOffset() const | - | ||||||||||||||||||||||||||||||
| 5543 |     { return never executed:   QPointF(0., pageNumber * control->document()->pageSize().height());return QPointF(0., pageNumber * control->document()->pageSize().height());never executed:   }return QPointF(0., pageNumber * control->document()->pageSize().height()); | 0 | ||||||||||||||||||||||||||||||
| 5544 | inline void sendControlEvent(QEvent *e) | - | ||||||||||||||||||||||||||||||
| 5545 |     { if (control
 never executed:   }control->processEvent(e, controlOffset());never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5546 | - | |||||||||||||||||||||||||||||||
| 5547 | void _q_updateBoundingRect(const QSizeF &); | - | ||||||||||||||||||||||||||||||
| 5548 | void _q_update(QRectF); | - | ||||||||||||||||||||||||||||||
| 5549 | void _q_ensureVisible(QRectF); | - | ||||||||||||||||||||||||||||||
| 5550 | bool _q_mouseOnEdge(QGraphicsSceneMouseEvent *); | - | ||||||||||||||||||||||||||||||
| 5551 | - | |||||||||||||||||||||||||||||||
| 5552 | QRectF boundingRect; | - | ||||||||||||||||||||||||||||||
| 5553 | int pageNumber; | - | ||||||||||||||||||||||||||||||
| 5554 | bool useDefaultImpl; | - | ||||||||||||||||||||||||||||||
| 5555 | bool tabChangesFocus; | - | ||||||||||||||||||||||||||||||
| 5556 | - | |||||||||||||||||||||||||||||||
| 5557 | uint clickCausedFocus : 1; | - | ||||||||||||||||||||||||||||||
| 5558 | - | |||||||||||||||||||||||||||||||
| 5559 | QGraphicsTextItem *qq; | - | ||||||||||||||||||||||||||||||
| 5560 | }; | - | ||||||||||||||||||||||||||||||
| 5561 | QGraphicsTextItem::QGraphicsTextItem(const QString &text, QGraphicsItem *parent) | - | ||||||||||||||||||||||||||||||
| 5562 | : QGraphicsObject(*new QGraphicsItemPrivate, parent), | - | ||||||||||||||||||||||||||||||
| 5563 | dd(new QGraphicsTextItemPrivate) | - | ||||||||||||||||||||||||||||||
| 5564 | { | - | ||||||||||||||||||||||||||||||
| 5565 | dd->qq = this; | - | ||||||||||||||||||||||||||||||
| 5566 |     if (!text.isEmpty()
  | 0 | ||||||||||||||||||||||||||||||
| 5567 |         setPlainText(text); never executed:  setPlainText(text); | 0 | ||||||||||||||||||||||||||||||
| 5568 | setAcceptDrops(true); | - | ||||||||||||||||||||||||||||||
| 5569 | setAcceptHoverEvents(true); | - | ||||||||||||||||||||||||||||||
| 5570 | setFlags(ItemUsesExtendedStyleOption); | - | ||||||||||||||||||||||||||||||
| 5571 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5572 | - | |||||||||||||||||||||||||||||||
| 5573 | - | |||||||||||||||||||||||||||||||
| 5574 | - | |||||||||||||||||||||||||||||||
| 5575 | - | |||||||||||||||||||||||||||||||
| 5576 | - | |||||||||||||||||||||||||||||||
| 5577 | - | |||||||||||||||||||||||||||||||
| 5578 | - | |||||||||||||||||||||||||||||||
| 5579 | QGraphicsTextItem::QGraphicsTextItem(QGraphicsItem *parent) | - | ||||||||||||||||||||||||||||||
| 5580 | : QGraphicsObject(*new QGraphicsItemPrivate, parent), | - | ||||||||||||||||||||||||||||||
| 5581 | dd(new QGraphicsTextItemPrivate) | - | ||||||||||||||||||||||||||||||
| 5582 | { | - | ||||||||||||||||||||||||||||||
| 5583 | dd->qq = this; | - | ||||||||||||||||||||||||||||||
| 5584 | setAcceptDrops(true); | - | ||||||||||||||||||||||||||||||
| 5585 | setAcceptHoverEvents(true); | - | ||||||||||||||||||||||||||||||
| 5586 | setFlag(ItemUsesExtendedStyleOption); | - | ||||||||||||||||||||||||||||||
| 5587 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5588 | - | |||||||||||||||||||||||||||||||
| 5589 | - | |||||||||||||||||||||||||||||||
| 5590 | - | |||||||||||||||||||||||||||||||
| 5591 | - | |||||||||||||||||||||||||||||||
| 5592 | QGraphicsTextItem::~QGraphicsTextItem() | - | ||||||||||||||||||||||||||||||
| 5593 | { | - | ||||||||||||||||||||||||||||||
| 5594 | delete dd; | - | ||||||||||||||||||||||||||||||
| 5595 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5596 | - | |||||||||||||||||||||||||||||||
| 5597 | - | |||||||||||||||||||||||||||||||
| 5598 | - | |||||||||||||||||||||||||||||||
| 5599 | - | |||||||||||||||||||||||||||||||
| 5600 | - | |||||||||||||||||||||||||||||||
| 5601 | - | |||||||||||||||||||||||||||||||
| 5602 | QString QGraphicsTextItem::toHtml() const | - | ||||||||||||||||||||||||||||||
| 5603 | { | - | ||||||||||||||||||||||||||||||
| 5604 | - | |||||||||||||||||||||||||||||||
| 5605 |     if (dd->control
  | 0 | ||||||||||||||||||||||||||||||
| 5606 |         return never executed:   dd->control->toHtml();return dd->control->toHtml();never executed:  return dd->control->toHtml(); | 0 | ||||||||||||||||||||||||||||||
| 5607 | - | |||||||||||||||||||||||||||||||
| 5608 |     return never executed:   QString();return QString();never executed:  return QString(); | 0 | ||||||||||||||||||||||||||||||
| 5609 | } | - | ||||||||||||||||||||||||||||||
| 5610 | void QGraphicsTextItem::setHtml(const QString &text) | - | ||||||||||||||||||||||||||||||
| 5611 | { | - | ||||||||||||||||||||||||||||||
| 5612 | dd->textControl()->setHtml(text); | - | ||||||||||||||||||||||||||||||
| 5613 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5614 | - | |||||||||||||||||||||||||||||||
| 5615 | - | |||||||||||||||||||||||||||||||
| 5616 | - | |||||||||||||||||||||||||||||||
| 5617 | - | |||||||||||||||||||||||||||||||
| 5618 | - | |||||||||||||||||||||||||||||||
| 5619 | - | |||||||||||||||||||||||||||||||
| 5620 | QString QGraphicsTextItem::toPlainText() const | - | ||||||||||||||||||||||||||||||
| 5621 | { | - | ||||||||||||||||||||||||||||||
| 5622 |     if (dd->control
  | 0 | ||||||||||||||||||||||||||||||
| 5623 |         return never executed:   dd->control->toPlainText();return dd->control->toPlainText();never executed:  return dd->control->toPlainText(); | 0 | ||||||||||||||||||||||||||||||
| 5624 |     return never executed:   QString();return QString();never executed:  return QString(); | 0 | ||||||||||||||||||||||||||||||
| 5625 | } | - | ||||||||||||||||||||||||||||||
| 5626 | void QGraphicsTextItem::setPlainText(const QString &text) | - | ||||||||||||||||||||||||||||||
| 5627 | { | - | ||||||||||||||||||||||||||||||
| 5628 | dd->textControl()->setPlainText(text); | - | ||||||||||||||||||||||||||||||
| 5629 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5630 | - | |||||||||||||||||||||||||||||||
| 5631 | - | |||||||||||||||||||||||||||||||
| 5632 | - | |||||||||||||||||||||||||||||||
| 5633 | - | |||||||||||||||||||||||||||||||
| 5634 | - | |||||||||||||||||||||||||||||||
| 5635 | - | |||||||||||||||||||||||||||||||
| 5636 | QFont QGraphicsTextItem::font() const | - | ||||||||||||||||||||||||||||||
| 5637 | { | - | ||||||||||||||||||||||||||||||
| 5638 |     if (!dd->control
  | 0 | ||||||||||||||||||||||||||||||
| 5639 |         return never executed:   QFont();return QFont();never executed:  return QFont(); | 0 | ||||||||||||||||||||||||||||||
| 5640 |     return never executed:   dd->control->document()->defaultFont();return dd->control->document()->defaultFont();never executed:  return dd->control->document()->defaultFont(); | 0 | ||||||||||||||||||||||||||||||
| 5641 | } | - | ||||||||||||||||||||||||||||||
| 5642 | - | |||||||||||||||||||||||||||||||
| 5643 | - | |||||||||||||||||||||||||||||||
| 5644 | - | |||||||||||||||||||||||||||||||
| 5645 | - | |||||||||||||||||||||||||||||||
| 5646 | - | |||||||||||||||||||||||||||||||
| 5647 | - | |||||||||||||||||||||||||||||||
| 5648 | void QGraphicsTextItem::setFont(const QFont &font) | - | ||||||||||||||||||||||||||||||
| 5649 | { | - | ||||||||||||||||||||||||||||||
| 5650 | dd->textControl()->document()->setDefaultFont(font); | - | ||||||||||||||||||||||||||||||
| 5651 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5652 | - | |||||||||||||||||||||||||||||||
| 5653 | - | |||||||||||||||||||||||||||||||
| 5654 | - | |||||||||||||||||||||||||||||||
| 5655 | - | |||||||||||||||||||||||||||||||
| 5656 | void QGraphicsTextItem::setDefaultTextColor(const QColor &col) | - | ||||||||||||||||||||||||||||||
| 5657 | { | - | ||||||||||||||||||||||||||||||
| 5658 | QWidgetTextControl *c = dd->textControl(); | - | ||||||||||||||||||||||||||||||
| 5659 | QPalette pal = c->palette(); | - | ||||||||||||||||||||||||||||||
| 5660 | QColor old = pal.color(QPalette::Text); | - | ||||||||||||||||||||||||||||||
| 5661 | pal.setColor(QPalette::Text, col); | - | ||||||||||||||||||||||||||||||
| 5662 | c->setPalette(pal); | - | ||||||||||||||||||||||||||||||
| 5663 |     if (old != col
  | 0 | ||||||||||||||||||||||||||||||
| 5664 |         update(); never executed:  update(); | 0 | ||||||||||||||||||||||||||||||
| 5665 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5666 | - | |||||||||||||||||||||||||||||||
| 5667 | - | |||||||||||||||||||||||||||||||
| 5668 | - | |||||||||||||||||||||||||||||||
| 5669 | - | |||||||||||||||||||||||||||||||
| 5670 | QColor QGraphicsTextItem::defaultTextColor() const | - | ||||||||||||||||||||||||||||||
| 5671 | { | - | ||||||||||||||||||||||||||||||
| 5672 |     return never executed:   dd->textControl()->palette().color(QPalette::Text);return dd->textControl()->palette().color(QPalette::Text);never executed:  return dd->textControl()->palette().color(QPalette::Text); | 0 | ||||||||||||||||||||||||||||||
| 5673 | } | - | ||||||||||||||||||||||||||||||
| 5674 | - | |||||||||||||||||||||||||||||||
| 5675 | - | |||||||||||||||||||||||||||||||
| 5676 | - | |||||||||||||||||||||||||||||||
| 5677 | - | |||||||||||||||||||||||||||||||
| 5678 | QRectF QGraphicsTextItem::boundingRect() const | - | ||||||||||||||||||||||||||||||
| 5679 | { | - | ||||||||||||||||||||||||||||||
| 5680 |     return never executed:   dd->boundingRect;return dd->boundingRect;never executed:  return dd->boundingRect; | 0 | ||||||||||||||||||||||||||||||
| 5681 | } | - | ||||||||||||||||||||||||||||||
| 5682 | - | |||||||||||||||||||||||||||||||
| 5683 | - | |||||||||||||||||||||||||||||||
| 5684 | - | |||||||||||||||||||||||||||||||
| 5685 | - | |||||||||||||||||||||||||||||||
| 5686 | QPainterPath QGraphicsTextItem::shape() const | - | ||||||||||||||||||||||||||||||
| 5687 | { | - | ||||||||||||||||||||||||||||||
| 5688 |     if (!dd->control
  | 0 | ||||||||||||||||||||||||||||||
| 5689 |         return never executed:   QPainterPath();return QPainterPath();never executed:  return QPainterPath(); | 0 | ||||||||||||||||||||||||||||||
| 5690 | QPainterPath path; | - | ||||||||||||||||||||||||||||||
| 5691 | path.addRect(dd->boundingRect); | - | ||||||||||||||||||||||||||||||
| 5692 |     return never executed:   path;return path;never executed:  return path; | 0 | ||||||||||||||||||||||||||||||
| 5693 | } | - | ||||||||||||||||||||||||||||||
| 5694 | - | |||||||||||||||||||||||||||||||
| 5695 | - | |||||||||||||||||||||||||||||||
| 5696 | - | |||||||||||||||||||||||||||||||
| 5697 | - | |||||||||||||||||||||||||||||||
| 5698 | bool QGraphicsTextItem::contains(const QPointF &point) const | - | ||||||||||||||||||||||||||||||
| 5699 | { | - | ||||||||||||||||||||||||||||||
| 5700 |     return never executed:   dd->boundingRect.contains(point);return dd->boundingRect.contains(point);never executed:  return dd->boundingRect.contains(point); | 0 | ||||||||||||||||||||||||||||||
| 5701 | } | - | ||||||||||||||||||||||||||||||
| 5702 | - | |||||||||||||||||||||||||||||||
| 5703 | - | |||||||||||||||||||||||||||||||
| 5704 | - | |||||||||||||||||||||||||||||||
| 5705 | - | |||||||||||||||||||||||||||||||
| 5706 | void QGraphicsTextItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, | - | ||||||||||||||||||||||||||||||
| 5707 | QWidget *widget) | - | ||||||||||||||||||||||||||||||
| 5708 | { | - | ||||||||||||||||||||||||||||||
| 5709 | (void)widget;; | - | ||||||||||||||||||||||||||||||
| 5710 |     if (dd->control
  | 0 | ||||||||||||||||||||||||||||||
| 5711 | painter->save(); | - | ||||||||||||||||||||||||||||||
| 5712 | QRectF r = option->exposedRect; | - | ||||||||||||||||||||||||||||||
| 5713 | painter->translate(-dd->controlOffset()); | - | ||||||||||||||||||||||||||||||
| 5714 | r.translate(dd->controlOffset()); | - | ||||||||||||||||||||||||||||||
| 5715 | - | |||||||||||||||||||||||||||||||
| 5716 | QTextDocument *doc = dd->control->document(); | - | ||||||||||||||||||||||||||||||
| 5717 | QTextDocumentLayout *layout = qobject_cast<QTextDocumentLayout *>(doc->documentLayout()); | - | ||||||||||||||||||||||||||||||
| 5718 | - | |||||||||||||||||||||||||||||||
| 5719 | - | |||||||||||||||||||||||||||||||
| 5720 | - | |||||||||||||||||||||||||||||||
| 5721 |         if (layout
  | 0 | ||||||||||||||||||||||||||||||
| 5722 |             layout->setViewport(dd->boundingRect); never executed:  layout->setViewport(dd->boundingRect); | 0 | ||||||||||||||||||||||||||||||
| 5723 | - | |||||||||||||||||||||||||||||||
| 5724 | dd->control->drawContents(painter, r); | - | ||||||||||||||||||||||||||||||
| 5725 | - | |||||||||||||||||||||||||||||||
| 5726 |         if (layout
  | 0 | ||||||||||||||||||||||||||||||
| 5727 |             layout->setViewport(QRect()); never executed:  layout->setViewport(QRect()); | 0 | ||||||||||||||||||||||||||||||
| 5728 | - | |||||||||||||||||||||||||||||||
| 5729 | painter->restore(); | - | ||||||||||||||||||||||||||||||
| 5730 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5731 | - | |||||||||||||||||||||||||||||||
| 5732 |     if (option->state & (QStyle::State_Selected | QStyle::State_HasFocus)
  | 0 | ||||||||||||||||||||||||||||||
| 5733 |         qt_graphicsItem_highlightSelected(this, painter, option); never executed:  qt_graphicsItem_highlightSelected(this, painter, option); | 0 | ||||||||||||||||||||||||||||||
| 5734 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5735 | - | |||||||||||||||||||||||||||||||
| 5736 | - | |||||||||||||||||||||||||||||||
| 5737 | - | |||||||||||||||||||||||||||||||
| 5738 | - | |||||||||||||||||||||||||||||||
| 5739 | bool QGraphicsTextItem::isObscuredBy(const QGraphicsItem *item) const | - | ||||||||||||||||||||||||||||||
| 5740 | { | - | ||||||||||||||||||||||||||||||
| 5741 |     return never executed:   QGraphicsItem::isObscuredBy(item);return QGraphicsItem::isObscuredBy(item);never executed:  return QGraphicsItem::isObscuredBy(item); | 0 | ||||||||||||||||||||||||||||||
| 5742 | } | - | ||||||||||||||||||||||||||||||
| 5743 | - | |||||||||||||||||||||||||||||||
| 5744 | - | |||||||||||||||||||||||||||||||
| 5745 | - | |||||||||||||||||||||||||||||||
| 5746 | - | |||||||||||||||||||||||||||||||
| 5747 | QPainterPath QGraphicsTextItem::opaqueArea() const | - | ||||||||||||||||||||||||||||||
| 5748 | { | - | ||||||||||||||||||||||||||||||
| 5749 |     return never executed:   QGraphicsItem::opaqueArea();return QGraphicsItem::opaqueArea();never executed:  return QGraphicsItem::opaqueArea(); | 0 | ||||||||||||||||||||||||||||||
| 5750 | } | - | ||||||||||||||||||||||||||||||
| 5751 | - | |||||||||||||||||||||||||||||||
| 5752 | - | |||||||||||||||||||||||||||||||
| 5753 | - | |||||||||||||||||||||||||||||||
| 5754 | - | |||||||||||||||||||||||||||||||
| 5755 | int QGraphicsTextItem::type() const | - | ||||||||||||||||||||||||||||||
| 5756 | { | - | ||||||||||||||||||||||||||||||
| 5757 |     return never executed:   Type;return Type;never executed:  return Type; | 0 | ||||||||||||||||||||||||||||||
| 5758 | } | - | ||||||||||||||||||||||||||||||
| 5759 | void QGraphicsTextItem::setTextWidth(qreal width) | - | ||||||||||||||||||||||||||||||
| 5760 | { | - | ||||||||||||||||||||||||||||||
| 5761 | dd->textControl()->setTextWidth(width); | - | ||||||||||||||||||||||||||||||
| 5762 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5763 | qreal QGraphicsTextItem::textWidth() const | - | ||||||||||||||||||||||||||||||
| 5764 | { | - | ||||||||||||||||||||||||||||||
| 5765 |     if (!dd->control
  | 0 | ||||||||||||||||||||||||||||||
| 5766 |         return never executed:   -1;return -1;never executed:  return -1; | 0 | ||||||||||||||||||||||||||||||
| 5767 |     return never executed:   dd->control->textWidth();return dd->control->textWidth();never executed:  return dd->control->textWidth(); | 0 | ||||||||||||||||||||||||||||||
| 5768 | } | - | ||||||||||||||||||||||||||||||
| 5769 | - | |||||||||||||||||||||||||||||||
| 5770 | - | |||||||||||||||||||||||||||||||
| 5771 | - | |||||||||||||||||||||||||||||||
| 5772 | - | |||||||||||||||||||||||||||||||
| 5773 | void QGraphicsTextItem::adjustSize() | - | ||||||||||||||||||||||||||||||
| 5774 | { | - | ||||||||||||||||||||||||||||||
| 5775 |     if (dd->control
  | 0 | ||||||||||||||||||||||||||||||
| 5776 |         dd->control->adjustSize(); never executed:  dd->control->adjustSize(); | 0 | ||||||||||||||||||||||||||||||
| 5777 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5778 | - | |||||||||||||||||||||||||||||||
| 5779 | - | |||||||||||||||||||||||||||||||
| 5780 | - | |||||||||||||||||||||||||||||||
| 5781 | - | |||||||||||||||||||||||||||||||
| 5782 | void QGraphicsTextItem::setDocument(QTextDocument *document) | - | ||||||||||||||||||||||||||||||
| 5783 | { | - | ||||||||||||||||||||||||||||||
| 5784 | dd->textControl()->setDocument(document); | - | ||||||||||||||||||||||||||||||
| 5785 | dd->_q_updateBoundingRect(dd->control->size()); | - | ||||||||||||||||||||||||||||||
| 5786 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5787 | - | |||||||||||||||||||||||||||||||
| 5788 | - | |||||||||||||||||||||||||||||||
| 5789 | - | |||||||||||||||||||||||||||||||
| 5790 | - | |||||||||||||||||||||||||||||||
| 5791 | QTextDocument *QGraphicsTextItem::document() const | - | ||||||||||||||||||||||||||||||
| 5792 | { | - | ||||||||||||||||||||||||||||||
| 5793 |     return never executed:   dd->textControl()->document();return dd->textControl()->document();never executed:  return dd->textControl()->document(); | 0 | ||||||||||||||||||||||||||||||
| 5794 | } | - | ||||||||||||||||||||||||||||||
| 5795 | - | |||||||||||||||||||||||||||||||
| 5796 | - | |||||||||||||||||||||||||||||||
| 5797 | - | |||||||||||||||||||||||||||||||
| 5798 | - | |||||||||||||||||||||||||||||||
| 5799 | bool QGraphicsTextItem::sceneEvent(QEvent *event) | - | ||||||||||||||||||||||||||||||
| 5800 | { | - | ||||||||||||||||||||||||||||||
| 5801 | QEvent::Type t = event->type(); | - | ||||||||||||||||||||||||||||||
| 5802 |     if (!dd->tabChangesFocus
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 5803 | int k = ((QKeyEvent *)event)->key(); | - | ||||||||||||||||||||||||||||||
| 5804 |         if (k == Qt::Key_Tab
 
  | 0 | ||||||||||||||||||||||||||||||
| 5805 | dd->sendControlEvent(event); | - | ||||||||||||||||||||||||||||||
| 5806 |             return never executed:   true;return true;never executed:  return true; | 0 | ||||||||||||||||||||||||||||||
| 5807 | } | - | ||||||||||||||||||||||||||||||
| 5808 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5809 | bool result = QGraphicsItem::sceneEvent(event); | - | ||||||||||||||||||||||||||||||
| 5810 | - | |||||||||||||||||||||||||||||||
| 5811 | - | |||||||||||||||||||||||||||||||
| 5812 | switch (event->type()) { | - | ||||||||||||||||||||||||||||||
| 5813 |     case never executed:   QEvent::ContextMenu:case QEvent::ContextMenu:never executed:  case QEvent::ContextMenu: | 0 | ||||||||||||||||||||||||||||||
| 5814 |     case never executed:   QEvent::FocusIn:case QEvent::FocusIn:never executed:  case QEvent::FocusIn: | 0 | ||||||||||||||||||||||||||||||
| 5815 |     case never executed:   QEvent::FocusOut:case QEvent::FocusOut:never executed:  case QEvent::FocusOut: | 0 | ||||||||||||||||||||||||||||||
| 5816 |     case never executed:   QEvent::GraphicsSceneDragEnter:case QEvent::GraphicsSceneDragEnter:never executed:  case QEvent::GraphicsSceneDragEnter: | 0 | ||||||||||||||||||||||||||||||
| 5817 |     case never executed:   QEvent::GraphicsSceneDragLeave:case QEvent::GraphicsSceneDragLeave:never executed:  case QEvent::GraphicsSceneDragLeave: | 0 | ||||||||||||||||||||||||||||||
| 5818 |     case never executed:   QEvent::GraphicsSceneDragMove:case QEvent::GraphicsSceneDragMove:never executed:  case QEvent::GraphicsSceneDragMove: | 0 | ||||||||||||||||||||||||||||||
| 5819 |     case never executed:   QEvent::GraphicsSceneDrop:case QEvent::GraphicsSceneDrop:never executed:  case QEvent::GraphicsSceneDrop: | 0 | ||||||||||||||||||||||||||||||
| 5820 |     case never executed:   QEvent::GraphicsSceneHoverEnter:case QEvent::GraphicsSceneHoverEnter:never executed:  case QEvent::GraphicsSceneHoverEnter: | 0 | ||||||||||||||||||||||||||||||
| 5821 |     case never executed:   QEvent::GraphicsSceneHoverLeave:case QEvent::GraphicsSceneHoverLeave:never executed:  case QEvent::GraphicsSceneHoverLeave: | 0 | ||||||||||||||||||||||||||||||
| 5822 |     case never executed:   QEvent::GraphicsSceneHoverMove:case QEvent::GraphicsSceneHoverMove:never executed:  case QEvent::GraphicsSceneHoverMove: | 0 | ||||||||||||||||||||||||||||||
| 5823 |     case never executed:   QEvent::GraphicsSceneMouseDoubleClick:case QEvent::GraphicsSceneMouseDoubleClick:never executed:  case QEvent::GraphicsSceneMouseDoubleClick: | 0 | ||||||||||||||||||||||||||||||
| 5824 |     case never executed:   QEvent::GraphicsSceneMousePress:case QEvent::GraphicsSceneMousePress:never executed:  case QEvent::GraphicsSceneMousePress: | 0 | ||||||||||||||||||||||||||||||
| 5825 |     case never executed:   QEvent::GraphicsSceneMouseMove:case QEvent::GraphicsSceneMouseMove:never executed:  case QEvent::GraphicsSceneMouseMove: | 0 | ||||||||||||||||||||||||||||||
| 5826 |     case never executed:   QEvent::GraphicsSceneMouseRelease:case QEvent::GraphicsSceneMouseRelease:never executed:  case QEvent::GraphicsSceneMouseRelease: | 0 | ||||||||||||||||||||||||||||||
| 5827 |     case never executed:   QEvent::KeyPress:case QEvent::KeyPress:never executed:  case QEvent::KeyPress: | 0 | ||||||||||||||||||||||||||||||
| 5828 |     case never executed:   QEvent::KeyRelease:case QEvent::KeyRelease:never executed:  case QEvent::KeyRelease: | 0 | ||||||||||||||||||||||||||||||
| 5829 | - | |||||||||||||||||||||||||||||||
| 5830 | - | |||||||||||||||||||||||||||||||
| 5831 |         if (event->type() == QEvent::FocusIn
 
  | 0 | ||||||||||||||||||||||||||||||
| 5832 | QGuiApplication::inputMethod()->reset(); | - | ||||||||||||||||||||||||||||||
| 5833 |         } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||
| 5834 | QGuiApplication::inputMethod()->update(Qt::ImQueryInput); | - | ||||||||||||||||||||||||||||||
| 5835 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5836 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 5837 |     case never executed:   QEvent::ShortcutOverride:case QEvent::ShortcutOverride:never executed:  case QEvent::ShortcutOverride: | 0 | ||||||||||||||||||||||||||||||
| 5838 | dd->sendControlEvent(event); | - | ||||||||||||||||||||||||||||||
| 5839 |         return never executed:   true;return true;never executed:  return true; | 0 | ||||||||||||||||||||||||||||||
| 5840 |     default never executed:  :default:never executed:  default: | 0 | ||||||||||||||||||||||||||||||
| 5841 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 5842 | } | - | ||||||||||||||||||||||||||||||
| 5843 | - | |||||||||||||||||||||||||||||||
| 5844 |     return never executed:   result;return result;never executed:  return result; | 0 | ||||||||||||||||||||||||||||||
| 5845 | } | - | ||||||||||||||||||||||||||||||
| 5846 | - | |||||||||||||||||||||||||||||||
| 5847 | - | |||||||||||||||||||||||||||||||
| 5848 | - | |||||||||||||||||||||||||||||||
| 5849 | - | |||||||||||||||||||||||||||||||
| 5850 | void QGraphicsTextItem::mousePressEvent(QGraphicsSceneMouseEvent *event) | - | ||||||||||||||||||||||||||||||
| 5851 | { | - | ||||||||||||||||||||||||||||||
| 5852 |     if ((
 
  | 0 | ||||||||||||||||||||||||||||||
| 5853 |         && (
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 5854 | - | |||||||||||||||||||||||||||||||
| 5855 | - | |||||||||||||||||||||||||||||||
| 5856 | dd->useDefaultImpl = true; | - | ||||||||||||||||||||||||||||||
| 5857 |     } never executed:   else if (event->buttons() == event->button()end of block
  | 0 | ||||||||||||||||||||||||||||||
| 5858 |                && dd->control->textInteractionFlags() == Qt::NoTextInteraction
  | 0 | ||||||||||||||||||||||||||||||
| 5859 | - | |||||||||||||||||||||||||||||||
| 5860 | dd->useDefaultImpl = true; | - | ||||||||||||||||||||||||||||||
| 5861 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5862 |     if (dd->useDefaultImpl
  | 0 | ||||||||||||||||||||||||||||||
| 5863 | QGraphicsItem::mousePressEvent(event); | - | ||||||||||||||||||||||||||||||
| 5864 |         if (!event->isAccepted()
  | 0 | ||||||||||||||||||||||||||||||
| 5865 |             dd->useDefaultImpl = false; never executed:  dd->useDefaultImpl = false; | 0 | ||||||||||||||||||||||||||||||
| 5866 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 5867 | } | - | ||||||||||||||||||||||||||||||
| 5868 | - | |||||||||||||||||||||||||||||||
| 5869 | dd->sendControlEvent(event); | - | ||||||||||||||||||||||||||||||
| 5870 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5871 | - | |||||||||||||||||||||||||||||||
| 5872 | - | |||||||||||||||||||||||||||||||
| 5873 | - | |||||||||||||||||||||||||||||||
| 5874 | - | |||||||||||||||||||||||||||||||
| 5875 | void QGraphicsTextItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event) | - | ||||||||||||||||||||||||||||||
| 5876 | { | - | ||||||||||||||||||||||||||||||
| 5877 |     if (dd->useDefaultImpl
  | 0 | ||||||||||||||||||||||||||||||
| 5878 | QGraphicsItem::mouseMoveEvent(event); | - | ||||||||||||||||||||||||||||||
| 5879 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 5880 | } | - | ||||||||||||||||||||||||||||||
| 5881 | - | |||||||||||||||||||||||||||||||
| 5882 | dd->sendControlEvent(event); | - | ||||||||||||||||||||||||||||||
| 5883 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5884 | - | |||||||||||||||||||||||||||||||
| 5885 | - | |||||||||||||||||||||||||||||||
| 5886 | - | |||||||||||||||||||||||||||||||
| 5887 | - | |||||||||||||||||||||||||||||||
| 5888 | void QGraphicsTextItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) | - | ||||||||||||||||||||||||||||||
| 5889 | { | - | ||||||||||||||||||||||||||||||
| 5890 |     if (dd->useDefaultImpl
  | 0 | ||||||||||||||||||||||||||||||
| 5891 | QGraphicsItem::mouseReleaseEvent(event); | - | ||||||||||||||||||||||||||||||
| 5892 |         if (dd->control->textInteractionFlags() == Qt::NoTextInteraction
  | 0 | ||||||||||||||||||||||||||||||
| 5893 |             && !event->buttons()
  | 0 | ||||||||||||||||||||||||||||||
| 5894 | - | |||||||||||||||||||||||||||||||
| 5895 | dd->useDefaultImpl = false; | - | ||||||||||||||||||||||||||||||
| 5896 |         } never executed:   else if ((end of block
 
  | 0 | ||||||||||||||||||||||||||||||
| 5897 | - | |||||||||||||||||||||||||||||||
| 5898 | dd->useDefaultImpl = false; | - | ||||||||||||||||||||||||||||||
| 5899 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5900 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 5901 | } | - | ||||||||||||||||||||||||||||||
| 5902 | - | |||||||||||||||||||||||||||||||
| 5903 | QWidget *widget = event->widget(); | - | ||||||||||||||||||||||||||||||
| 5904 |     if (widget
 
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 5905 | qt_widget_private(widget)->handleSoftwareInputPanel(event->button(), dd->clickCausedFocus); | - | ||||||||||||||||||||||||||||||
| 5906 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5907 | dd->clickCausedFocus = 0; | - | ||||||||||||||||||||||||||||||
| 5908 | dd->sendControlEvent(event); | - | ||||||||||||||||||||||||||||||
| 5909 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5910 | - | |||||||||||||||||||||||||||||||
| 5911 | - | |||||||||||||||||||||||||||||||
| 5912 | - | |||||||||||||||||||||||||||||||
| 5913 | - | |||||||||||||||||||||||||||||||
| 5914 | void QGraphicsTextItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) | - | ||||||||||||||||||||||||||||||
| 5915 | { | - | ||||||||||||||||||||||||||||||
| 5916 |     if (dd->useDefaultImpl
  | 0 | ||||||||||||||||||||||||||||||
| 5917 | QGraphicsItem::mouseDoubleClickEvent(event); | - | ||||||||||||||||||||||||||||||
| 5918 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 5919 | } | - | ||||||||||||||||||||||||||||||
| 5920 | - | |||||||||||||||||||||||||||||||
| 5921 |     if (!hasFocus()
  | 0 | ||||||||||||||||||||||||||||||
| 5922 | QGraphicsItem::mouseDoubleClickEvent(event); | - | ||||||||||||||||||||||||||||||
| 5923 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 5924 | } | - | ||||||||||||||||||||||||||||||
| 5925 | - | |||||||||||||||||||||||||||||||
| 5926 | dd->sendControlEvent(event); | - | ||||||||||||||||||||||||||||||
| 5927 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5928 | - | |||||||||||||||||||||||||||||||
| 5929 | - | |||||||||||||||||||||||||||||||
| 5930 | - | |||||||||||||||||||||||||||||||
| 5931 | - | |||||||||||||||||||||||||||||||
| 5932 | void QGraphicsTextItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) | - | ||||||||||||||||||||||||||||||
| 5933 | { | - | ||||||||||||||||||||||||||||||
| 5934 | dd->sendControlEvent(event); | - | ||||||||||||||||||||||||||||||
| 5935 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5936 | - | |||||||||||||||||||||||||||||||
| 5937 | - | |||||||||||||||||||||||||||||||
| 5938 | - | |||||||||||||||||||||||||||||||
| 5939 | - | |||||||||||||||||||||||||||||||
| 5940 | void QGraphicsTextItem::keyPressEvent(QKeyEvent *event) | - | ||||||||||||||||||||||||||||||
| 5941 | { | - | ||||||||||||||||||||||||||||||
| 5942 | dd->sendControlEvent(event); | - | ||||||||||||||||||||||||||||||
| 5943 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5944 | - | |||||||||||||||||||||||||||||||
| 5945 | - | |||||||||||||||||||||||||||||||
| 5946 | - | |||||||||||||||||||||||||||||||
| 5947 | - | |||||||||||||||||||||||||||||||
| 5948 | void QGraphicsTextItem::keyReleaseEvent(QKeyEvent *event) | - | ||||||||||||||||||||||||||||||
| 5949 | { | - | ||||||||||||||||||||||||||||||
| 5950 | dd->sendControlEvent(event); | - | ||||||||||||||||||||||||||||||
| 5951 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5952 | - | |||||||||||||||||||||||||||||||
| 5953 | - | |||||||||||||||||||||||||||||||
| 5954 | - | |||||||||||||||||||||||||||||||
| 5955 | - | |||||||||||||||||||||||||||||||
| 5956 | void QGraphicsTextItem::focusInEvent(QFocusEvent *event) | - | ||||||||||||||||||||||||||||||
| 5957 | { | - | ||||||||||||||||||||||||||||||
| 5958 | dd->sendControlEvent(event); | - | ||||||||||||||||||||||||||||||
| 5959 |     if (event->reason() == Qt::MouseFocusReason
  | 0 | ||||||||||||||||||||||||||||||
| 5960 | dd->clickCausedFocus = 1; | - | ||||||||||||||||||||||||||||||
| 5961 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5962 | update(); | - | ||||||||||||||||||||||||||||||
| 5963 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5964 | - | |||||||||||||||||||||||||||||||
| 5965 | - | |||||||||||||||||||||||||||||||
| 5966 | - | |||||||||||||||||||||||||||||||
| 5967 | - | |||||||||||||||||||||||||||||||
| 5968 | void QGraphicsTextItem::focusOutEvent(QFocusEvent *event) | - | ||||||||||||||||||||||||||||||
| 5969 | { | - | ||||||||||||||||||||||||||||||
| 5970 | dd->sendControlEvent(event); | - | ||||||||||||||||||||||||||||||
| 5971 | update(); | - | ||||||||||||||||||||||||||||||
| 5972 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5973 | - | |||||||||||||||||||||||||||||||
| 5974 | - | |||||||||||||||||||||||||||||||
| 5975 | - | |||||||||||||||||||||||||||||||
| 5976 | - | |||||||||||||||||||||||||||||||
| 5977 | void QGraphicsTextItem::dragEnterEvent(QGraphicsSceneDragDropEvent *event) | - | ||||||||||||||||||||||||||||||
| 5978 | { | - | ||||||||||||||||||||||||||||||
| 5979 | dd->sendControlEvent(event); | - | ||||||||||||||||||||||||||||||
| 5980 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5981 | - | |||||||||||||||||||||||||||||||
| 5982 | - | |||||||||||||||||||||||||||||||
| 5983 | - | |||||||||||||||||||||||||||||||
| 5984 | - | |||||||||||||||||||||||||||||||
| 5985 | void QGraphicsTextItem::dragLeaveEvent(QGraphicsSceneDragDropEvent *event) | - | ||||||||||||||||||||||||||||||
| 5986 | { | - | ||||||||||||||||||||||||||||||
| 5987 | dd->sendControlEvent(event); | - | ||||||||||||||||||||||||||||||
| 5988 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5989 | - | |||||||||||||||||||||||||||||||
| 5990 | - | |||||||||||||||||||||||||||||||
| 5991 | - | |||||||||||||||||||||||||||||||
| 5992 | - | |||||||||||||||||||||||||||||||
| 5993 | void QGraphicsTextItem::dragMoveEvent(QGraphicsSceneDragDropEvent *event) | - | ||||||||||||||||||||||||||||||
| 5994 | { | - | ||||||||||||||||||||||||||||||
| 5995 | dd->sendControlEvent(event); | - | ||||||||||||||||||||||||||||||
| 5996 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 5997 | - | |||||||||||||||||||||||||||||||
| 5998 | - | |||||||||||||||||||||||||||||||
| 5999 | - | |||||||||||||||||||||||||||||||
| 6000 | - | |||||||||||||||||||||||||||||||
| 6001 | void QGraphicsTextItem::dropEvent(QGraphicsSceneDragDropEvent *event) | - | ||||||||||||||||||||||||||||||
| 6002 | { | - | ||||||||||||||||||||||||||||||
| 6003 | dd->sendControlEvent(event); | - | ||||||||||||||||||||||||||||||
| 6004 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6005 | - | |||||||||||||||||||||||||||||||
| 6006 | - | |||||||||||||||||||||||||||||||
| 6007 | - | |||||||||||||||||||||||||||||||
| 6008 | - | |||||||||||||||||||||||||||||||
| 6009 | void QGraphicsTextItem::inputMethodEvent(QInputMethodEvent *event) | - | ||||||||||||||||||||||||||||||
| 6010 | { | - | ||||||||||||||||||||||||||||||
| 6011 | dd->sendControlEvent(event); | - | ||||||||||||||||||||||||||||||
| 6012 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6013 | - | |||||||||||||||||||||||||||||||
| 6014 | - | |||||||||||||||||||||||||||||||
| 6015 | - | |||||||||||||||||||||||||||||||
| 6016 | - | |||||||||||||||||||||||||||||||
| 6017 | void QGraphicsTextItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event) | - | ||||||||||||||||||||||||||||||
| 6018 | { | - | ||||||||||||||||||||||||||||||
| 6019 | dd->sendControlEvent(event); | - | ||||||||||||||||||||||||||||||
| 6020 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6021 | - | |||||||||||||||||||||||||||||||
| 6022 | - | |||||||||||||||||||||||||||||||
| 6023 | - | |||||||||||||||||||||||||||||||
| 6024 | - | |||||||||||||||||||||||||||||||
| 6025 | void QGraphicsTextItem::hoverMoveEvent(QGraphicsSceneHoverEvent *event) | - | ||||||||||||||||||||||||||||||
| 6026 | { | - | ||||||||||||||||||||||||||||||
| 6027 | dd->sendControlEvent(event); | - | ||||||||||||||||||||||||||||||
| 6028 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6029 | - | |||||||||||||||||||||||||||||||
| 6030 | - | |||||||||||||||||||||||||||||||
| 6031 | - | |||||||||||||||||||||||||||||||
| 6032 | - | |||||||||||||||||||||||||||||||
| 6033 | void QGraphicsTextItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) | - | ||||||||||||||||||||||||||||||
| 6034 | { | - | ||||||||||||||||||||||||||||||
| 6035 | dd->sendControlEvent(event); | - | ||||||||||||||||||||||||||||||
| 6036 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6037 | - | |||||||||||||||||||||||||||||||
| 6038 | - | |||||||||||||||||||||||||||||||
| 6039 | - | |||||||||||||||||||||||||||||||
| 6040 | - | |||||||||||||||||||||||||||||||
| 6041 | QVariant QGraphicsTextItem::inputMethodQuery(Qt::InputMethodQuery query) const | - | ||||||||||||||||||||||||||||||
| 6042 | { | - | ||||||||||||||||||||||||||||||
| 6043 | QVariant v; | - | ||||||||||||||||||||||||||||||
| 6044 |     if (query == Qt::ImHints
  | 0 | ||||||||||||||||||||||||||||||
| 6045 |         v = int(inputMethodHints()); never executed:  v = int(inputMethodHints()); | 0 | ||||||||||||||||||||||||||||||
| 6046 |     else if (dd->control
  | 0 | ||||||||||||||||||||||||||||||
| 6047 |         v = dd->control->inputMethodQuery(query, QVariant()); never executed:  v = dd->control->inputMethodQuery(query, QVariant()); | 0 | ||||||||||||||||||||||||||||||
| 6048 |     if (v.type() == QVariant::RectF
  | 0 | ||||||||||||||||||||||||||||||
| 6049 |         v = v.toRectF().translated(-dd->controlOffset()); never executed:  v = v.toRectF().translated(-dd->controlOffset()); | 0 | ||||||||||||||||||||||||||||||
| 6050 |     else if (v.type() == QVariant::PointF
  | 0 | ||||||||||||||||||||||||||||||
| 6051 |         v = v.toPointF() - dd->controlOffset(); never executed:  v = v.toPointF() - dd->controlOffset(); | 0 | ||||||||||||||||||||||||||||||
| 6052 |     else if (v.type() == QVariant::Rect
  | 0 | ||||||||||||||||||||||||||||||
| 6053 |         v = v.toRect().translated(-dd->controlOffset().toPoint()); never executed:  v = v.toRect().translated(-dd->controlOffset().toPoint()); | 0 | ||||||||||||||||||||||||||||||
| 6054 |     else if (v.type() == QVariant::Point
  | 0 | ||||||||||||||||||||||||||||||
| 6055 |         v = v.toPoint() - dd->controlOffset().toPoint(); never executed:  v = v.toPoint() - dd->controlOffset().toPoint(); | 0 | ||||||||||||||||||||||||||||||
| 6056 |     return never executed:   v;return v;never executed:  return v; | 0 | ||||||||||||||||||||||||||||||
| 6057 | } | - | ||||||||||||||||||||||||||||||
| 6058 | - | |||||||||||||||||||||||||||||||
| 6059 | - | |||||||||||||||||||||||||||||||
| 6060 | - | |||||||||||||||||||||||||||||||
| 6061 | - | |||||||||||||||||||||||||||||||
| 6062 | bool QGraphicsTextItem::supportsExtension(Extension extension) const | - | ||||||||||||||||||||||||||||||
| 6063 | { | - | ||||||||||||||||||||||||||||||
| 6064 | (void)extension;; | - | ||||||||||||||||||||||||||||||
| 6065 |     return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||
| 6066 | } | - | ||||||||||||||||||||||||||||||
| 6067 | - | |||||||||||||||||||||||||||||||
| 6068 | - | |||||||||||||||||||||||||||||||
| 6069 | - | |||||||||||||||||||||||||||||||
| 6070 | - | |||||||||||||||||||||||||||||||
| 6071 | void QGraphicsTextItem::setExtension(Extension extension, const QVariant &variant) | - | ||||||||||||||||||||||||||||||
| 6072 | { | - | ||||||||||||||||||||||||||||||
| 6073 | (void)extension;; | - | ||||||||||||||||||||||||||||||
| 6074 | (void)variant;; | - | ||||||||||||||||||||||||||||||
| 6075 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6076 | - | |||||||||||||||||||||||||||||||
| 6077 | - | |||||||||||||||||||||||||||||||
| 6078 | - | |||||||||||||||||||||||||||||||
| 6079 | - | |||||||||||||||||||||||||||||||
| 6080 | QVariant QGraphicsTextItem::extension(const QVariant &variant) const | - | ||||||||||||||||||||||||||||||
| 6081 | { | - | ||||||||||||||||||||||||||||||
| 6082 | (void)variant;; | - | ||||||||||||||||||||||||||||||
| 6083 |     return never executed:   QVariant();return QVariant();never executed:  return QVariant(); | 0 | ||||||||||||||||||||||||||||||
| 6084 | } | - | ||||||||||||||||||||||||||||||
| 6085 | - | |||||||||||||||||||||||||||||||
| 6086 | - | |||||||||||||||||||||||||||||||
| 6087 | - | |||||||||||||||||||||||||||||||
| 6088 | - | |||||||||||||||||||||||||||||||
| 6089 | void QGraphicsTextItemPrivate::_q_update(QRectF rect) | - | ||||||||||||||||||||||||||||||
| 6090 | { | - | ||||||||||||||||||||||||||||||
| 6091 |     if (rect.isValid()
  | 0 | ||||||||||||||||||||||||||||||
| 6092 | rect.translate(-controlOffset()); | - | ||||||||||||||||||||||||||||||
| 6093 |     } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||
| 6094 | rect = boundingRect; | - | ||||||||||||||||||||||||||||||
| 6095 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6096 |     if (rect.intersects(boundingRect)
  | 0 | ||||||||||||||||||||||||||||||
| 6097 |         qq->update(rect); never executed:  qq->update(rect); | 0 | ||||||||||||||||||||||||||||||
| 6098 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6099 | - | |||||||||||||||||||||||||||||||
| 6100 | - | |||||||||||||||||||||||||||||||
| 6101 | - | |||||||||||||||||||||||||||||||
| 6102 | - | |||||||||||||||||||||||||||||||
| 6103 | void QGraphicsTextItemPrivate::_q_updateBoundingRect(const QSizeF &size) | - | ||||||||||||||||||||||||||||||
| 6104 | { | - | ||||||||||||||||||||||||||||||
| 6105 |     if (!control
 never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 6106 | const QSizeF pageSize = control->document()->pageSize(); | - | ||||||||||||||||||||||||||||||
| 6107 | - | |||||||||||||||||||||||||||||||
| 6108 |     if (size == boundingRect.size()
 
  | 0 | ||||||||||||||||||||||||||||||
| 6109 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 6110 | qq->prepareGeometryChange(); | - | ||||||||||||||||||||||||||||||
| 6111 | boundingRect.setSize(size); | - | ||||||||||||||||||||||||||||||
| 6112 | qq->update(); | - | ||||||||||||||||||||||||||||||
| 6113 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6114 | - | |||||||||||||||||||||||||||||||
| 6115 | - | |||||||||||||||||||||||||||||||
| 6116 | - | |||||||||||||||||||||||||||||||
| 6117 | - | |||||||||||||||||||||||||||||||
| 6118 | void QGraphicsTextItemPrivate::_q_ensureVisible(QRectF rect) | - | ||||||||||||||||||||||||||||||
| 6119 | { | - | ||||||||||||||||||||||||||||||
| 6120 |     if (qq->hasFocus()
  | 0 | ||||||||||||||||||||||||||||||
| 6121 | rect.translate(-controlOffset()); | - | ||||||||||||||||||||||||||||||
| 6122 | qq->ensureVisible(rect, 0, 0); | - | ||||||||||||||||||||||||||||||
| 6123 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6124 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6125 | - | |||||||||||||||||||||||||||||||
| 6126 | QWidgetTextControl *QGraphicsTextItemPrivate::textControl() const | - | ||||||||||||||||||||||||||||||
| 6127 | { | - | ||||||||||||||||||||||||||||||
| 6128 |     if (!control
  | 0 | ||||||||||||||||||||||||||||||
| 6129 | QGraphicsTextItem *that = const_cast<QGraphicsTextItem *>(qq); | - | ||||||||||||||||||||||||||||||
| 6130 | control = new QWidgetTextControl(that); | - | ||||||||||||||||||||||||||||||
| 6131 | control->setTextInteractionFlags(Qt::NoTextInteraction); | - | ||||||||||||||||||||||||||||||
| 6132 | - | |||||||||||||||||||||||||||||||
| 6133 | QObject::connect(control, qFlagLocation("2""updateRequest(QRectF)" "\0" __FILE__ ":" "10448"), | - | ||||||||||||||||||||||||||||||
| 6134 | qq, qFlagLocation("1""_q_update(QRectF)" "\0" __FILE__ ":" "10449")); | - | ||||||||||||||||||||||||||||||
| 6135 | QObject::connect(control, qFlagLocation("2""documentSizeChanged(QSizeF)" "\0" __FILE__ ":" "10450"), | - | ||||||||||||||||||||||||||||||
| 6136 | qq, qFlagLocation("1""_q_updateBoundingRect(QSizeF)" "\0" __FILE__ ":" "10451")); | - | ||||||||||||||||||||||||||||||
| 6137 | QObject::connect(control, qFlagLocation("2""visibilityRequest(QRectF)" "\0" __FILE__ ":" "10452"), | - | ||||||||||||||||||||||||||||||
| 6138 | qq, qFlagLocation("1""_q_ensureVisible(QRectF)" "\0" __FILE__ ":" "10453")); | - | ||||||||||||||||||||||||||||||
| 6139 | QObject::connect(control, qFlagLocation("2""linkActivated(QString)" "\0" __FILE__ ":" "10454"), | - | ||||||||||||||||||||||||||||||
| 6140 | qq, qFlagLocation("2""linkActivated(QString)" "\0" __FILE__ ":" "10455")); | - | ||||||||||||||||||||||||||||||
| 6141 | QObject::connect(control, qFlagLocation("2""linkHovered(QString)" "\0" __FILE__ ":" "10456"), | - | ||||||||||||||||||||||||||||||
| 6142 | qq, qFlagLocation("2""linkHovered(QString)" "\0" __FILE__ ":" "10457")); | - | ||||||||||||||||||||||||||||||
| 6143 | - | |||||||||||||||||||||||||||||||
| 6144 | const QSizeF pgSize = control->document()->pageSize(); | - | ||||||||||||||||||||||||||||||
| 6145 |         if (pgSize.height() != -1
  | 0 | ||||||||||||||||||||||||||||||
| 6146 | qq->prepareGeometryChange(); | - | ||||||||||||||||||||||||||||||
| 6147 | that->dd->boundingRect.setSize(pgSize); | - | ||||||||||||||||||||||||||||||
| 6148 | qq->update(); | - | ||||||||||||||||||||||||||||||
| 6149 |         } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||
| 6150 | that->dd->_q_updateBoundingRect(control->size()); | - | ||||||||||||||||||||||||||||||
| 6151 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6152 | } | - | ||||||||||||||||||||||||||||||
| 6153 |     return never executed:   control;return control;never executed:  return control; | 0 | ||||||||||||||||||||||||||||||
| 6154 | } | - | ||||||||||||||||||||||||||||||
| 6155 | - | |||||||||||||||||||||||||||||||
| 6156 | - | |||||||||||||||||||||||||||||||
| 6157 | - | |||||||||||||||||||||||||||||||
| 6158 | - | |||||||||||||||||||||||||||||||
| 6159 | bool QGraphicsTextItemPrivate::_q_mouseOnEdge(QGraphicsSceneMouseEvent *event) | - | ||||||||||||||||||||||||||||||
| 6160 | { | - | ||||||||||||||||||||||||||||||
| 6161 | QPainterPath path; | - | ||||||||||||||||||||||||||||||
| 6162 | path.addRect(qq->boundingRect()); | - | ||||||||||||||||||||||||||||||
| 6163 | - | |||||||||||||||||||||||||||||||
| 6164 | QPainterPath docPath; | - | ||||||||||||||||||||||||||||||
| 6165 | const QTextFrameFormat format = control->document()->rootFrame()->frameFormat(); | - | ||||||||||||||||||||||||||||||
| 6166 | docPath.addRect( | - | ||||||||||||||||||||||||||||||
| 6167 | qq->boundingRect().adjusted( | - | ||||||||||||||||||||||||||||||
| 6168 | format.leftMargin(), | - | ||||||||||||||||||||||||||||||
| 6169 | format.topMargin(), | - | ||||||||||||||||||||||||||||||
| 6170 | -format.rightMargin(), | - | ||||||||||||||||||||||||||||||
| 6171 | -format.bottomMargin())); | - | ||||||||||||||||||||||||||||||
| 6172 | - | |||||||||||||||||||||||||||||||
| 6173 |     return never executed:   path.subtracted(docPath).contains(event->pos());return path.subtracted(docPath).contains(event->pos());never executed:  return path.subtracted(docPath).contains(event->pos()); | 0 | ||||||||||||||||||||||||||||||
| 6174 | } | - | ||||||||||||||||||||||||||||||
| 6175 | void QGraphicsTextItem::setTextInteractionFlags(Qt::TextInteractionFlags flags) | - | ||||||||||||||||||||||||||||||
| 6176 | { | - | ||||||||||||||||||||||||||||||
| 6177 |     if (flags == Qt::NoTextInteraction
  | 0 | ||||||||||||||||||||||||||||||
| 6178 |         setFlags(this->flags() & ~(QGraphicsItem::ItemIsFocusable | QGraphicsItem::ItemAcceptsInputMethod)); never executed:  setFlags(this->flags() & ~(QGraphicsItem::ItemIsFocusable | QGraphicsItem::ItemAcceptsInputMethod)); | 0 | ||||||||||||||||||||||||||||||
| 6179 | else | - | ||||||||||||||||||||||||||||||
| 6180 |         setFlags(this->flags() | QGraphicsItem::ItemIsFocusable | QGraphicsItem::ItemAcceptsInputMethod); never executed:  setFlags(this->flags() | QGraphicsItem::ItemIsFocusable | QGraphicsItem::ItemAcceptsInputMethod); | 0 | ||||||||||||||||||||||||||||||
| 6181 | - | |||||||||||||||||||||||||||||||
| 6182 | dd->textControl()->setTextInteractionFlags(flags); | - | ||||||||||||||||||||||||||||||
| 6183 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6184 | - | |||||||||||||||||||||||||||||||
| 6185 | - | |||||||||||||||||||||||||||||||
| 6186 | - | |||||||||||||||||||||||||||||||
| 6187 | - | |||||||||||||||||||||||||||||||
| 6188 | - | |||||||||||||||||||||||||||||||
| 6189 | - | |||||||||||||||||||||||||||||||
| 6190 | Qt::TextInteractionFlags QGraphicsTextItem::textInteractionFlags() const | - | ||||||||||||||||||||||||||||||
| 6191 | { | - | ||||||||||||||||||||||||||||||
| 6192 |     if (!dd->control
  | 0 | ||||||||||||||||||||||||||||||
| 6193 |         return never executed:   Qt::NoTextInteraction;return Qt::NoTextInteraction;never executed:  return Qt::NoTextInteraction; | 0 | ||||||||||||||||||||||||||||||
| 6194 |     return never executed:   dd->control->textInteractionFlags();return dd->control->textInteractionFlags();never executed:  return dd->control->textInteractionFlags(); | 0 | ||||||||||||||||||||||||||||||
| 6195 | } | - | ||||||||||||||||||||||||||||||
| 6196 | void QGraphicsTextItem::setTabChangesFocus(bool b) | - | ||||||||||||||||||||||||||||||
| 6197 | { | - | ||||||||||||||||||||||||||||||
| 6198 | dd->tabChangesFocus = b; | - | ||||||||||||||||||||||||||||||
| 6199 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6200 | bool QGraphicsTextItem::tabChangesFocus() const | - | ||||||||||||||||||||||||||||||
| 6201 | { | - | ||||||||||||||||||||||||||||||
| 6202 |     return never executed:   dd->tabChangesFocus;return dd->tabChangesFocus;never executed:  return dd->tabChangesFocus; | 0 | ||||||||||||||||||||||||||||||
| 6203 | } | - | ||||||||||||||||||||||||||||||
| 6204 | void QGraphicsTextItem::setOpenExternalLinks(bool open) | - | ||||||||||||||||||||||||||||||
| 6205 | { | - | ||||||||||||||||||||||||||||||
| 6206 | dd->textControl()->setOpenExternalLinks(open); | - | ||||||||||||||||||||||||||||||
| 6207 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6208 | - | |||||||||||||||||||||||||||||||
| 6209 | bool QGraphicsTextItem::openExternalLinks() const | - | ||||||||||||||||||||||||||||||
| 6210 | { | - | ||||||||||||||||||||||||||||||
| 6211 |     if (!dd->control
  | 0 | ||||||||||||||||||||||||||||||
| 6212 |         return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||
| 6213 |     return never executed:   dd->control->openExternalLinks();return dd->control->openExternalLinks();never executed:  return dd->control->openExternalLinks(); | 0 | ||||||||||||||||||||||||||||||
| 6214 | } | - | ||||||||||||||||||||||||||||||
| 6215 | void QGraphicsTextItem::setTextCursor(const QTextCursor &cursor) | - | ||||||||||||||||||||||||||||||
| 6216 | { | - | ||||||||||||||||||||||||||||||
| 6217 | dd->textControl()->setTextCursor(cursor); | - | ||||||||||||||||||||||||||||||
| 6218 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6219 | - | |||||||||||||||||||||||||||||||
| 6220 | QTextCursor QGraphicsTextItem::textCursor() const | - | ||||||||||||||||||||||||||||||
| 6221 | { | - | ||||||||||||||||||||||||||||||
| 6222 |     if (!dd->control
  | 0 | ||||||||||||||||||||||||||||||
| 6223 |         return never executed:   QTextCursor();return QTextCursor();never executed:  return QTextCursor(); | 0 | ||||||||||||||||||||||||||||||
| 6224 |     return never executed:   dd->control->textCursor();return dd->control->textCursor();never executed:  return dd->control->textCursor(); | 0 | ||||||||||||||||||||||||||||||
| 6225 | } | - | ||||||||||||||||||||||||||||||
| 6226 | - | |||||||||||||||||||||||||||||||
| 6227 | class QGraphicsSimpleTextItemPrivate : public QAbstractGraphicsShapeItemPrivate | - | ||||||||||||||||||||||||||||||
| 6228 | { | - | ||||||||||||||||||||||||||||||
| 6229 | 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; | - | ||||||||||||||||||||||||||||||
| 6230 | public: | - | ||||||||||||||||||||||||||||||
| 6231 | inline QGraphicsSimpleTextItemPrivate() { | - | ||||||||||||||||||||||||||||||
| 6232 | pen.setStyle(Qt::NoPen); | - | ||||||||||||||||||||||||||||||
| 6233 | brush.setStyle(Qt::SolidPattern); | - | ||||||||||||||||||||||||||||||
| 6234 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6235 | QString text; | - | ||||||||||||||||||||||||||||||
| 6236 | QFont font; | - | ||||||||||||||||||||||||||||||
| 6237 | QRectF boundingRect; | - | ||||||||||||||||||||||||||||||
| 6238 | - | |||||||||||||||||||||||||||||||
| 6239 | void updateBoundingRect(); | - | ||||||||||||||||||||||||||||||
| 6240 | }; | - | ||||||||||||||||||||||||||||||
| 6241 | - | |||||||||||||||||||||||||||||||
| 6242 | static QRectF setupTextLayout(QTextLayout *layout) | - | ||||||||||||||||||||||||||||||
| 6243 | { | - | ||||||||||||||||||||||||||||||
| 6244 | layout->setCacheEnabled(true); | - | ||||||||||||||||||||||||||||||
| 6245 | layout->beginLayout(); | - | ||||||||||||||||||||||||||||||
| 6246 |     while (layout->createLine().isValid()
  | 0 | ||||||||||||||||||||||||||||||
| 6247 |         ; never executed:  ; | 0 | ||||||||||||||||||||||||||||||
| 6248 | layout->endLayout(); | - | ||||||||||||||||||||||||||||||
| 6249 | qreal maxWidth = 0; | - | ||||||||||||||||||||||||||||||
| 6250 | qreal y = 0; | - | ||||||||||||||||||||||||||||||
| 6251 |     for (int i = 0; i < layout->lineCount()
  | 0 | ||||||||||||||||||||||||||||||
| 6252 | QTextLine line = layout->lineAt(i); | - | ||||||||||||||||||||||||||||||
| 6253 | maxWidth = qMax(maxWidth, line.naturalTextWidth()); | - | ||||||||||||||||||||||||||||||
| 6254 | line.setPosition(QPointF(0, y)); | - | ||||||||||||||||||||||||||||||
| 6255 | y += line.height(); | - | ||||||||||||||||||||||||||||||
| 6256 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6257 |     return never executed:   QRectF(0, 0, maxWidth, y);return QRectF(0, 0, maxWidth, y);never executed:  return QRectF(0, 0, maxWidth, y); | 0 | ||||||||||||||||||||||||||||||
| 6258 | } | - | ||||||||||||||||||||||||||||||
| 6259 | - | |||||||||||||||||||||||||||||||
| 6260 | void QGraphicsSimpleTextItemPrivate::updateBoundingRect() | - | ||||||||||||||||||||||||||||||
| 6261 | { | - | ||||||||||||||||||||||||||||||
| 6262 | QGraphicsSimpleTextItem * const q = q_func(); | - | ||||||||||||||||||||||||||||||
| 6263 | QRectF br; | - | ||||||||||||||||||||||||||||||
| 6264 |     if (text.isEmpty()
  | 0 | ||||||||||||||||||||||||||||||
| 6265 | br = QRectF(); | - | ||||||||||||||||||||||||||||||
| 6266 |     } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||
| 6267 | QString tmp = text; | - | ||||||||||||||||||||||||||||||
| 6268 | tmp.replace(QLatin1Char('\n'), QChar::LineSeparator); | - | ||||||||||||||||||||||||||||||
| 6269 | QStackTextEngine engine(tmp, font); | - | ||||||||||||||||||||||||||||||
| 6270 | QTextLayout layout(&engine); | - | ||||||||||||||||||||||||||||||
| 6271 | br = setupTextLayout(&layout); | - | ||||||||||||||||||||||||||||||
| 6272 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6273 |     if (br != boundingRect
  | 0 | ||||||||||||||||||||||||||||||
| 6274 | q->prepareGeometryChange(); | - | ||||||||||||||||||||||||||||||
| 6275 | boundingRect = br; | - | ||||||||||||||||||||||||||||||
| 6276 | q->update(); | - | ||||||||||||||||||||||||||||||
| 6277 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6278 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6279 | QGraphicsSimpleTextItem::QGraphicsSimpleTextItem(QGraphicsItem *parent) | - | ||||||||||||||||||||||||||||||
| 6280 | : QAbstractGraphicsShapeItem(*new QGraphicsSimpleTextItemPrivate, parent) | - | ||||||||||||||||||||||||||||||
| 6281 | { | - | ||||||||||||||||||||||||||||||
| 6282 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6283 | QGraphicsSimpleTextItem::QGraphicsSimpleTextItem(const QString &text, QGraphicsItem *parent) | - | ||||||||||||||||||||||||||||||
| 6284 | : QAbstractGraphicsShapeItem(*new QGraphicsSimpleTextItemPrivate, parent) | - | ||||||||||||||||||||||||||||||
| 6285 | { | - | ||||||||||||||||||||||||||||||
| 6286 | setText(text); | - | ||||||||||||||||||||||||||||||
| 6287 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6288 | - | |||||||||||||||||||||||||||||||
| 6289 | - | |||||||||||||||||||||||||||||||
| 6290 | - | |||||||||||||||||||||||||||||||
| 6291 | - | |||||||||||||||||||||||||||||||
| 6292 | QGraphicsSimpleTextItem::~QGraphicsSimpleTextItem() | - | ||||||||||||||||||||||||||||||
| 6293 | { | - | ||||||||||||||||||||||||||||||
| 6294 | } | - | ||||||||||||||||||||||||||||||
| 6295 | - | |||||||||||||||||||||||||||||||
| 6296 | - | |||||||||||||||||||||||||||||||
| 6297 | - | |||||||||||||||||||||||||||||||
| 6298 | - | |||||||||||||||||||||||||||||||
| 6299 | - | |||||||||||||||||||||||||||||||
| 6300 | - | |||||||||||||||||||||||||||||||
| 6301 | - | |||||||||||||||||||||||||||||||
| 6302 | void QGraphicsSimpleTextItem::setText(const QString &text) | - | ||||||||||||||||||||||||||||||
| 6303 | { | - | ||||||||||||||||||||||||||||||
| 6304 | QGraphicsSimpleTextItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 6305 |     if (d->text == text
  | 0 | ||||||||||||||||||||||||||||||
| 6306 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 6307 | d->text = text; | - | ||||||||||||||||||||||||||||||
| 6308 | d->updateBoundingRect(); | - | ||||||||||||||||||||||||||||||
| 6309 | update(); | - | ||||||||||||||||||||||||||||||
| 6310 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6311 | - | |||||||||||||||||||||||||||||||
| 6312 | - | |||||||||||||||||||||||||||||||
| 6313 | - | |||||||||||||||||||||||||||||||
| 6314 | - | |||||||||||||||||||||||||||||||
| 6315 | QString QGraphicsSimpleTextItem::text() const | - | ||||||||||||||||||||||||||||||
| 6316 | { | - | ||||||||||||||||||||||||||||||
| 6317 | const QGraphicsSimpleTextItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 6318 |     return never executed:   d->text;return d->text;never executed:  return d->text; | 0 | ||||||||||||||||||||||||||||||
| 6319 | } | - | ||||||||||||||||||||||||||||||
| 6320 | - | |||||||||||||||||||||||||||||||
| 6321 | - | |||||||||||||||||||||||||||||||
| 6322 | - | |||||||||||||||||||||||||||||||
| 6323 | - | |||||||||||||||||||||||||||||||
| 6324 | void QGraphicsSimpleTextItem::setFont(const QFont &font) | - | ||||||||||||||||||||||||||||||
| 6325 | { | - | ||||||||||||||||||||||||||||||
| 6326 | QGraphicsSimpleTextItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 6327 | d->font = font; | - | ||||||||||||||||||||||||||||||
| 6328 | d->updateBoundingRect(); | - | ||||||||||||||||||||||||||||||
| 6329 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6330 | - | |||||||||||||||||||||||||||||||
| 6331 | - | |||||||||||||||||||||||||||||||
| 6332 | - | |||||||||||||||||||||||||||||||
| 6333 | - | |||||||||||||||||||||||||||||||
| 6334 | QFont QGraphicsSimpleTextItem::font() const | - | ||||||||||||||||||||||||||||||
| 6335 | { | - | ||||||||||||||||||||||||||||||
| 6336 | const QGraphicsSimpleTextItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 6337 |     return never executed:   d->font;return d->font;never executed:  return d->font; | 0 | ||||||||||||||||||||||||||||||
| 6338 | } | - | ||||||||||||||||||||||||||||||
| 6339 | - | |||||||||||||||||||||||||||||||
| 6340 | - | |||||||||||||||||||||||||||||||
| 6341 | - | |||||||||||||||||||||||||||||||
| 6342 | - | |||||||||||||||||||||||||||||||
| 6343 | QRectF QGraphicsSimpleTextItem::boundingRect() const | - | ||||||||||||||||||||||||||||||
| 6344 | { | - | ||||||||||||||||||||||||||||||
| 6345 | const QGraphicsSimpleTextItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 6346 |     return never executed:   d->boundingRect;return d->boundingRect;never executed:  return d->boundingRect; | 0 | ||||||||||||||||||||||||||||||
| 6347 | } | - | ||||||||||||||||||||||||||||||
| 6348 | - | |||||||||||||||||||||||||||||||
| 6349 | - | |||||||||||||||||||||||||||||||
| 6350 | - | |||||||||||||||||||||||||||||||
| 6351 | - | |||||||||||||||||||||||||||||||
| 6352 | QPainterPath QGraphicsSimpleTextItem::shape() const | - | ||||||||||||||||||||||||||||||
| 6353 | { | - | ||||||||||||||||||||||||||||||
| 6354 | const QGraphicsSimpleTextItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 6355 | QPainterPath path; | - | ||||||||||||||||||||||||||||||
| 6356 | path.addRect(d->boundingRect); | - | ||||||||||||||||||||||||||||||
| 6357 |     return never executed:   path;return path;never executed:  return path; | 0 | ||||||||||||||||||||||||||||||
| 6358 | } | - | ||||||||||||||||||||||||||||||
| 6359 | - | |||||||||||||||||||||||||||||||
| 6360 | - | |||||||||||||||||||||||||||||||
| 6361 | - | |||||||||||||||||||||||||||||||
| 6362 | - | |||||||||||||||||||||||||||||||
| 6363 | bool QGraphicsSimpleTextItem::contains(const QPointF &point) const | - | ||||||||||||||||||||||||||||||
| 6364 | { | - | ||||||||||||||||||||||||||||||
| 6365 | const QGraphicsSimpleTextItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 6366 |     return never executed:   d->boundingRect.contains(point);return d->boundingRect.contains(point);never executed:  return d->boundingRect.contains(point); | 0 | ||||||||||||||||||||||||||||||
| 6367 | } | - | ||||||||||||||||||||||||||||||
| 6368 | - | |||||||||||||||||||||||||||||||
| 6369 | - | |||||||||||||||||||||||||||||||
| 6370 | - | |||||||||||||||||||||||||||||||
| 6371 | - | |||||||||||||||||||||||||||||||
| 6372 | void QGraphicsSimpleTextItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) | - | ||||||||||||||||||||||||||||||
| 6373 | { | - | ||||||||||||||||||||||||||||||
| 6374 | (void)widget;; | - | ||||||||||||||||||||||||||||||
| 6375 | QGraphicsSimpleTextItemPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 6376 | - | |||||||||||||||||||||||||||||||
| 6377 | painter->setFont(d->font); | - | ||||||||||||||||||||||||||||||
| 6378 | - | |||||||||||||||||||||||||||||||
| 6379 | QString tmp = d->text; | - | ||||||||||||||||||||||||||||||
| 6380 | tmp.replace(QLatin1Char('\n'), QChar::LineSeparator); | - | ||||||||||||||||||||||||||||||
| 6381 | QStackTextEngine engine(tmp, d->font); | - | ||||||||||||||||||||||||||||||
| 6382 | QTextLayout layout(&engine); | - | ||||||||||||||||||||||||||||||
| 6383 | - | |||||||||||||||||||||||||||||||
| 6384 | QPen p; | - | ||||||||||||||||||||||||||||||
| 6385 | p.setBrush(d->brush); | - | ||||||||||||||||||||||||||||||
| 6386 | painter->setPen(p); | - | ||||||||||||||||||||||||||||||
| 6387 |     if (d->pen.style() == Qt::NoPen
 
  | 0 | ||||||||||||||||||||||||||||||
| 6388 | painter->setBrush(Qt::NoBrush); | - | ||||||||||||||||||||||||||||||
| 6389 |     } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||
| 6390 | QTextLayout::FormatRange range; | - | ||||||||||||||||||||||||||||||
| 6391 | range.start = 0; | - | ||||||||||||||||||||||||||||||
| 6392 | range.length = layout.text().length(); | - | ||||||||||||||||||||||||||||||
| 6393 | range.format.setTextOutline(d->pen); | - | ||||||||||||||||||||||||||||||
| 6394 | layout.setFormats(QVector<QTextLayout::FormatRange>(1, range)); | - | ||||||||||||||||||||||||||||||
| 6395 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6396 | - | |||||||||||||||||||||||||||||||
| 6397 | setupTextLayout(&layout); | - | ||||||||||||||||||||||||||||||
| 6398 | layout.draw(painter, QPointF(0, 0)); | - | ||||||||||||||||||||||||||||||
| 6399 | - | |||||||||||||||||||||||||||||||
| 6400 |     if (option->state & (QStyle::State_Selected | QStyle::State_HasFocus)
  | 0 | ||||||||||||||||||||||||||||||
| 6401 |         qt_graphicsItem_highlightSelected(this, painter, option); never executed:  qt_graphicsItem_highlightSelected(this, painter, option); | 0 | ||||||||||||||||||||||||||||||
| 6402 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6403 | - | |||||||||||||||||||||||||||||||
| 6404 | - | |||||||||||||||||||||||||||||||
| 6405 | - | |||||||||||||||||||||||||||||||
| 6406 | - | |||||||||||||||||||||||||||||||
| 6407 | bool QGraphicsSimpleTextItem::isObscuredBy(const QGraphicsItem *item) const | - | ||||||||||||||||||||||||||||||
| 6408 | { | - | ||||||||||||||||||||||||||||||
| 6409 |     return never executed:   QAbstractGraphicsShapeItem::isObscuredBy(item);return QAbstractGraphicsShapeItem::isObscuredBy(item);never executed:  return QAbstractGraphicsShapeItem::isObscuredBy(item); | 0 | ||||||||||||||||||||||||||||||
| 6410 | } | - | ||||||||||||||||||||||||||||||
| 6411 | - | |||||||||||||||||||||||||||||||
| 6412 | - | |||||||||||||||||||||||||||||||
| 6413 | - | |||||||||||||||||||||||||||||||
| 6414 | - | |||||||||||||||||||||||||||||||
| 6415 | QPainterPath QGraphicsSimpleTextItem::opaqueArea() const | - | ||||||||||||||||||||||||||||||
| 6416 | { | - | ||||||||||||||||||||||||||||||
| 6417 |     return never executed:   QAbstractGraphicsShapeItem::opaqueArea();return QAbstractGraphicsShapeItem::opaqueArea();never executed:  return QAbstractGraphicsShapeItem::opaqueArea(); | 0 | ||||||||||||||||||||||||||||||
| 6418 | } | - | ||||||||||||||||||||||||||||||
| 6419 | - | |||||||||||||||||||||||||||||||
| 6420 | - | |||||||||||||||||||||||||||||||
| 6421 | - | |||||||||||||||||||||||||||||||
| 6422 | - | |||||||||||||||||||||||||||||||
| 6423 | int QGraphicsSimpleTextItem::type() const | - | ||||||||||||||||||||||||||||||
| 6424 | { | - | ||||||||||||||||||||||||||||||
| 6425 |     return never executed:   Type;return Type;never executed:  return Type; | 0 | ||||||||||||||||||||||||||||||
| 6426 | } | - | ||||||||||||||||||||||||||||||
| 6427 | - | |||||||||||||||||||||||||||||||
| 6428 | - | |||||||||||||||||||||||||||||||
| 6429 | - | |||||||||||||||||||||||||||||||
| 6430 | - | |||||||||||||||||||||||||||||||
| 6431 | bool QGraphicsSimpleTextItem::supportsExtension(Extension extension) const | - | ||||||||||||||||||||||||||||||
| 6432 | { | - | ||||||||||||||||||||||||||||||
| 6433 | (void)extension;; | - | ||||||||||||||||||||||||||||||
| 6434 |     return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||||||||
| 6435 | } | - | ||||||||||||||||||||||||||||||
| 6436 | - | |||||||||||||||||||||||||||||||
| 6437 | - | |||||||||||||||||||||||||||||||
| 6438 | - | |||||||||||||||||||||||||||||||
| 6439 | - | |||||||||||||||||||||||||||||||
| 6440 | void QGraphicsSimpleTextItem::setExtension(Extension extension, const QVariant &variant) | - | ||||||||||||||||||||||||||||||
| 6441 | { | - | ||||||||||||||||||||||||||||||
| 6442 | (void)extension;; | - | ||||||||||||||||||||||||||||||
| 6443 | (void)variant;; | - | ||||||||||||||||||||||||||||||
| 6444 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6445 | - | |||||||||||||||||||||||||||||||
| 6446 | - | |||||||||||||||||||||||||||||||
| 6447 | - | |||||||||||||||||||||||||||||||
| 6448 | - | |||||||||||||||||||||||||||||||
| 6449 | QVariant QGraphicsSimpleTextItem::extension(const QVariant &variant) const | - | ||||||||||||||||||||||||||||||
| 6450 | { | - | ||||||||||||||||||||||||||||||
| 6451 | (void)variant;; | - | ||||||||||||||||||||||||||||||
| 6452 |     return never executed:   QVariant();return QVariant();never executed:  return QVariant(); | 0 | ||||||||||||||||||||||||||||||
| 6453 | } | - | ||||||||||||||||||||||||||||||
| 6454 | class QGraphicsItemGroupPrivate : public QGraphicsItemPrivate | - | ||||||||||||||||||||||||||||||
| 6455 | { | - | ||||||||||||||||||||||||||||||
| 6456 | public: | - | ||||||||||||||||||||||||||||||
| 6457 | QRectF itemsBoundingRect; | - | ||||||||||||||||||||||||||||||
| 6458 | }; | - | ||||||||||||||||||||||||||||||
| 6459 | - | |||||||||||||||||||||||||||||||
| 6460 | - | |||||||||||||||||||||||||||||||
| 6461 | - | |||||||||||||||||||||||||||||||
| 6462 | - | |||||||||||||||||||||||||||||||
| 6463 | - | |||||||||||||||||||||||||||||||
| 6464 | - | |||||||||||||||||||||||||||||||
| 6465 | - | |||||||||||||||||||||||||||||||
| 6466 | QGraphicsItemGroup::QGraphicsItemGroup(QGraphicsItem *parent) | - | ||||||||||||||||||||||||||||||
| 6467 | : QGraphicsItem(*new QGraphicsItemGroupPrivate, parent) | - | ||||||||||||||||||||||||||||||
| 6468 | { | - | ||||||||||||||||||||||||||||||
| 6469 | setHandlesChildEvents(true); | - | ||||||||||||||||||||||||||||||
| 6470 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6471 | - | |||||||||||||||||||||||||||||||
| 6472 | - | |||||||||||||||||||||||||||||||
| 6473 | - | |||||||||||||||||||||||||||||||
| 6474 | - | |||||||||||||||||||||||||||||||
| 6475 | QGraphicsItemGroup::~QGraphicsItemGroup() | - | ||||||||||||||||||||||||||||||
| 6476 | { | - | ||||||||||||||||||||||||||||||
| 6477 | } | - | ||||||||||||||||||||||||||||||
| 6478 | void QGraphicsItemGroup::addToGroup(QGraphicsItem *item) | - | ||||||||||||||||||||||||||||||
| 6479 | { | - | ||||||||||||||||||||||||||||||
| 6480 | QGraphicsItemGroupPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 6481 |     if (!item
  | 0 | ||||||||||||||||||||||||||||||
| 6482 | QMessageLogger(__FILE__, 10991, __PRETTY_FUNCTION__).warning("QGraphicsItemGroup::addToGroup: cannot add null item"); | - | ||||||||||||||||||||||||||||||
| 6483 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 6484 | } | - | ||||||||||||||||||||||||||||||
| 6485 |     if (item == this
  | 0 | ||||||||||||||||||||||||||||||
| 6486 | QMessageLogger(__FILE__, 10995, __PRETTY_FUNCTION__).warning("QGraphicsItemGroup::addToGroup: cannot add a group to itself"); | - | ||||||||||||||||||||||||||||||
| 6487 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 6488 | } | - | ||||||||||||||||||||||||||||||
| 6489 | - | |||||||||||||||||||||||||||||||
| 6490 | - | |||||||||||||||||||||||||||||||
| 6491 | bool ok; | - | ||||||||||||||||||||||||||||||
| 6492 | QTransform itemTransform = item->itemTransform(this, &ok); | - | ||||||||||||||||||||||||||||||
| 6493 | - | |||||||||||||||||||||||||||||||
| 6494 |     if (!ok
  | 0 | ||||||||||||||||||||||||||||||
| 6495 | QMessageLogger(__FILE__, 11004, __PRETTY_FUNCTION__).warning("QGraphicsItemGroup::addToGroup: could not find a valid transformation from item to group coordinates"); | - | ||||||||||||||||||||||||||||||
| 6496 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 6497 | } | - | ||||||||||||||||||||||||||||||
| 6498 | - | |||||||||||||||||||||||||||||||
| 6499 | QTransform newItemTransform(itemTransform); | - | ||||||||||||||||||||||||||||||
| 6500 | item->setPos(mapFromItem(item, 0, 0)); | - | ||||||||||||||||||||||||||||||
| 6501 | item->setParentItem(this); | - | ||||||||||||||||||||||||||||||
| 6502 | - | |||||||||||||||||||||||||||||||
| 6503 | - | |||||||||||||||||||||||||||||||
| 6504 |     if (!item->pos().isNull()
  | 0 | ||||||||||||||||||||||||||||||
| 6505 |         newItemTransform *= QTransform::fromTranslate(-item->x(), -item->y()); never executed:  newItemTransform *= QTransform::fromTranslate(-item->x(), -item->y()); | 0 | ||||||||||||||||||||||||||||||
| 6506 | - | |||||||||||||||||||||||||||||||
| 6507 | - | |||||||||||||||||||||||||||||||
| 6508 | QPointF origin = item->transformOriginPoint(); | - | ||||||||||||||||||||||||||||||
| 6509 | QMatrix4x4 m; | - | ||||||||||||||||||||||||||||||
| 6510 | QList<QGraphicsTransform*> transformList = item->transformations(); | - | ||||||||||||||||||||||||||||||
| 6511 |     for (int i = 0; i < transformList.size()
  | 0 | ||||||||||||||||||||||||||||||
| 6512 |         transformList.at(i)->applyTo(&m); never executed:  transformList.at(i)->applyTo(&m); | 0 | ||||||||||||||||||||||||||||||
| 6513 | newItemTransform *= m.toTransform().inverted(); | - | ||||||||||||||||||||||||||||||
| 6514 | newItemTransform.translate(origin.x(), origin.y()); | - | ||||||||||||||||||||||||||||||
| 6515 | newItemTransform.rotate(-item->rotation()); | - | ||||||||||||||||||||||||||||||
| 6516 | newItemTransform.scale(1/item->scale(), 1/item->scale()); | - | ||||||||||||||||||||||||||||||
| 6517 | newItemTransform.translate(-origin.x(), -origin.y()); | - | ||||||||||||||||||||||||||||||
| 6518 | - | |||||||||||||||||||||||||||||||
| 6519 | - | |||||||||||||||||||||||||||||||
| 6520 | - | |||||||||||||||||||||||||||||||
| 6521 | item->setTransform(newItemTransform); | - | ||||||||||||||||||||||||||||||
| 6522 | item->d_func()->setIsMemberOfGroup(true); | - | ||||||||||||||||||||||||||||||
| 6523 | prepareGeometryChange(); | - | ||||||||||||||||||||||||||||||
| 6524 | d->itemsBoundingRect |= itemTransform.mapRect(item->boundingRect() | item->childrenBoundingRect()); | - | ||||||||||||||||||||||||||||||
| 6525 | update(); | - | ||||||||||||||||||||||||||||||
| 6526 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6527 | void QGraphicsItemGroup::removeFromGroup(QGraphicsItem *item) | - | ||||||||||||||||||||||||||||||
| 6528 | { | - | ||||||||||||||||||||||||||||||
| 6529 | QGraphicsItemGroupPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 6530 |     if (!item
  | 0 | ||||||||||||||||||||||||||||||
| 6531 | QMessageLogger(__FILE__, 11049, __PRETTY_FUNCTION__).warning("QGraphicsItemGroup::removeFromGroup: cannot remove null item"); | - | ||||||||||||||||||||||||||||||
| 6532 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 6533 | } | - | ||||||||||||||||||||||||||||||
| 6534 | - | |||||||||||||||||||||||||||||||
| 6535 | QGraphicsItem *newParent = d_ptr->parent; | - | ||||||||||||||||||||||||||||||
| 6536 | - | |||||||||||||||||||||||||||||||
| 6537 | - | |||||||||||||||||||||||||||||||
| 6538 | bool ok; | - | ||||||||||||||||||||||||||||||
| 6539 | QTransform itemTransform; | - | ||||||||||||||||||||||||||||||
| 6540 |     if (newParent
  | 0 | ||||||||||||||||||||||||||||||
| 6541 |         itemTransform = item->itemTransform(newParent, &ok); never executed:  itemTransform = item->itemTransform(newParent, &ok); | 0 | ||||||||||||||||||||||||||||||
| 6542 | else | - | ||||||||||||||||||||||||||||||
| 6543 |         itemTransform = item->sceneTransform(); never executed:  itemTransform = item->sceneTransform(); | 0 | ||||||||||||||||||||||||||||||
| 6544 | - | |||||||||||||||||||||||||||||||
| 6545 | QPointF oldPos = item->mapToItem(newParent, 0, 0); | - | ||||||||||||||||||||||||||||||
| 6546 | item->setParentItem(newParent); | - | ||||||||||||||||||||||||||||||
| 6547 | item->setPos(oldPos); | - | ||||||||||||||||||||||||||||||
| 6548 | - | |||||||||||||||||||||||||||||||
| 6549 | - | |||||||||||||||||||||||||||||||
| 6550 |     if (!item->pos().isNull()
  | 0 | ||||||||||||||||||||||||||||||
| 6551 |         itemTransform *= QTransform::fromTranslate(-item->x(), -item->y()); never executed:  itemTransform *= QTransform::fromTranslate(-item->x(), -item->y()); | 0 | ||||||||||||||||||||||||||||||
| 6552 | - | |||||||||||||||||||||||||||||||
| 6553 | - | |||||||||||||||||||||||||||||||
| 6554 | - | |||||||||||||||||||||||||||||||
| 6555 | QPointF origin = item->transformOriginPoint(); | - | ||||||||||||||||||||||||||||||
| 6556 | QMatrix4x4 m; | - | ||||||||||||||||||||||||||||||
| 6557 | QList<QGraphicsTransform*> transformList = item->transformations(); | - | ||||||||||||||||||||||||||||||
| 6558 |     for (int i = 0; i < transformList.size()
  | 0 | ||||||||||||||||||||||||||||||
| 6559 |         transformList.at(i)->applyTo(&m); never executed:  transformList.at(i)->applyTo(&m); | 0 | ||||||||||||||||||||||||||||||
| 6560 | itemTransform *= m.toTransform().inverted(); | - | ||||||||||||||||||||||||||||||
| 6561 | itemTransform.translate(origin.x(), origin.y()); | - | ||||||||||||||||||||||||||||||
| 6562 | itemTransform.rotate(-item->rotation()); | - | ||||||||||||||||||||||||||||||
| 6563 | itemTransform.scale(1 / item->scale(), 1 / item->scale()); | - | ||||||||||||||||||||||||||||||
| 6564 | itemTransform.translate(-origin.x(), -origin.y()); | - | ||||||||||||||||||||||||||||||
| 6565 | - | |||||||||||||||||||||||||||||||
| 6566 | - | |||||||||||||||||||||||||||||||
| 6567 | - | |||||||||||||||||||||||||||||||
| 6568 | item->setTransform(itemTransform); | - | ||||||||||||||||||||||||||||||
| 6569 | item->d_func()->setIsMemberOfGroup(item->group() != 0); | - | ||||||||||||||||||||||||||||||
| 6570 | - | |||||||||||||||||||||||||||||||
| 6571 | - | |||||||||||||||||||||||||||||||
| 6572 | prepareGeometryChange(); | - | ||||||||||||||||||||||||||||||
| 6573 | d->itemsBoundingRect = childrenBoundingRect(); | - | ||||||||||||||||||||||||||||||
| 6574 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6575 | - | |||||||||||||||||||||||||||||||
| 6576 | - | |||||||||||||||||||||||||||||||
| 6577 | - | |||||||||||||||||||||||||||||||
| 6578 | - | |||||||||||||||||||||||||||||||
| 6579 | - | |||||||||||||||||||||||||||||||
| 6580 | - | |||||||||||||||||||||||||||||||
| 6581 | QRectF QGraphicsItemGroup::boundingRect() const | - | ||||||||||||||||||||||||||||||
| 6582 | { | - | ||||||||||||||||||||||||||||||
| 6583 | const QGraphicsItemGroupPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 6584 |     return never executed:   d->itemsBoundingRect;return d->itemsBoundingRect;never executed:  return d->itemsBoundingRect; | 0 | ||||||||||||||||||||||||||||||
| 6585 | } | - | ||||||||||||||||||||||||||||||
| 6586 | - | |||||||||||||||||||||||||||||||
| 6587 | - | |||||||||||||||||||||||||||||||
| 6588 | - | |||||||||||||||||||||||||||||||
| 6589 | - | |||||||||||||||||||||||||||||||
| 6590 | void QGraphicsItemGroup::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, | - | ||||||||||||||||||||||||||||||
| 6591 | QWidget *widget) | - | ||||||||||||||||||||||||||||||
| 6592 | { | - | ||||||||||||||||||||||||||||||
| 6593 | (void)widget;; | - | ||||||||||||||||||||||||||||||
| 6594 |     if (option->state & QStyle::State_Selected
  | 0 | ||||||||||||||||||||||||||||||
| 6595 | QGraphicsItemGroupPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
| 6596 | painter->setBrush(Qt::NoBrush); | - | ||||||||||||||||||||||||||||||
| 6597 | painter->drawRect(d->itemsBoundingRect); | - | ||||||||||||||||||||||||||||||
| 6598 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6599 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6600 | - | |||||||||||||||||||||||||||||||
| 6601 | - | |||||||||||||||||||||||||||||||
| 6602 | - | |||||||||||||||||||||||||||||||
| 6603 | - | |||||||||||||||||||||||||||||||
| 6604 | bool QGraphicsItemGroup::isObscuredBy(const QGraphicsItem *item) const | - | ||||||||||||||||||||||||||||||
| 6605 | { | - | ||||||||||||||||||||||||||||||
| 6606 |     return never executed:   QGraphicsItem::isObscuredBy(item);return QGraphicsItem::isObscuredBy(item);never executed:  return QGraphicsItem::isObscuredBy(item); | 0 | ||||||||||||||||||||||||||||||
| 6607 | } | - | ||||||||||||||||||||||||||||||
| 6608 | - | |||||||||||||||||||||||||||||||
| 6609 | - | |||||||||||||||||||||||||||||||
| 6610 | - | |||||||||||||||||||||||||||||||
| 6611 | - | |||||||||||||||||||||||||||||||
| 6612 | QPainterPath QGraphicsItemGroup::opaqueArea() const | - | ||||||||||||||||||||||||||||||
| 6613 | { | - | ||||||||||||||||||||||||||||||
| 6614 |     return never executed:   QGraphicsItem::opaqueArea();return QGraphicsItem::opaqueArea();never executed:  return QGraphicsItem::opaqueArea(); | 0 | ||||||||||||||||||||||||||||||
| 6615 | } | - | ||||||||||||||||||||||||||||||
| 6616 | - | |||||||||||||||||||||||||||||||
| 6617 | - | |||||||||||||||||||||||||||||||
| 6618 | - | |||||||||||||||||||||||||||||||
| 6619 | - | |||||||||||||||||||||||||||||||
| 6620 | int QGraphicsItemGroup::type() const | - | ||||||||||||||||||||||||||||||
| 6621 | { | - | ||||||||||||||||||||||||||||||
| 6622 |     return never executed:   Type;return Type;never executed:  return Type; | 0 | ||||||||||||||||||||||||||||||
| 6623 | } | - | ||||||||||||||||||||||||||||||
| 6624 | - | |||||||||||||||||||||||||||||||
| 6625 | - | |||||||||||||||||||||||||||||||
| 6626 | QRectF QGraphicsItemEffectSourcePrivate::boundingRect(Qt::CoordinateSystem system) const | - | ||||||||||||||||||||||||||||||
| 6627 | { | - | ||||||||||||||||||||||||||||||
| 6628 | const bool deviceCoordinates = (system == Qt::DeviceCoordinates); | - | ||||||||||||||||||||||||||||||
| 6629 |     if (!info
 
  | 0 | ||||||||||||||||||||||||||||||
| 6630 | - | |||||||||||||||||||||||||||||||
| 6631 | QMessageLogger(__FILE__, 11149, __PRETTY_FUNCTION__).warning("QGraphicsEffectSource::boundingRect: Not yet implemented, lacking device context"); | - | ||||||||||||||||||||||||||||||
| 6632 |         return never executed:   QRectF();return QRectF();never executed:  return QRectF(); | 0 | ||||||||||||||||||||||||||||||
| 6633 | } | - | ||||||||||||||||||||||||||||||
| 6634 | - | |||||||||||||||||||||||||||||||
| 6635 | QRectF rect = item->boundingRect(); | - | ||||||||||||||||||||||||||||||
| 6636 |     if (!item->d_ptr->children.isEmpty()
  | 0 | ||||||||||||||||||||||||||||||
| 6637 |         rect |= item->childrenBoundingRect(); never executed:  rect |= item->childrenBoundingRect(); | 0 | ||||||||||||||||||||||||||||||
| 6638 | - | |||||||||||||||||||||||||||||||
| 6639 |     if (deviceCoordinates
  | 0 | ||||||||||||||||||||||||||||||
| 6640 | ((!(info->painter)) ? qt_assert("info->painter",__FILE__,11158) : qt_noop()); | - | ||||||||||||||||||||||||||||||
| 6641 | rect = info->painter->worldTransform().mapRect(rect); | - | ||||||||||||||||||||||||||||||
| 6642 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6643 | - | |||||||||||||||||||||||||||||||
| 6644 |     return never executed:   rect;return rect;never executed:  return rect; | 0 | ||||||||||||||||||||||||||||||
| 6645 | } | - | ||||||||||||||||||||||||||||||
| 6646 | - | |||||||||||||||||||||||||||||||
| 6647 | void QGraphicsItemEffectSourcePrivate::draw(QPainter *painter) | - | ||||||||||||||||||||||||||||||
| 6648 | { | - | ||||||||||||||||||||||||||||||
| 6649 |     if (!info
  | 0 | ||||||||||||||||||||||||||||||
| 6650 | QMessageLogger(__FILE__, 11168, __PRETTY_FUNCTION__).warning("QGraphicsEffectSource::draw: Can only begin as a result of QGraphicsEffect::draw"); | - | ||||||||||||||||||||||||||||||
| 6651 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||||||||
| 6652 | } | - | ||||||||||||||||||||||||||||||
| 6653 | - | |||||||||||||||||||||||||||||||
| 6654 | ((!(item->d_ptr->scene)) ? qt_assert("item->d_ptr->scene",__FILE__,11172) : qt_noop()); | - | ||||||||||||||||||||||||||||||
| 6655 | QGraphicsScenePrivate *scened = item->d_ptr->scene->d_func(); | - | ||||||||||||||||||||||||||||||
| 6656 |     if (painter == info->painter
  | 0 | ||||||||||||||||||||||||||||||
| 6657 | scened->draw(item, painter, info->viewTransform, info->transformPtr, info->exposedRegion, | - | ||||||||||||||||||||||||||||||
| 6658 | info->widget, info->opacity, info->effectTransform, info->wasDirtySceneTransform, | - | ||||||||||||||||||||||||||||||
| 6659 | info->drawItem); | - | ||||||||||||||||||||||||||||||
| 6660 |     } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||
| 6661 | QTransform effectTransform = info->painter->worldTransform().inverted(); | - | ||||||||||||||||||||||||||||||
| 6662 | effectTransform *= painter->worldTransform(); | - | ||||||||||||||||||||||||||||||
| 6663 | scened->draw(item, painter, info->viewTransform, info->transformPtr, info->exposedRegion, | - | ||||||||||||||||||||||||||||||
| 6664 | info->widget, info->opacity, &effectTransform, info->wasDirtySceneTransform, | - | ||||||||||||||||||||||||||||||
| 6665 | info->drawItem); | - | ||||||||||||||||||||||||||||||
| 6666 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6667 | } | - | ||||||||||||||||||||||||||||||
| 6668 | - | |||||||||||||||||||||||||||||||
| 6669 | - | |||||||||||||||||||||||||||||||
| 6670 | QRect QGraphicsItemEffectSourcePrivate::paddedEffectRect(Qt::CoordinateSystem system, QGraphicsEffect::PixmapPadMode mode, const QRectF &sourceRect, bool *unpadded) const | - | ||||||||||||||||||||||||||||||
| 6671 | { | - | ||||||||||||||||||||||||||||||
| 6672 | QRectF effectRectF; | - | ||||||||||||||||||||||||||||||
| 6673 | - | |||||||||||||||||||||||||||||||
| 6674 |     if (unpadded
  | 0 | ||||||||||||||||||||||||||||||
| 6675 |         * never executed:  unpadded = false;*unpadded = false;never executed:  *unpadded = false; | 0 | ||||||||||||||||||||||||||||||
| 6676 | - | |||||||||||||||||||||||||||||||
| 6677 |     if (mode == QGraphicsEffect::PadToEffectiveBoundingRect
  | 0 | ||||||||||||||||||||||||||||||
| 6678 |         if (info
  | 0 | ||||||||||||||||||||||||||||||
| 6679 |             QRectF deviceRect = system == Qt::DeviceCoordinates
  | 0 | ||||||||||||||||||||||||||||||
| 6680 | effectRectF = item->graphicsEffect()->boundingRectFor(deviceRect); | - | ||||||||||||||||||||||||||||||
| 6681 |             if (unpadded
  | 0 | ||||||||||||||||||||||||||||||
| 6682 |                 * never executed:  unpadded = (effectRectF.size() == sourceRect.size());*unpadded = (effectRectF.size() == sourceRect.size());never executed:  *unpadded = (effectRectF.size() == sourceRect.size()); | 0 | ||||||||||||||||||||||||||||||
| 6683 |             if (info
 
  | 0 | ||||||||||||||||||||||||||||||
| 6684 |                 effectRectF = info->painter->worldTransform().inverted().mapRect(effectRectF); never executed:  effectRectF = info->painter->worldTransform().inverted().mapRect(effectRectF); | 0 | ||||||||||||||||||||||||||||||
| 6685 |         } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||
| 6686 | - | |||||||||||||||||||||||||||||||
| 6687 | effectRectF = item->graphicsEffect()->boundingRectFor(sourceRect); | - | ||||||||||||||||||||||||||||||
| 6688 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6689 |     } else if (mode == QGraphicsEffect::PadToTransparentBorder
  | 0 | ||||||||||||||||||||||||||||||
| 6690 | - | |||||||||||||||||||||||||||||||
| 6691 | effectRectF = sourceRect.adjusted(-1.5, -1.5, 1.5, 1.5); | - | ||||||||||||||||||||||||||||||
| 6692 |     } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||
| 6693 | effectRectF = sourceRect; | - | ||||||||||||||||||||||||||||||
| 6694 |         if (unpadded
  | 0 | ||||||||||||||||||||||||||||||
| 6695 |             * never executed:  unpadded = true;*unpadded = true;never executed:  *unpadded = true; | 0 | ||||||||||||||||||||||||||||||
| 6696 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6697 | - | |||||||||||||||||||||||||||||||
| 6698 |     return never executed:   effectRectF.toAlignedRect();return effectRectF.toAlignedRect();never executed:  return effectRectF.toAlignedRect(); | 0 | ||||||||||||||||||||||||||||||
| 6699 | } | - | ||||||||||||||||||||||||||||||
| 6700 | - | |||||||||||||||||||||||||||||||
| 6701 | QPixmap QGraphicsItemEffectSourcePrivate::pixmap(Qt::CoordinateSystem system, QPoint *offset, | - | ||||||||||||||||||||||||||||||
| 6702 | QGraphicsEffect::PixmapPadMode mode) const | - | ||||||||||||||||||||||||||||||
| 6703 | { | - | ||||||||||||||||||||||||||||||
| 6704 | const bool deviceCoordinates = (system == Qt::DeviceCoordinates); | - | ||||||||||||||||||||||||||||||
| 6705 |     if (!info
 
  | 0 | ||||||||||||||||||||||||||||||
| 6706 | - | |||||||||||||||||||||||||||||||
| 6707 | QMessageLogger(__FILE__, 11225, __PRETTY_FUNCTION__).warning("QGraphicsEffectSource::pixmap: Not yet implemented, lacking device context"); | - | ||||||||||||||||||||||||||||||
| 6708 |         return never executed:   QPixmap();return QPixmap();never executed:  return QPixmap(); | 0 | ||||||||||||||||||||||||||||||
| 6709 | } | - | ||||||||||||||||||||||||||||||
| 6710 |     if (!item->d_ptr->scene
  | 0 | ||||||||||||||||||||||||||||||
| 6711 |         return never executed:   QPixmap();return QPixmap();never executed:  return QPixmap(); | 0 | ||||||||||||||||||||||||||||||
| 6712 | QGraphicsScenePrivate *scened = item->d_ptr->scene->d_func(); | - | ||||||||||||||||||||||||||||||
| 6713 | - | |||||||||||||||||||||||||||||||
| 6714 | bool unpadded; | - | ||||||||||||||||||||||||||||||
| 6715 | const QRectF sourceRect = boundingRect(system); | - | ||||||||||||||||||||||||||||||
| 6716 | QRect effectRect = paddedEffectRect(system, mode, sourceRect, &unpadded); | - | ||||||||||||||||||||||||||||||
| 6717 | - | |||||||||||||||||||||||||||||||
| 6718 |     if (offset
  | 0 | ||||||||||||||||||||||||||||||
| 6719 |         * never executed:  offset = effectRect.topLeft();*offset = effectRect.topLeft();never executed:  *offset = effectRect.topLeft(); | 0 | ||||||||||||||||||||||||||||||
| 6720 | - | |||||||||||||||||||||||||||||||
| 6721 |     bool untransformed = !deviceCoordinates
  | 0 | ||||||||||||||||||||||||||||||
| 6722 |             || info->painter->worldTransform().type() <= QTransform::TxTranslate
  | 0 | ||||||||||||||||||||||||||||||
| 6723 |     if (untransformed
 
 
  | 0 | ||||||||||||||||||||||||||||||
| 6724 |         if (offset
  | 0 | ||||||||||||||||||||||||||||||
| 6725 |             * never executed:  offset = boundingRect(system).topLeft().toPoint();*offset = boundingRect(system).topLeft().toPoint();never executed:  *offset = boundingRect(system).topLeft().toPoint(); | 0 | ||||||||||||||||||||||||||||||
| 6726 |         return never executed:   static_cast<QGraphicsPixmapItem *>(item)->pixmap();return static_cast<QGraphicsPixmapItem *>(item)->pixmap();never executed:  return static_cast<QGraphicsPixmapItem *>(item)->pixmap(); | 0 | ||||||||||||||||||||||||||||||
| 6727 | } | - | ||||||||||||||||||||||||||||||
| 6728 | - | |||||||||||||||||||||||||||||||
| 6729 |     if (effectRect.isEmpty()
  | 0 | ||||||||||||||||||||||||||||||
| 6730 |         return never executed:   QPixmap();return QPixmap();never executed:  return QPixmap(); | 0 | ||||||||||||||||||||||||||||||
| 6731 | - | |||||||||||||||||||||||||||||||
| 6732 | QPixmap pixmap(effectRect.size()); | - | ||||||||||||||||||||||||||||||
| 6733 | pixmap.fill(Qt::transparent); | - | ||||||||||||||||||||||||||||||
| 6734 | QPainter pixmapPainter(&pixmap); | - | ||||||||||||||||||||||||||||||
| 6735 | pixmapPainter.setRenderHints(info ? info->painter->renderHints() : QPainter::TextAntialiasing); | - | ||||||||||||||||||||||||||||||
| 6736 | - | |||||||||||||||||||||||||||||||
| 6737 | QTransform effectTransform = QTransform::fromTranslate(-effectRect.x(), -effectRect.y()); | - | ||||||||||||||||||||||||||||||
| 6738 |     if (deviceCoordinates
 
  | 0 | ||||||||||||||||||||||||||||||
| 6739 |         effectTransform *= *info->effectTransform; never executed:  effectTransform *= *info->effectTransform; | 0 | ||||||||||||||||||||||||||||||
| 6740 | - | |||||||||||||||||||||||||||||||
| 6741 |     if (!info
  | 0 | ||||||||||||||||||||||||||||||
| 6742 | - | |||||||||||||||||||||||||||||||
| 6743 | QTransform sceneTransform = item->sceneTransform(); | - | ||||||||||||||||||||||||||||||
| 6744 | QTransform newEffectTransform = sceneTransform.inverted(); | - | ||||||||||||||||||||||||||||||
| 6745 | newEffectTransform *= effectTransform; | - | ||||||||||||||||||||||||||||||
| 6746 | scened->draw(item, &pixmapPainter, 0, &sceneTransform, 0, 0, qreal(1.0), | - | ||||||||||||||||||||||||||||||
| 6747 | &newEffectTransform, false, true); | - | ||||||||||||||||||||||||||||||
| 6748 |     } never executed:   else if (deviceCoordinatesend of block
  | 0 | ||||||||||||||||||||||||||||||
| 6749 | - | |||||||||||||||||||||||||||||||
| 6750 | scened->draw(item, &pixmapPainter, info->viewTransform, info->transformPtr, 0, | - | ||||||||||||||||||||||||||||||
| 6751 | info->widget, info->opacity, &effectTransform, info->wasDirtySceneTransform, | - | ||||||||||||||||||||||||||||||
| 6752 | info->drawItem); | - | ||||||||||||||||||||||||||||||
| 6753 |     } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||
| 6754 | - | |||||||||||||||||||||||||||||||
| 6755 | QTransform newEffectTransform = info->transformPtr->inverted(); | - | ||||||||||||||||||||||||||||||
| 6756 | newEffectTransform *= effectTransform; | - | ||||||||||||||||||||||||||||||
| 6757 | scened->draw(item, &pixmapPainter, info->viewTransform, info->transformPtr, 0, | - | ||||||||||||||||||||||||||||||
| 6758 | info->widget, info->opacity, &newEffectTransform, info->wasDirtySceneTransform, | - | ||||||||||||||||||||||||||||||
| 6759 | info->drawItem); | - | ||||||||||||||||||||||||||||||
| 6760 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6761 | - | |||||||||||||||||||||||||||||||
| 6762 | pixmapPainter.end(); | - | ||||||||||||||||||||||||||||||
| 6763 | - | |||||||||||||||||||||||||||||||
| 6764 |     return never executed:   pixmap;return pixmap;never executed:  return pixmap; | 0 | ||||||||||||||||||||||||||||||
| 6765 | } | - | ||||||||||||||||||||||||||||||
| 6766 | - | |||||||||||||||||||||||||||||||
| 6767 | - | |||||||||||||||||||||||||||||||
| 6768 | - | |||||||||||||||||||||||||||||||
| 6769 | static void formatGraphicsItemHelper(QDebug debug, const QGraphicsItem *item) | - | ||||||||||||||||||||||||||||||
| 6770 | { | - | ||||||||||||||||||||||||||||||
| 6771 |     if (const
 
  | 0 | ||||||||||||||||||||||||||||||
| 6772 |           debug << ", parent=" << static_cast<const void *>(parent); never executed:  debug << ", parent=" << static_cast<const void *>(parent); | 0 | ||||||||||||||||||||||||||||||
| 6773 | debug << ", pos="; | - | ||||||||||||||||||||||||||||||
| 6774 | QtDebugUtils::formatQPoint(debug, item->pos()); | - | ||||||||||||||||||||||||||||||
| 6775 |     if (const
 
  | 0 | ||||||||||||||||||||||||||||||
| 6776 |         debug << ", z=" << z; never executed:  debug << ", z=" << z; | 0 | ||||||||||||||||||||||||||||||
| 6777 |     if (item->flags()
  | 0 | ||||||||||||||||||||||||||||||
| 6778 |         debug << ", flags=" << item->flags(); never executed:  debug << ", flags=" << item->flags(); | 0 | ||||||||||||||||||||||||||||||
| 6779 | } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6780 | - | |||||||||||||||||||||||||||||||
| 6781 | - | |||||||||||||||||||||||||||||||
| 6782 | QDebug operator<<(QDebug debug, QGraphicsItem *item) | - | ||||||||||||||||||||||||||||||
| 6783 | { | - | ||||||||||||||||||||||||||||||
| 6784 | QDebugStateSaver saver(debug); | - | ||||||||||||||||||||||||||||||
| 6785 | debug.nospace(); | - | ||||||||||||||||||||||||||||||
| 6786 | - | |||||||||||||||||||||||||||||||
| 6787 |     if (!item
  | 0 | ||||||||||||||||||||||||||||||
| 6788 | debug << "QGraphicsItem(0)"; | - | ||||||||||||||||||||||||||||||
| 6789 |         return never executed:   debug;return debug;never executed:  return debug; | 0 | ||||||||||||||||||||||||||||||
| 6790 | } | - | ||||||||||||||||||||||||||||||
| 6791 | - | |||||||||||||||||||||||||||||||
| 6792 |     if (QGraphicsObject *o = item->toGraphicsObject()
  | 0 | ||||||||||||||||||||||||||||||
| 6793 |         debug << o->metaObject()->className(); never executed:  debug << o->metaObject()->className(); | 0 | ||||||||||||||||||||||||||||||
| 6794 | else | - | ||||||||||||||||||||||||||||||
| 6795 |         debug << "QGraphicsItem"; never executed:  debug << "QGraphicsItem"; | 0 | ||||||||||||||||||||||||||||||
| 6796 | debug << '(' << static_cast<const void *>(item); | - | ||||||||||||||||||||||||||||||
| 6797 |     if (const
 
  | 0 | ||||||||||||||||||||||||||||||
| 6798 | debug << ", widget="; | - | ||||||||||||||||||||||||||||||
| 6799 |         if (const
 
  | 0 | ||||||||||||||||||||||||||||||
| 6800 | debug << w->metaObject()->className() << '(' << static_cast<const void *>(w); | - | ||||||||||||||||||||||||||||||
| 6801 |             if (!w->objectName().isEmpty()
  | 0 | ||||||||||||||||||||||||||||||
| 6802 |                 debug << ", name=" << w->objectName(); never executed:  debug << ", name=" << w->objectName(); | 0 | ||||||||||||||||||||||||||||||
| 6803 | debug << ')'; | - | ||||||||||||||||||||||||||||||
| 6804 |         } never executed:   else {end of block | 0 | ||||||||||||||||||||||||||||||
| 6805 | debug << "QWidget(0)"; | - | ||||||||||||||||||||||||||||||
| 6806 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 6807 | } | - | ||||||||||||||||||||||||||||||
| 6808 | formatGraphicsItemHelper(debug, item); | - | ||||||||||||||||||||||||||||||
| 6809 | debug << ')'; | - | ||||||||||||||||||||||||||||||
| 6810 |     return never executed:   debug;return debug;never executed:  return debug; | 0 | ||||||||||||||||||||||||||||||
| 6811 | } | - | ||||||||||||||||||||||||||||||
| 6812 | - | |||||||||||||||||||||||||||||||
| 6813 | - | |||||||||||||||||||||||||||||||
| 6814 | QDebug operator<<(QDebug debug, QGraphicsObject *item) | - | ||||||||||||||||||||||||||||||
| 6815 | { | - | ||||||||||||||||||||||||||||||
| 6816 | QDebugStateSaver saver(debug); | - | ||||||||||||||||||||||||||||||
| 6817 | debug.nospace(); | - | ||||||||||||||||||||||||||||||
| 6818 | - | |||||||||||||||||||||||||||||||
| 6819 |     if (!item
  | 0 | ||||||||||||||||||||||||||||||
| 6820 | debug << "QGraphicsObject(0)"; | - | ||||||||||||||||||||||||||||||
| 6821 |         return never executed:   debug;return debug;never executed:  return debug; | 0 | ||||||||||||||||||||||||||||||
| 6822 | } | - | ||||||||||||||||||||||||||||||
| 6823 | - | |||||||||||||||||||||||||||||||
| 6824 | debug << item->metaObject()->className() << '(' << static_cast<const void *>(item); | - | ||||||||||||||||||||||||||||||
| 6825 |     if (!item->objectName().isEmpty()
  | 0 | ||||||||||||||||||||||||||||||
| 6826 |         debug << ", name=" << item->objectName(); never executed:  debug << ", name=" << item->objectName(); | 0 | ||||||||||||||||||||||||||||||
| 6827 | formatGraphicsItemHelper(debug, item); | - | ||||||||||||||||||||||||||||||
| 6828 | debug << ')'; | - | ||||||||||||||||||||||||||||||
| 6829 |     return never executed:   debug;return debug;never executed:  return debug; | 0 | ||||||||||||||||||||||||||||||
| 6830 | } | - | ||||||||||||||||||||||||||||||
| 6831 | - | |||||||||||||||||||||||||||||||
| 6832 | QDebug operator<<(QDebug debug, QGraphicsItem::GraphicsItemChange change) | - | ||||||||||||||||||||||||||||||
| 6833 | { | - | ||||||||||||||||||||||||||||||
| 6834 | const char *str = "UnknownChange"; | - | ||||||||||||||||||||||||||||||
| 6835 | switch (change) { | - | ||||||||||||||||||||||||||||||
| 6836 |     case never executed:   QGraphicsItem::ItemChildAddedChange:case QGraphicsItem::ItemChildAddedChange:never executed:  case QGraphicsItem::ItemChildAddedChange: | 0 | ||||||||||||||||||||||||||||||
| 6837 | str = "ItemChildAddedChange"; | - | ||||||||||||||||||||||||||||||
| 6838 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6839 |     case never executed:   QGraphicsItem::ItemChildRemovedChange:case QGraphicsItem::ItemChildRemovedChange:never executed:  case QGraphicsItem::ItemChildRemovedChange: | 0 | ||||||||||||||||||||||||||||||
| 6840 | str = "ItemChildRemovedChange"; | - | ||||||||||||||||||||||||||||||
| 6841 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6842 |     case never executed:   QGraphicsItem::ItemCursorChange:case QGraphicsItem::ItemCursorChange:never executed:  case QGraphicsItem::ItemCursorChange: | 0 | ||||||||||||||||||||||||||||||
| 6843 | str = "ItemCursorChange"; | - | ||||||||||||||||||||||||||||||
| 6844 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6845 |     case never executed:   QGraphicsItem::ItemCursorHasChanged:case QGraphicsItem::ItemCursorHasChanged:never executed:  case QGraphicsItem::ItemCursorHasChanged: | 0 | ||||||||||||||||||||||||||||||
| 6846 | str = "ItemCursorHasChanged"; | - | ||||||||||||||||||||||||||||||
| 6847 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6848 |     case never executed:   QGraphicsItem::ItemEnabledChange:case QGraphicsItem::ItemEnabledChange:never executed:  case QGraphicsItem::ItemEnabledChange: | 0 | ||||||||||||||||||||||||||||||
| 6849 | str = "ItemEnabledChange"; | - | ||||||||||||||||||||||||||||||
| 6850 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6851 |     case never executed:   QGraphicsItem::ItemEnabledHasChanged:case QGraphicsItem::ItemEnabledHasChanged:never executed:  case QGraphicsItem::ItemEnabledHasChanged: | 0 | ||||||||||||||||||||||||||||||
| 6852 | str = "ItemEnabledHasChanged"; | - | ||||||||||||||||||||||||||||||
| 6853 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6854 |     case never executed:   QGraphicsItem::ItemFlagsChange:case QGraphicsItem::ItemFlagsChange:never executed:  case QGraphicsItem::ItemFlagsChange: | 0 | ||||||||||||||||||||||||||||||
| 6855 | str = "ItemFlagsChange"; | - | ||||||||||||||||||||||||||||||
| 6856 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6857 |     case never executed:   QGraphicsItem::ItemFlagsHaveChanged:case QGraphicsItem::ItemFlagsHaveChanged:never executed:  case QGraphicsItem::ItemFlagsHaveChanged: | 0 | ||||||||||||||||||||||||||||||
| 6858 | str = "ItemFlagsHaveChanged"; | - | ||||||||||||||||||||||||||||||
| 6859 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6860 |     case never executed:   QGraphicsItem::ItemMatrixChange:case QGraphicsItem::ItemMatrixChange:never executed:  case QGraphicsItem::ItemMatrixChange: | 0 | ||||||||||||||||||||||||||||||
| 6861 | str = "ItemMatrixChange"; | - | ||||||||||||||||||||||||||||||
| 6862 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6863 |     case never executed:   QGraphicsItem::ItemParentChange:case QGraphicsItem::ItemParentChange:never executed:  case QGraphicsItem::ItemParentChange: | 0 | ||||||||||||||||||||||||||||||
| 6864 | str = "ItemParentChange"; | - | ||||||||||||||||||||||||||||||
| 6865 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6866 |     case never executed:   QGraphicsItem::ItemParentHasChanged:case QGraphicsItem::ItemParentHasChanged:never executed:  case QGraphicsItem::ItemParentHasChanged: | 0 | ||||||||||||||||||||||||||||||
| 6867 | str = "ItemParentHasChanged"; | - | ||||||||||||||||||||||||||||||
| 6868 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6869 |     case never executed:   QGraphicsItem::ItemPositionChange:case QGraphicsItem::ItemPositionChange:never executed:  case QGraphicsItem::ItemPositionChange: | 0 | ||||||||||||||||||||||||||||||
| 6870 | str = "ItemPositionChange"; | - | ||||||||||||||||||||||||||||||
| 6871 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6872 |     case never executed:   QGraphicsItem::ItemPositionHasChanged:case QGraphicsItem::ItemPositionHasChanged:never executed:  case QGraphicsItem::ItemPositionHasChanged: | 0 | ||||||||||||||||||||||||||||||
| 6873 | str = "ItemPositionHasChanged"; | - | ||||||||||||||||||||||||||||||
| 6874 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6875 |     case never executed:   QGraphicsItem::ItemSceneChange:case QGraphicsItem::ItemSceneChange:never executed:  case QGraphicsItem::ItemSceneChange: | 0 | ||||||||||||||||||||||||||||||
| 6876 | str = "ItemSceneChange"; | - | ||||||||||||||||||||||||||||||
| 6877 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6878 |     case never executed:   QGraphicsItem::ItemSceneHasChanged:case QGraphicsItem::ItemSceneHasChanged:never executed:  case QGraphicsItem::ItemSceneHasChanged: | 0 | ||||||||||||||||||||||||||||||
| 6879 | str = "ItemSceneHasChanged"; | - | ||||||||||||||||||||||||||||||
| 6880 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6881 |     case never executed:   QGraphicsItem::ItemSelectedChange:case QGraphicsItem::ItemSelectedChange:never executed:  case QGraphicsItem::ItemSelectedChange: | 0 | ||||||||||||||||||||||||||||||
| 6882 | str = "ItemSelectedChange"; | - | ||||||||||||||||||||||||||||||
| 6883 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6884 |     case never executed:   QGraphicsItem::ItemSelectedHasChanged:case QGraphicsItem::ItemSelectedHasChanged:never executed:  case QGraphicsItem::ItemSelectedHasChanged: | 0 | ||||||||||||||||||||||||||||||
| 6885 | str = "ItemSelectedHasChanged"; | - | ||||||||||||||||||||||||||||||
| 6886 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6887 |     case never executed:   QGraphicsItem::ItemToolTipChange:case QGraphicsItem::ItemToolTipChange:never executed:  case QGraphicsItem::ItemToolTipChange: | 0 | ||||||||||||||||||||||||||||||
| 6888 | str = "ItemToolTipChange"; | - | ||||||||||||||||||||||||||||||
| 6889 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6890 |     case never executed:   QGraphicsItem::ItemToolTipHasChanged:case QGraphicsItem::ItemToolTipHasChanged:never executed:  case QGraphicsItem::ItemToolTipHasChanged: | 0 | ||||||||||||||||||||||||||||||
| 6891 | str = "ItemToolTipHasChanged"; | - | ||||||||||||||||||||||||||||||
| 6892 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6893 |     case never executed:   QGraphicsItem::ItemTransformChange:case QGraphicsItem::ItemTransformChange:never executed:  case QGraphicsItem::ItemTransformChange: | 0 | ||||||||||||||||||||||||||||||
| 6894 | str = "ItemTransformChange"; | - | ||||||||||||||||||||||||||||||
| 6895 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6896 |     case never executed:   QGraphicsItem::ItemTransformHasChanged:case QGraphicsItem::ItemTransformHasChanged:never executed:  case QGraphicsItem::ItemTransformHasChanged: | 0 | ||||||||||||||||||||||||||||||
| 6897 | str = "ItemTransformHasChanged"; | - | ||||||||||||||||||||||||||||||
| 6898 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6899 |     case never executed:   QGraphicsItem::ItemVisibleChange:case QGraphicsItem::ItemVisibleChange:never executed:  case QGraphicsItem::ItemVisibleChange: | 0 | ||||||||||||||||||||||||||||||
| 6900 | str = "ItemVisibleChange"; | - | ||||||||||||||||||||||||||||||
| 6901 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6902 |     case never executed:   QGraphicsItem::ItemVisibleHasChanged:case QGraphicsItem::ItemVisibleHasChanged:never executed:  case QGraphicsItem::ItemVisibleHasChanged: | 0 | ||||||||||||||||||||||||||||||
| 6903 | str = "ItemVisibleHasChanged"; | - | ||||||||||||||||||||||||||||||
| 6904 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6905 |     case never executed:   QGraphicsItem::ItemZValueChange:case QGraphicsItem::ItemZValueChange:never executed:  case QGraphicsItem::ItemZValueChange: | 0 | ||||||||||||||||||||||||||||||
| 6906 | str = "ItemZValueChange"; | - | ||||||||||||||||||||||||||||||
| 6907 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6908 |     case never executed:   QGraphicsItem::ItemZValueHasChanged:case QGraphicsItem::ItemZValueHasChanged:never executed:  case QGraphicsItem::ItemZValueHasChanged: | 0 | ||||||||||||||||||||||||||||||
| 6909 | str = "ItemZValueHasChanged"; | - | ||||||||||||||||||||||||||||||
| 6910 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6911 |     case never executed:   QGraphicsItem::ItemOpacityChange:case QGraphicsItem::ItemOpacityChange:never executed:  case QGraphicsItem::ItemOpacityChange: | 0 | ||||||||||||||||||||||||||||||
| 6912 | str = "ItemOpacityChange"; | - | ||||||||||||||||||||||||||||||
| 6913 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6914 |     case never executed:   QGraphicsItem::ItemOpacityHasChanged:case QGraphicsItem::ItemOpacityHasChanged:never executed:  case QGraphicsItem::ItemOpacityHasChanged: | 0 | ||||||||||||||||||||||||||||||
| 6915 | str = "ItemOpacityHasChanged"; | - | ||||||||||||||||||||||||||||||
| 6916 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6917 |     case never executed:   QGraphicsItem::ItemScenePositionHasChanged:case QGraphicsItem::ItemScenePositionHasChanged:never executed:  case QGraphicsItem::ItemScenePositionHasChanged: | 0 | ||||||||||||||||||||||||||||||
| 6918 | str = "ItemScenePositionHasChanged"; | - | ||||||||||||||||||||||||||||||
| 6919 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6920 |     case never executed:   QGraphicsItem::ItemRotationChange:case QGraphicsItem::ItemRotationChange:never executed:  case QGraphicsItem::ItemRotationChange: | 0 | ||||||||||||||||||||||||||||||
| 6921 | str = "ItemRotationChange"; | - | ||||||||||||||||||||||||||||||
| 6922 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6923 |     case never executed:   QGraphicsItem::ItemRotationHasChanged:case QGraphicsItem::ItemRotationHasChanged:never executed:  case QGraphicsItem::ItemRotationHasChanged: | 0 | ||||||||||||||||||||||||||||||
| 6924 | str = "ItemRotationHasChanged"; | - | ||||||||||||||||||||||||||||||
| 6925 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6926 |     case never executed:   QGraphicsItem::ItemScaleChange:case QGraphicsItem::ItemScaleChange:never executed:  case QGraphicsItem::ItemScaleChange: | 0 | ||||||||||||||||||||||||||||||
| 6927 | str = "ItemScaleChange"; | - | ||||||||||||||||||||||||||||||
| 6928 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6929 |     case never executed:   QGraphicsItem::ItemScaleHasChanged:case QGraphicsItem::ItemScaleHasChanged:never executed:  case QGraphicsItem::ItemScaleHasChanged: | 0 | ||||||||||||||||||||||||||||||
| 6930 | str = "ItemScaleHasChanged"; | - | ||||||||||||||||||||||||||||||
| 6931 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6932 |     case never executed:   QGraphicsItem::ItemTransformOriginPointChange:case QGraphicsItem::ItemTransformOriginPointChange:never executed:  case QGraphicsItem::ItemTransformOriginPointChange: | 0 | ||||||||||||||||||||||||||||||
| 6933 | str = "ItemTransformOriginPointChange"; | - | ||||||||||||||||||||||||||||||
| 6934 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6935 |     case never executed:   QGraphicsItem::ItemTransformOriginPointHasChanged:case QGraphicsItem::ItemTransformOriginPointHasChanged:never executed:  case QGraphicsItem::ItemTransformOriginPointHasChanged: | 0 | ||||||||||||||||||||||||||||||
| 6936 | str = "ItemTransformOriginPointHasChanged"; | - | ||||||||||||||||||||||||||||||
| 6937 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6938 | } | - | ||||||||||||||||||||||||||||||
| 6939 | debug << str; | - | ||||||||||||||||||||||||||||||
| 6940 |     return never executed:   debug;return debug;never executed:  return debug; | 0 | ||||||||||||||||||||||||||||||
| 6941 | } | - | ||||||||||||||||||||||||||||||
| 6942 | - | |||||||||||||||||||||||||||||||
| 6943 | QDebug operator<<(QDebug debug, QGraphicsItem::GraphicsItemFlag flag) | - | ||||||||||||||||||||||||||||||
| 6944 | { | - | ||||||||||||||||||||||||||||||
| 6945 | const char *str = "UnknownFlag"; | - | ||||||||||||||||||||||||||||||
| 6946 | switch (flag) { | - | ||||||||||||||||||||||||||||||
| 6947 |     case never executed:   QGraphicsItem::ItemIsMovable:case QGraphicsItem::ItemIsMovable:never executed:  case QGraphicsItem::ItemIsMovable: | 0 | ||||||||||||||||||||||||||||||
| 6948 | str = "ItemIsMovable"; | - | ||||||||||||||||||||||||||||||
| 6949 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6950 |     case never executed:   QGraphicsItem::ItemIsSelectable:case QGraphicsItem::ItemIsSelectable:never executed:  case QGraphicsItem::ItemIsSelectable: | 0 | ||||||||||||||||||||||||||||||
| 6951 | str = "ItemIsSelectable"; | - | ||||||||||||||||||||||||||||||
| 6952 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6953 |     case never executed:   QGraphicsItem::ItemIsFocusable:case QGraphicsItem::ItemIsFocusable:never executed:  case QGraphicsItem::ItemIsFocusable: | 0 | ||||||||||||||||||||||||||||||
| 6954 | str = "ItemIsFocusable"; | - | ||||||||||||||||||||||||||||||
| 6955 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6956 |     case never executed:   QGraphicsItem::ItemClipsToShape:case QGraphicsItem::ItemClipsToShape:never executed:  case QGraphicsItem::ItemClipsToShape: | 0 | ||||||||||||||||||||||||||||||
| 6957 | str = "ItemClipsToShape"; | - | ||||||||||||||||||||||||||||||
| 6958 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6959 |     case never executed:   QGraphicsItem::ItemClipsChildrenToShape:case QGraphicsItem::ItemClipsChildrenToShape:never executed:  case QGraphicsItem::ItemClipsChildrenToShape: | 0 | ||||||||||||||||||||||||||||||
| 6960 | str = "ItemClipsChildrenToShape"; | - | ||||||||||||||||||||||||||||||
| 6961 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6962 |     case never executed:   QGraphicsItem::ItemIgnoresTransformations:case QGraphicsItem::ItemIgnoresTransformations:never executed:  case QGraphicsItem::ItemIgnoresTransformations: | 0 | ||||||||||||||||||||||||||||||
| 6963 | str = "ItemIgnoresTransformations"; | - | ||||||||||||||||||||||||||||||
| 6964 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6965 |     case never executed:   QGraphicsItem::ItemIgnoresParentOpacity:case QGraphicsItem::ItemIgnoresParentOpacity:never executed:  case QGraphicsItem::ItemIgnoresParentOpacity: | 0 | ||||||||||||||||||||||||||||||
| 6966 | str = "ItemIgnoresParentOpacity"; | - | ||||||||||||||||||||||||||||||
| 6967 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6968 |     case never executed:   QGraphicsItem::ItemDoesntPropagateOpacityToChildren:case QGraphicsItem::ItemDoesntPropagateOpacityToChildren:never executed:  case QGraphicsItem::ItemDoesntPropagateOpacityToChildren: | 0 | ||||||||||||||||||||||||||||||
| 6969 | str = "ItemDoesntPropagateOpacityToChildren"; | - | ||||||||||||||||||||||||||||||
| 6970 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6971 |     case never executed:   QGraphicsItem::ItemStacksBehindParent:case QGraphicsItem::ItemStacksBehindParent:never executed:  case QGraphicsItem::ItemStacksBehindParent: | 0 | ||||||||||||||||||||||||||||||
| 6972 | str = "ItemStacksBehindParent"; | - | ||||||||||||||||||||||||||||||
| 6973 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6974 |     case never executed:   QGraphicsItem::ItemUsesExtendedStyleOption:case QGraphicsItem::ItemUsesExtendedStyleOption:never executed:  case QGraphicsItem::ItemUsesExtendedStyleOption: | 0 | ||||||||||||||||||||||||||||||
| 6975 | str = "ItemUsesExtendedStyleOption"; | - | ||||||||||||||||||||||||||||||
| 6976 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6977 |     case never executed:   QGraphicsItem::ItemHasNoContents:case QGraphicsItem::ItemHasNoContents:never executed:  case QGraphicsItem::ItemHasNoContents: | 0 | ||||||||||||||||||||||||||||||
| 6978 | str = "ItemHasNoContents"; | - | ||||||||||||||||||||||||||||||
| 6979 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6980 |     case never executed:   QGraphicsItem::ItemSendsGeometryChanges:case QGraphicsItem::ItemSendsGeometryChanges:never executed:  case QGraphicsItem::ItemSendsGeometryChanges: | 0 | ||||||||||||||||||||||||||||||
| 6981 | str = "ItemSendsGeometryChanges"; | - | ||||||||||||||||||||||||||||||
| 6982 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6983 |     case never executed:   QGraphicsItem::ItemAcceptsInputMethod:case QGraphicsItem::ItemAcceptsInputMethod:never executed:  case QGraphicsItem::ItemAcceptsInputMethod: | 0 | ||||||||||||||||||||||||||||||
| 6984 | str = "ItemAcceptsInputMethod"; | - | ||||||||||||||||||||||||||||||
| 6985 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6986 |     case never executed:   QGraphicsItem::ItemNegativeZStacksBehindParent:case QGraphicsItem::ItemNegativeZStacksBehindParent:never executed:  case QGraphicsItem::ItemNegativeZStacksBehindParent: | 0 | ||||||||||||||||||||||||||||||
| 6987 | str = "ItemNegativeZStacksBehindParent"; | - | ||||||||||||||||||||||||||||||
| 6988 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6989 |     case never executed:   QGraphicsItem::ItemIsPanel:case QGraphicsItem::ItemIsPanel:never executed:  case QGraphicsItem::ItemIsPanel: | 0 | ||||||||||||||||||||||||||||||
| 6990 | str = "ItemIsPanel"; | - | ||||||||||||||||||||||||||||||
| 6991 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6992 |     case never executed:   QGraphicsItem::ItemIsFocusScope:case QGraphicsItem::ItemIsFocusScope:never executed:  case QGraphicsItem::ItemIsFocusScope: | 0 | ||||||||||||||||||||||||||||||
| 6993 | str = "ItemIsFocusScope"; | - | ||||||||||||||||||||||||||||||
| 6994 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6995 |     case never executed:   QGraphicsItem::ItemSendsScenePositionChanges:case QGraphicsItem::ItemSendsScenePositionChanges:never executed:  case QGraphicsItem::ItemSendsScenePositionChanges: | 0 | ||||||||||||||||||||||||||||||
| 6996 | str = "ItemSendsScenePositionChanges"; | - | ||||||||||||||||||||||||||||||
| 6997 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 6998 |     case never executed:   QGraphicsItem::ItemStopsClickFocusPropagation:case QGraphicsItem::ItemStopsClickFocusPropagation:never executed:  case QGraphicsItem::ItemStopsClickFocusPropagation: | 0 | ||||||||||||||||||||||||||||||
| 6999 | str = "ItemStopsClickFocusPropagation"; | - | ||||||||||||||||||||||||||||||
| 7000 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 7001 |     case never executed:   QGraphicsItem::ItemStopsFocusHandling:case QGraphicsItem::ItemStopsFocusHandling:never executed:  case QGraphicsItem::ItemStopsFocusHandling: | 0 | ||||||||||||||||||||||||||||||
| 7002 | str = "ItemStopsFocusHandling"; | - | ||||||||||||||||||||||||||||||
| 7003 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 7004 |     case never executed:   QGraphicsItem::ItemContainsChildrenInShape:case QGraphicsItem::ItemContainsChildrenInShape:never executed:  case QGraphicsItem::ItemContainsChildrenInShape: | 0 | ||||||||||||||||||||||||||||||
| 7005 | str = "ItemContainsChildrenInShape"; | - | ||||||||||||||||||||||||||||||
| 7006 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||||||||
| 7007 | } | - | ||||||||||||||||||||||||||||||
| 7008 | debug << str; | - | ||||||||||||||||||||||||||||||
| 7009 |     return never executed:   debug;return debug;never executed:  return debug; | 0 | ||||||||||||||||||||||||||||||
| 7010 | } | - | ||||||||||||||||||||||||||||||
| 7011 | - | |||||||||||||||||||||||||||||||
| 7012 | QDebug operator<<(QDebug debug, QGraphicsItem::GraphicsItemFlags flags) | - | ||||||||||||||||||||||||||||||
| 7013 | { | - | ||||||||||||||||||||||||||||||
| 7014 | debug << '('; | - | ||||||||||||||||||||||||||||||
| 7015 | bool f = false; | - | ||||||||||||||||||||||||||||||
| 7016 |     for (int i = 0; i < 17
  | 0 | ||||||||||||||||||||||||||||||
| 7017 |         if (flags & (1 << i)
  | 0 | ||||||||||||||||||||||||||||||
| 7018 |             if (f
  | 0 | ||||||||||||||||||||||||||||||
| 7019 |                 debug << '|'; never executed:  debug << '|'; | 0 | ||||||||||||||||||||||||||||||
| 7020 | f = true; | - | ||||||||||||||||||||||||||||||
| 7021 | debug << QGraphicsItem::GraphicsItemFlag(int(flags & (1 << i))); | - | ||||||||||||||||||||||||||||||
| 7022 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 7023 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||||||||
| 7024 | debug << ')'; | - | ||||||||||||||||||||||||||||||
| 7025 |     return never executed:   debug;return debug;never executed:  return debug; | 0 | ||||||||||||||||||||||||||||||
| 7026 | } | - | ||||||||||||||||||||||||||||||
| 7027 | - | |||||||||||||||||||||||||||||||
| 7028 | - | |||||||||||||||||||||||||||||||
| 7029 | - | |||||||||||||||||||||||||||||||
| 7030 | - | |||||||||||||||||||||||||||||||
| 7031 | - | |||||||||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |