69 #ifndef QT_NO_GRAPHICSVIEW 92 keep = itemRect.
contains(brect) && itemRect != brect;
203 keep = scenePath.
contains(itemSceneBoundingRect);
205 keep = scenePath.intersects(itemSceneBoundingRect);
284 qreal parentOpacity)
const 299 if (wasDirtyParentSceneTransform) {
305 bool processItem = !itemIsFullyTransparent;
307 processItem = intersector->
intersect(item, exposeRect, mode, viewTransform);
308 if (!processItem && (!itemHasChildren || itemClipsChildrenToShape)) {
309 if (wasDirtyParentSceneTransform)
316 if (itemHasChildren) {
321 if (itemClipsChildrenToShape && !itemIsUntransformable) {
332 if (wasDirtyParentSceneTransform)
348 if (itemHasChildren) {
351 if (wasDirtyParentSceneTransform)
431 d->pointIntersector->scenePoint = pos;
432 d->items_helper(
QRectF(pos,
QSizeF(1, 1)),
d->pointIntersector, &itemList, deviceTransform, mode, order);
465 d->rectIntersector->sceneRect = rect;
466 d->items_helper(exposeRect,
d->rectIntersector, &itemList, deviceTransform, mode, order);
501 d->pathIntersector->scenePath = path;
502 d->items_helper(exposeRect,
d->pathIntersector, &itemList, deviceTransform, mode, order);
535 d->pathIntersector->scenePath = path;
536 d->items_helper(exposeRect,
d->pathIntersector, &itemList, deviceTransform, mode, order);
589 for (
int i = 0 ; i < allItems.
size(); ++i)
655 #include "moc_qgraphicssceneindex_p.cpp" 657 #endif // QT_NO_GRAPHICSVIEW
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 combineOpacityFromParent(qreal parentOpacity) const
#define QT_END_NAMESPACE
This macro expands to.
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 ...
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.
The QPointF class defines a point in the plane using floating point precision.
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
QPointF topLeft() const
Returns the position of the rectangle's top-left corner.
void ensureSortedChildren()
QGraphicsSceneIndexPointIntersector * pointIntersector
GraphicsItemChange
This enum describes the state changes that are notified by QGraphicsItem::itemChange().
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.
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.
QRectF boundingRect() const
Returns the bounding rectangle of the polygon, or QRectF(0,0,0,0) if the polygon is empty...
The QObject class is the base class of all Qt objects.
quint32 dirtySceneTransform
The QSizeF class defines the size of a two-dimensional object using floating point precision...
const QPainterPath::Element & elementAt(int i) const
Returns the element at the given index in the painter path.
virtual QPainterPath shape() const
Returns the shape of this item as a QPainterPath in local coordinates.
QGraphicsSceneIndexPathIntersector * pathIntersector
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
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...
void append(const T &t)
Inserts value at the end of the list.
static void _q_adjustRect(QRect *rect)
QFuture< void > map(Sequence &sequence, MapFunction function)
#define QT_BEGIN_NAMESPACE
This macro expands to.
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 's st...
The QRectF class defines a rectangle in the plane using floating point precision. ...
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...
void invalidateChildrenSceneTransform()
bool itemIsUntransformable() const
quint32 sceneTransformTranslateOnly
const T & at(int i) const
Returns the item at index position i in the list.
The QPolygonF class provides a vector of points using floating point precision.
virtual void prepareBoundingRectChange(const QGraphicsItem *item)
Notify the index for a geometry change of an item.
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...
QTransform deviceTransform(const QTransform &viewportTransform) const
Returns this item'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.
QTransform sceneTransform
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.
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's scene rect has changed.
void ensureSortedTopLevelItems()
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.
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.
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...
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...
bool childrenCombineOpacity() const
QGraphicsSceneIndexRectIntersector * rectIntersector
The QList class is a template class that provides lists.
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't collide...