Qt 4.8
qgraphicssceneindex.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtGui module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
61 #include "qdebug.h"
62 #include "qgraphicsscene.h"
63 #include "qgraphicsitem_p.h"
64 #include "qgraphicsscene_p.h"
65 #include "qgraphicswidget.h"
66 #include "qgraphicssceneindex_p.h"
68 
69 #ifndef QT_NO_GRAPHICSVIEW
70 
72 
74 {
75 public:
76  bool intersect(const QGraphicsItem *item, const QRectF &exposeRect, Qt::ItemSelectionMode mode,
77  const QTransform &deviceTransform) const
78  {
79  QRectF brect = item->boundingRect();
80  _q_adjustRect(&brect);
81 
82  // ### Add test for this (without making things slower?)
83  Q_UNUSED(exposeRect);
84 
85  bool keep = true;
87  if (itemd->itemIsUntransformable()) {
88  // Untransformable items; map the scene rect to item coordinates.
89  const QTransform transform = item->deviceTransform(deviceTransform);
90  QRectF itemRect = (deviceTransform * transform.inverted()).mapRect(sceneRect);
92  keep = itemRect.contains(brect) && itemRect != brect;
93  else
94  keep = itemRect.intersects(brect);
95  if (keep && (mode == Qt::ContainsItemShape || mode == Qt::IntersectsItemShape)) {
96  QPainterPath itemPath;
97  itemPath.addRect(itemRect);
98  keep = QGraphicsSceneIndexPrivate::itemCollidesWithPath(item, itemPath, mode);
99  }
100  } else {
101  Q_ASSERT(!itemd->dirtySceneTransform);
102  const QRectF itemSceneBoundingRect = itemd->sceneTransformTranslateOnly
103  ? brect.translated(itemd->sceneTransform.dx(),
104  itemd->sceneTransform.dy())
105  : itemd->sceneTransform.mapRect(brect);
107  keep = sceneRect != brect && sceneRect.contains(itemSceneBoundingRect);
108  else
109  keep = sceneRect.intersects(itemSceneBoundingRect);
110  if (keep && (mode == Qt::ContainsItemShape || mode == Qt::IntersectsItemShape)) {
111  QPainterPath rectPath;
112  rectPath.addRect(sceneRect);
113  if (itemd->sceneTransformTranslateOnly)
114  rectPath.translate(-itemd->sceneTransform.dx(), -itemd->sceneTransform.dy());
115  else
116  rectPath = itemd->sceneTransform.inverted().map(rectPath);
117  keep = QGraphicsSceneIndexPrivate::itemCollidesWithPath(item, rectPath, mode);
118  }
119  }
120  return keep;
121  }
122 
124 };
125 
127 {
128 public:
129  bool intersect(const QGraphicsItem *item, const QRectF &exposeRect, Qt::ItemSelectionMode mode,
130  const QTransform &deviceTransform) const
131  {
132  QRectF brect = item->boundingRect();
133  _q_adjustRect(&brect);
134 
135  // ### Add test for this (without making things slower?)
136  Q_UNUSED(exposeRect);
137 
138  bool keep = false;
139  const QGraphicsItemPrivate *itemd = QGraphicsItemPrivate::get(item);
140  if (itemd->itemIsUntransformable()) {
141  // Untransformable items; map the scene point to item coordinates.
142  const QTransform transform = item->deviceTransform(deviceTransform);
143  QPointF itemPoint = (deviceTransform * transform.inverted()).map(scenePoint);
144  keep = brect.contains(itemPoint);
145  if (keep && (mode == Qt::ContainsItemShape || mode == Qt::IntersectsItemShape)) {
146  QPainterPath pointPath;
147  pointPath.addRect(QRectF(itemPoint, QSizeF(1, 1)));
148  keep = QGraphicsSceneIndexPrivate::itemCollidesWithPath(item, pointPath, mode);
149  }
150  } else {
151  Q_ASSERT(!itemd->dirtySceneTransform);
152  QRectF sceneBoundingRect = itemd->sceneTransformTranslateOnly
153  ? brect.translated(itemd->sceneTransform.dx(),
154  itemd->sceneTransform.dy())
155  : itemd->sceneTransform.mapRect(brect);
156  keep = sceneBoundingRect.intersects(QRectF(scenePoint, QSizeF(1, 1)));
157  if (keep) {
159  ? QPointF(scenePoint.x() - itemd->sceneTransform.dx(),
160  scenePoint.y() - itemd->sceneTransform.dy())
161  : itemd->sceneTransform.inverted().map(scenePoint);
162  keep = item->contains(p);
163  }
164  }
165 
166  return keep;
167  }
168 
170 };
171 
173 {
174 public:
175  bool intersect(const QGraphicsItem *item, const QRectF &exposeRect, Qt::ItemSelectionMode mode,
176  const QTransform &deviceTransform) const
177  {
178  QRectF brect = item->boundingRect();
179  _q_adjustRect(&brect);
180 
181  // ### Add test for this (without making things slower?)
182  Q_UNUSED(exposeRect);
183 
184  bool keep = true;
185  const QGraphicsItemPrivate *itemd = QGraphicsItemPrivate::get(item);
186  if (itemd->itemIsUntransformable()) {
187  // Untransformable items; map the scene rect to item coordinates.
188  const QTransform transform = item->deviceTransform(deviceTransform);
189  QPainterPath itemPath = (deviceTransform * transform.inverted()).map(scenePath);
191  keep = itemPath.contains(brect);
192  else
193  keep = itemPath.intersects(brect);
194  if (keep && (mode == Qt::ContainsItemShape || mode == Qt::IntersectsItemShape))
195  keep = QGraphicsSceneIndexPrivate::itemCollidesWithPath(item, itemPath, mode);
196  } else {
197  Q_ASSERT(!itemd->dirtySceneTransform);
198  const QRectF itemSceneBoundingRect = itemd->sceneTransformTranslateOnly
199  ? brect.translated(itemd->sceneTransform.dx(),
200  itemd->sceneTransform.dy())
201  : itemd->sceneTransform.mapRect(brect);
203  keep = scenePath.contains(itemSceneBoundingRect);
204  else
205  keep = scenePath.intersects(itemSceneBoundingRect);
206  if (keep && (mode == Qt::ContainsItemShape || mode == Qt::IntersectsItemShape)) {
207  QPainterPath itemPath = itemd->sceneTransformTranslateOnly
208  ? scenePath.translated(-itemd->sceneTransform.dx(),
209  -itemd->sceneTransform.dy())
210  : itemd->sceneTransform.inverted().map(scenePath);
211  keep = QGraphicsSceneIndexPrivate::itemCollidesWithPath(item, itemPath, mode);
212  }
213  }
214  return keep;
215  }
216 
218 };
219 
224 {
228 }
229 
234 {
235  delete pointIntersector;
236  delete rectIntersector;
237  delete pathIntersector;
238 }
239 
250  const QPainterPath &path,
252 {
253  if (item->collidesWithPath(path, mode))
254  return true;
255  if (item->isWidget()) {
256  // Check if this is a window, and if its frame rect collides.
257  const QGraphicsWidget *widget = static_cast<const QGraphicsWidget *>(item);
258  if (widget->isWindow()) {
259  QRectF frameRect = widget->windowFrameRect();
260  QPainterPath framePath;
261  framePath.addRect(frameRect);
262  bool intersects = path.intersects(frameRect);
264  return intersects || path.contains(frameRect.topLeft())
265  || framePath.contains(path.elementAt(0));
266  return !intersects && path.contains(frameRect.topLeft());
267  }
268  }
269  return false;
270 }
271 
280  QGraphicsSceneIndexIntersector *intersector,
281  QList<QGraphicsItem *> *items,
282  const QTransform &viewTransform,
284  qreal parentOpacity) const
285 {
286  Q_ASSERT(item);
287  if (!item->d_ptr->visible)
288  return;
289 
290  const qreal opacity = item->d_ptr->combineOpacityFromParent(parentOpacity);
291  const bool itemIsFullyTransparent = QGraphicsItemPrivate::isOpacityNull(opacity);
292  const bool itemHasChildren = !item->d_ptr->children.isEmpty();
293  if (itemIsFullyTransparent && (!itemHasChildren || item->d_ptr->childrenCombineOpacity()))
294  return;
295 
296  // Update the item's scene transform if dirty.
297  const bool itemIsUntransformable = item->d_ptr->itemIsUntransformable();
298  const bool wasDirtyParentSceneTransform = item->d_ptr->dirtySceneTransform && !itemIsUntransformable;
299  if (wasDirtyParentSceneTransform) {
302  }
303 
304  const bool itemClipsChildrenToShape = (item->d_ptr->flags & QGraphicsItem::ItemClipsChildrenToShape);
305  bool processItem = !itemIsFullyTransparent;
306  if (processItem) {
307  processItem = intersector->intersect(item, exposeRect, mode, viewTransform);
308  if (!processItem && (!itemHasChildren || itemClipsChildrenToShape)) {
309  if (wasDirtyParentSceneTransform)
311  return;
312  }
313  } // else we know for sure this item has children we must process.
314 
315  int i = 0;
316  if (itemHasChildren) {
317  // Sort children.
318  item->d_ptr->ensureSortedChildren();
319 
320  // Clip to shape.
321  if (itemClipsChildrenToShape && !itemIsUntransformable) {
322  QPainterPath mappedShape = item->d_ptr->sceneTransformTranslateOnly
323  ? item->shape().translated(item->d_ptr->sceneTransform.dx(),
324  item->d_ptr->sceneTransform.dy())
325  : item->d_ptr->sceneTransform.map(item->shape());
326  exposeRect &= mappedShape.controlPointRect();
327  }
328 
329  // Process children behind
330  for (i = 0; i < item->d_ptr->children.size(); ++i) {
331  QGraphicsItem *child = item->d_ptr->children.at(i);
332  if (wasDirtyParentSceneTransform)
333  child->d_ptr->dirtySceneTransform = 1;
335  break;
336  if (itemIsFullyTransparent && !(child->d_ptr->flags & QGraphicsItem::ItemIgnoresParentOpacity))
337  continue;
338  recursive_items_helper(child, exposeRect, intersector, items, viewTransform,
339  mode, opacity);
340  }
341  }
342 
343  // Process item
344  if (processItem)
345  items->append(item);
346 
347  // Process children in front
348  if (itemHasChildren) {
349  for (; i < item->d_ptr->children.size(); ++i) {
350  QGraphicsItem *child = item->d_ptr->children.at(i);
351  if (wasDirtyParentSceneTransform)
352  child->d_ptr->dirtySceneTransform = 1;
353  if (itemIsFullyTransparent && !(child->d_ptr->flags & QGraphicsItem::ItemIgnoresParentOpacity))
354  continue;
355  recursive_items_helper(child, exposeRect, intersector, items, viewTransform,
356  mode, opacity);
357  }
358  }
359 }
360 
362 {
363  if (!scene)
364  return;
365 
366  QObject::connect(scene, SIGNAL(sceneRectChanged(QRectF)),
367  q_func(), SLOT(updateSceneRect(QRectF)));
368 }
369 
374 : QObject(*new QGraphicsSceneIndexPrivate(scene), scene)
375 {
376  d_func()->init();
377 }
378 
383  : QObject(dd, scene)
384 {
385  d_func()->init();
386 }
387 
392 {
393 
394 }
395 
400 {
401  Q_D(const QGraphicsSceneIndex);
402  return d->scene;
403 }
404 
426  Qt::SortOrder order, const QTransform &deviceTransform) const
427 {
428 
429  Q_D(const QGraphicsSceneIndex);
430  QList<QGraphicsItem *> itemList;
431  d->pointIntersector->scenePoint = pos;
432  d->items_helper(QRectF(pos, QSizeF(1, 1)), d->pointIntersector, &itemList, deviceTransform, mode, order);
433  return itemList;
434 }
435 
459  Qt::SortOrder order, const QTransform &deviceTransform) const
460 {
461  Q_D(const QGraphicsSceneIndex);
462  QRectF exposeRect = rect;
463  _q_adjustRect(&exposeRect);
464  QList<QGraphicsItem *> itemList;
465  d->rectIntersector->sceneRect = rect;
466  d->items_helper(exposeRect, d->rectIntersector, &itemList, deviceTransform, mode, order);
467  return itemList;
468 }
469 
493  Qt::SortOrder order, const QTransform &deviceTransform) const
494 {
495  Q_D(const QGraphicsSceneIndex);
496  QList<QGraphicsItem *> itemList;
497  QRectF exposeRect = polygon.boundingRect();
498  _q_adjustRect(&exposeRect);
499  QPainterPath path;
500  path.addPolygon(polygon);
501  d->pathIntersector->scenePath = path;
502  d->items_helper(exposeRect, d->pathIntersector, &itemList, deviceTransform, mode, order);
503  return itemList;
504 }
505 
529  Qt::SortOrder order, const QTransform &deviceTransform) const
530 {
531  Q_D(const QGraphicsSceneIndex);
532  QList<QGraphicsItem *> itemList;
533  QRectF exposeRect = path.controlPointRect();
534  _q_adjustRect(&exposeRect);
535  d->pathIntersector->scenePath = path;
536  d->items_helper(exposeRect, d->pathIntersector, &itemList, deviceTransform, mode, order);
537  return itemList;
538 }
539 
545 {
546  return estimateItems(QRectF(point, QSize(1, 1)), order);
547 }
548 
550 {
551  Q_D(const QGraphicsSceneIndex);
552  Q_UNUSED(rect);
553  QGraphicsScenePrivate *scened = d->scene->d_func();
554  scened->ensureSortedTopLevelItems();
555  if (order == Qt::DescendingOrder) {
556  QList<QGraphicsItem *> sorted;
557  for (int i = scened->topLevelItems.size() - 1; i >= 0; --i)
558  sorted << scened->topLevelItems.at(i);
559  return sorted;
560  }
561  return scened->topLevelItems;
562 }
563 
579 {
580  Q_UNUSED(rect);
581 }
582 
587 {
588  const QList<QGraphicsItem *> allItems = items();
589  for (int i = 0 ; i < allItems.size(); ++i)
590  removeItem(allItems.at(i));
591 }
592 
619 {
620  removeItem(item);
621 }
622 
636 void QGraphicsSceneIndex::itemChange(const QGraphicsItem *item, QGraphicsItem::GraphicsItemChange change, const void *const value)
637 {
638  Q_UNUSED(item);
639  Q_UNUSED(change);
640  Q_UNUSED(value);
641 }
642 
649 {
650  Q_UNUSED(item);
651 }
652 
654 
655 #include "moc_qgraphicssceneindex_p.cpp"
656 
657 #endif // QT_NO_GRAPHICSVIEW
double d
Definition: qnumeric_p.h:62
bool intersect(const QGraphicsItem *item, const QRectF &exposeRect, Qt::ItemSelectionMode mode, const QTransform &deviceTransform) const
The QGraphicsScene class provides a surface for managing a large number of 2D graphical items...
qreal dy() const
Returns the vertical translation factor.
Definition: qtransform.h:277
qreal combineOpacityFromParent(qreal parentOpacity) const
double qreal
Definition: qglobal.h:1193
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
void recursive_items_helper(QGraphicsItem *item, QRectF exposeRect, QGraphicsSceneIndexIntersector *intersector, QList< QGraphicsItem *> *items, const QTransform &viewTransform, Qt::ItemSelectionMode mode, qreal parentOpacity=1.0) const
This function returns the items in ascending order.
bool isWindow() const
Returns true if the item is a QGraphicsWidget window, otherwise returns false.
QPointer< QWidget > widget
void translate(qreal dx, qreal dy)
Translates all elements in the path by ({dx}, {dy}).
QScopedPointer< QGraphicsItemPrivate > d_ptr
~QGraphicsSceneIndexPrivate()
Destructor of private scene index.
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
Definition: qpainterpath.h:67
virtual QRectF boundingRect() const =0
This pure virtual function defines the outer bounds of the item as a rectangle; all painting must be ...
virtual void updateSceneTransformFromParent()
virtual bool collidesWithPath(const QPainterPath &path, Qt::ItemSelectionMode mode=Qt::IntersectsItemShape) const
Returns true if this item collides with path.
#define SLOT(a)
Definition: qobjectdefs.h:226
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
Definition: qgraphicsitem.h:89
QPointF topLeft() const
Returns the position of the rectangle&#39;s top-left corner.
Definition: qrect.h:539
QGraphicsSceneIndexPointIntersector * pointIntersector
GraphicsItemChange
This enum describes the state changes that are notified by QGraphicsItem::itemChange().
ItemSelectionMode
Definition: qnamespace.h:1503
bool intersects(const QRectF &rect) const
Returns true if any point in the given rectangle intersects the path; otherwise returns false...
bool isOpacityNull() const
void addPolygon(const QPolygonF &polygon)
Adds the given polygon to the path as an (unclosed) subpath.
bool intersects(const QRectF &r) const
Returns true if this rectangle intersects with the given rectangle (i.
Definition: qrect.cpp:2744
bool contains(const QPointF &pt) const
Returns true if the given point is inside the path, otherwise returns false.
QGraphicsSceneIndexPrivate(QGraphicsScene *scene)
Constructs a private scene index.
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
QRectF boundingRect() const
Returns the bounding rectangle of the polygon, or QRectF(0,0,0,0) if the polygon is empty...
Definition: qpolygon.cpp:742
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
#define Q_D(Class)
Definition: qglobal.h:2482
The QSizeF class defines the size of a two-dimensional object using floating point precision...
Definition: qsize.h:202
const QPainterPath::Element & elementAt(int i) const
Returns the element at the given index in the painter path.
Definition: qpainterpath.h:402
virtual QPainterPath shape() const
Returns the shape of this item as a QPainterPath in local coordinates.
QTransform inverted(bool *invertible=0) const
Returns an inverted copy of this matrix.
Definition: qtransform.cpp:364
QGraphicsSceneIndexPathIntersector * pathIntersector
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
virtual void removeItem(QGraphicsItem *item)=0
This pure virtual function removes an item to the scene index.
bool contains(const QPointF &p) const
Returns true if the given point is inside or on the edge of the rectangle; otherwise returns false...
Definition: qrect.cpp:2349
#define SIGNAL(a)
Definition: qobjectdefs.h:227
SortOrder
Definition: qnamespace.h:189
QRect mapRect(const QRect &) const
Creates and returns a QRect object that is a copy of the given rectangle, mapped into the coordinate ...
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
static void _q_adjustRect(QRect *rect)
QFuture< void > map(Sequence &sequence, MapFunction function)
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
virtual void itemChange(const QGraphicsItem *item, QGraphicsItem::GraphicsItemChange, const void *const value)
This virtual function is called by QGraphicsItem to notify the index that some part of the item &#39;s st...
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
Definition: qobject.cpp:2580
void invalidateChildrenSceneTransform()
bool itemIsUntransformable() const
quint32 sceneTransformTranslateOnly
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
The QPolygonF class provides a vector of points using floating point precision.
Definition: qpolygon.h:134
virtual void prepareBoundingRectChange(const QGraphicsItem *item)
Notify the index for a geometry change of an item.
QPoint map(const QPoint &p) const
Creates and returns a QPoint object that is a copy of the given point, mapped into the coordinate sys...
virtual QList< QGraphicsItem * > estimateTopLevelItems(const QRectF &, Qt::SortOrder order) const
void addRect(const QRectF &rect)
Adds the given rectangle to this path as a closed subpath.
bool intersect(const QGraphicsItem *item, const QRectF &exposeRect, Qt::ItemSelectionMode mode, const QTransform &deviceTransform) const
The QGraphicsSceneIndex class provides a base class to implement a custom indexing algorithm for disc...
bool intersect(const QGraphicsItem *item, const QRectF &exposeRect, Qt::ItemSelectionMode mode, const QTransform &deviceTransform) const
virtual void clear()
This virtual function removes all items in the scene index.
bool contains(const QPoint &p, bool proper=false) const
Returns true if the given point is inside or on the edge of the rectangle, otherwise returns false...
Definition: qrect.cpp:1101
QTransform deviceTransform(const QTransform &viewportTransform) const
Returns this item&#39;s device transformation matrix, using viewportTransform to map from scene to device...
QGraphicsSceneIndex(QGraphicsScene *scene=0)
Constructs an abstract scene index for a given scene.
QList< QGraphicsItem * > topLevelItems
QRectF controlPointRect() const
Returns the rectangle containing all the points and control points in this path.
virtual QList< QGraphicsItem * > estimateItems(const QPointF &point, Qt::SortOrder order) const
This virtual function return an estimation of items at position point.
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
virtual bool intersect(const QGraphicsItem *item, const QRectF &exposeRect, Qt::ItemSelectionMode mode, const QTransform &deviceTransform) const =0
virtual void updateSceneRect(const QRectF &rect)
Notifies the index that the scene&#39;s scene rect has changed.
bool isWidget() const
Returns true if this item is a widget (i.
QGraphicsScene * scene() const
Returns the scene of this index.
virtual bool contains(const QPointF &point) const
Returns true if this item contains point, which is in local coordinates; otherwise, false is returned.
qreal dx() const
Returns the horizontal translation factor.
Definition: qtransform.h:273
virtual ~QGraphicsSceneIndex()
Destroys the scene index.
static const QGraphicsItemPrivate * get(const QGraphicsItem *item)
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
QRectF windowFrameRect() const
Returns the widget&#39;s local rect including any window frame.
QList< QGraphicsItem * > children
QRectF translated(qreal dx, qreal dy) const
Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis...
Definition: qrect.h:740
virtual QList< QGraphicsItem * > items(Qt::SortOrder order=Qt::DescendingOrder) const =0
This pure virtual function all items in the index and sort them using order.
virtual void deleteItem(QGraphicsItem *item)
This method is called when an item has been deleted.
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729
bool childrenCombineOpacity() const
QGraphicsSceneIndexRectIntersector * rectIntersector
The QTransform class specifies 2D transformations of a coordinate system.
Definition: qtransform.h:65
The QList class is a template class that provides lists.
Definition: qdatastream.h:62
QPainterPath translated(qreal dx, qreal dy) const
Returns a copy of the path that is translated by ({dx}, {dy}).
static bool itemCollidesWithPath(const QGraphicsItem *item, const QPainterPath &path, Qt::ItemSelectionMode mode)
Checks if item collides with the path and mode, but also checks that if it doesn&#39;t collide...
The QGraphicsWidget class is the base class for all widget items in a QGraphicsScene.