27#include <QtGui/qpainterpath.h>
36 const QRectF sceneRect = *
static_cast<const QRectF *
>(intersectData);
51 keep = itemRect.
contains(brect) && itemRect != brect;
66 keep = sceneRect != brect && sceneRect.
contains(itemSceneBoundingRect);
68 keep = sceneRect.
intersects(itemSceneBoundingRect);
85 const QPointF scenePoint = *
static_cast<const QPointF *
>(intersectData);
154 keep = scenePath.
contains(itemSceneBoundingRect);
156 keep = scenePath.
intersects(itemSceneBoundingRect);
203 bool intersects =
path.intersects(frameRect);
205 return intersects ||
path.contains(frameRect.
topLeft())
207 return !intersects &&
path.contains(frameRect.
topLeft());
222 qreal parentOpacity,
const void *intersectData)
const
237 if (wasDirtyParentSceneTransform) {
244 bool processItem = !itemIsFullyTransparent;
246 processItem = intersect(
item, exposeRect,
mode, viewTransform, intersectData);
247 if (!processItem && (!itemHasChildren || itemClipsChildrenToShape)) {
248 if (wasDirtyParentSceneTransform)
255 if (itemHasChildren) {
260 if (itemClipsChildrenToShape && !itemIsUntransformable) {
271 if (wasDirtyParentSceneTransform)
272 child->d_ptr->dirtySceneTransform = 1;
278 mode, opacity, intersectData);
287 if (itemHasChildren) {
290 if (wasDirtyParentSceneTransform)
291 child->d_ptr->dirtySceneTransform = 1;
295 mode, opacity, intersectData);
493 sorted.
reserve(numTopLevelItems);
494 for (
int i = numTopLevelItems - 1;
i >= 0; --
i)
526 for (
int i = 0 ;
i < allItems.
size(); ++
i)
592#include "moc_qgraphicssceneindex_p.cpp"
bool isOpacityNull() const
void invalidateChildrenSceneTransform()
quint32 dirtySceneTransform
bool itemIsUntransformable() const
bool childrenCombineOpacity() const
QList< QGraphicsItem * > children
quint32 sceneTransformTranslateOnly
virtual void updateSceneTransformFromParent()
static const QGraphicsItemPrivate * get(const QGraphicsItem *item)
QTransform sceneTransform
qreal combineOpacityFromParent(qreal parentOpacity) const
void ensureSortedChildren()
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
virtual bool contains(const QPointF &point) const
Returns true if this item contains point, which is in local coordinates; otherwise,...
QTransform deviceTransform(const QTransform &viewportTransform) const
GraphicsItemChange
This enum describes the state changes that are notified by QGraphicsItem::itemChange().
QScopedPointer< QGraphicsItemPrivate > d_ptr
virtual QPainterPath shape() const
Returns the shape of this item as a QPainterPath in local coordinates.
@ ItemClipsChildrenToShape
@ ItemContainsChildrenInShape
@ ItemIgnoresParentOpacity
virtual QRectF boundingRect() const =0
This pure virtual function defines the outer bounds of the item as a rectangle; all painting must be ...
virtual bool collidesWithPath(const QPainterPath &path, Qt::ItemSelectionMode mode=Qt::IntersectsItemShape) const
Returns true if this item collides with path.
QGraphicsSceneIndexPrivate(QGraphicsScene *scene)
Constructs a private scene index.
static bool itemCollidesWithPath(const QGraphicsItem *item, const QPainterPath &path, Qt::ItemSelectionMode mode)
void recursive_items_helper(QGraphicsItem *item, QRectF exposeRect, QGraphicsSceneIndexIntersector intersect, QList< QGraphicsItem * > *items, const QTransform &viewTransform, Qt::ItemSelectionMode mode, qreal parentOpacity, const void *intersectData) const
~QGraphicsSceneIndexPrivate()
Destructor of private scene index.
The QGraphicsSceneIndex class provides a base class to implement a custom indexing algorithm for disc...
virtual QList< QGraphicsItem * > estimateTopLevelItems(const QRectF &, Qt::SortOrder order) const
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 updateSceneRect(const QRectF &rect)
Notifies the index that the scene's scene rect has changed.
QGraphicsSceneIndex(QGraphicsScene *scene=nullptr)
Constructs an abstract scene index for a given scene.
virtual ~QGraphicsSceneIndex()
Destroys the scene index.
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...
virtual void clear()
This virtual function removes all items in the scene index.
virtual void prepareBoundingRectChange(const QGraphicsItem *item)
Notify the index for a geometry change of an item.
virtual void deleteItem(QGraphicsItem *item)
This method is called when an item has been deleted.
virtual QList< QGraphicsItem * > estimateItems(const QPointF &point, Qt::SortOrder order) const
This virtual function return an estimation of items at position point.
QGraphicsScene * scene() const
Returns the scene of this index.
virtual void removeItem(QGraphicsItem *item)=0
This pure virtual function removes an item to the scene index.
void ensureSortedTopLevelItems()
QList< QGraphicsItem * > topLevelItems
The QGraphicsScene class provides a surface for managing a large number of 2D graphical items.
qsizetype size() const noexcept
bool isEmpty() const noexcept
const_reference at(qsizetype i) const noexcept
void reserve(qsizetype size)
void append(parameter_type t)
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
QPainterPath translated(qreal dx, qreal dy) const
Returns a copy of the path that is translated by ({dx}, {dy}).
void translate(qreal dx, qreal dy)
Translates all elements in the path by ({dx}, {dy}).
void addRect(const QRectF &rect)
Adds the given rectangle to this path as a closed subpath.
QRectF controlPointRect() const
Returns the rectangle containing all the points and control points in this path.
bool intersects(const QRectF &rect) const
Returns true if any point in the given rectangle intersects the path; otherwise returns false.
bool contains(const QPointF &pt) const
Returns true if the given point is inside the path, otherwise returns false.
\inmodule QtCore\reentrant
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
The QPolygonF class provides a list of points using floating point precision.
\inmodule QtCore\reentrant
constexpr QRectF translated(qreal dx, qreal dy) const noexcept
Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis,...
bool contains(const QRectF &r) const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool intersects(const QRectF &r) const noexcept
Returns true if this rectangle intersects with the given rectangle (i.e.
constexpr QPointF topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
QMap< QString, QString > map
[6]
Combined button and popup list for selecting options.
static bool intersect_point(const QGraphicsItem *item, const QRectF &exposeRect, Qt::ItemSelectionMode mode, const QTransform &deviceTransform, const void *intersectData)
static bool intersect_rect(const QGraphicsItem *item, const QRectF &exposeRect, Qt::ItemSelectionMode mode, const QTransform &deviceTransform, const void *intersectData)
static bool intersect_path(const QGraphicsItem *item, const QRectF &exposeRect, Qt::ItemSelectionMode mode, const QTransform &deviceTransform, const void *intersectData)
@ IntersectsItemBoundingRect
@ ContainsItemBoundingRect
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
static QT_BEGIN_NAMESPACE void _q_adjustRect(QRect *rect)
bool(* QGraphicsSceneIndexIntersector)(const QGraphicsItem *item, const QRectF &exposeRect, Qt::ItemSelectionMode mode, const QTransform &deviceTransform, const void *data)
GLuint GLenum GLenum transform
GLsizei const GLchar *const * path
GLfixed GLfixed GLint GLint order
rect deviceTransform(view->viewportTransform()).map(QPointF(0