16#ifndef QGRAPHICSBSPTREEINDEX_H
17#define QGRAPHICSBSPTREEINDEX_H
19#include <QtWidgets/private/qtwidgetsglobal_p.h>
25#include <QtCore/qbasictimer.h>
26#include <QtCore/qrect.h>
27#include <QtCore/qlist.h>
41 Q_PROPERTY(
int bspTreeDepth READ bspTreeDepth WRITE setBspTreeDepth)
43 QGraphicsSceneBspTreeIndex(QGraphicsScene *scene =
nullptr);
44 ~QGraphicsSceneBspTreeIndex();
46 QList<QGraphicsItem *> estimateItems(
const QRectF &rect, Qt::SortOrder order)
const override;
47 QList<QGraphicsItem *> estimateTopLevelItems(
const QRectF &rect, Qt::SortOrder order)
const override;
48 QList<QGraphicsItem *> items(Qt::SortOrder order = Qt::DescendingOrder)
const override;
50 int bspTreeDepth()
const;
51 void setBspTreeDepth(
int depth);
54 void updateSceneRect(
const QRectF &rect) override;
57 bool event(QEvent *event) override;
58 void clear() override;
60 void addItem(QGraphicsItem *item) override;
61 void removeItem(QGraphicsItem *item) override;
62 void prepareBoundingRectChange(
const QGraphicsItem *item) override;
64 void itemChange(
const QGraphicsItem *item, QGraphicsItem::GraphicsItemChange change,
const void *
const value) override;
67 Q_DECLARE_PRIVATE(QGraphicsSceneBspTreeIndex)
68 Q_DISABLE_COPY_MOVE(QGraphicsSceneBspTreeIndex)
69 Q_PRIVATE_SLOT(d_func(),
void _q_updateSortCache())
70 Q_PRIVATE_SLOT(d_func(),
void _q_updateIndex())
72 friend class QGraphicsScene;
73 friend class QGraphicsScenePrivate;
78 Q_DECLARE_PUBLIC(QGraphicsSceneBspTreeIndex)
100 void startIndexTimer(
int interval = QGRAPHICSSCENE_INDEXTIMER_TIMEOUT);
107 void addItem(QGraphicsItem *item,
bool recursive =
false);
108 void removeItem(QGraphicsItem *item,
bool recursive =
false,
bool moveToUnindexedItems =
false);
111 static void climbTree(QGraphicsItem *item,
int *stackingOrder);
115 return item1->d_ptr->globalStackingOrder < item2->d_ptr->globalStackingOrder;
119 return item1->d_ptr->globalStackingOrder >= item2->d_ptr->globalStackingOrder;
122 static void sortItems(QList<QGraphicsItem *> *itemList, Qt::SortOrder order,
123 bool cached,
bool onlyTopLevelItems =
false);
131 qreal h = s.height();
146 if (l1 >= r2 || l2 >= r1)
163 return !(t1 >= b2 || t2 >= b1);
The QAbstractGraphicsShapeItem class provides a common base for all path items.
The QGraphicsEllipseItem class provides an ellipse item that you can add to a QGraphicsScene.
QHash< QPaintDevice *, DeviceData > deviceData
QHash< const QGraphicsItem *, QMap< int, QVariant > > data
The QGraphicsItemGroup class provides a container that treats a group of items as a single item.
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
The QGraphicsLineItem class provides a line item that you can add to a QGraphicsScene.
The QGraphicsObject class provides a base class for all graphics items that require signals,...
QGraphicsPixmapItem::ShapeMode shapeMode
Qt::TransformationMode transformationMode
The QGraphicsPixmapItem class provides a pixmap item that you can add to a QGraphicsScene.
The QGraphicsPolygonItem class provides a polygon item that you can add to a QGraphicsScene.
The QGraphicsRectItem class provides a rectangle item that you can add to a QGraphicsScene.
The QGraphicsRotation class provides a rotation transformation around a given axis.
The QGraphicsScale class provides a scale transformation.
void removeItem(QGraphicsItem *item, bool recursive=false, bool moveToUnindexedItems=false)
void invalidateSortCache()
void addItem(QGraphicsItem *item, bool recursive=false)
void startIndexTimer(int interval=QGRAPHICSSCENE_INDEXTIMER_TIMEOUT)
QList< QGraphicsItem * > estimateItems(const QRectF &, Qt::SortOrder, bool b=false)
void _q_updateIndex()
This method will update the BSP index by removing the items from the temporary unindexed list and add...
void _q_updateSortCache()
static void sortItems(QList< QGraphicsItem * > *itemList, Qt::SortOrder order, bool cached, bool onlyTopLevelItems=false)
Sort a list of itemList in a specific order and use the cache if requested.
QList< QGraphicsItem * > unindexedItems
static bool closestItemFirst_withCache(const QGraphicsItem *item1, const QGraphicsItem *item2)
QList< int > freeItemIndexes
QList< QGraphicsItem * > untransformableItems
QList< QGraphicsItem * > indexedItems
QGraphicsSceneBspTree bsp
static bool closestItemLast_withCache(const QGraphicsItem *item1, const QGraphicsItem *item2)
static void climbTree(QGraphicsItem *item, int *stackingOrder)
The QGraphicsSceneBspTreeIndex class provides an implementation of a BSP indexing algorithm for disco...
The QGraphicsSceneDragDropEvent class provides events for drag and drop in the graphics view framewor...
The QGraphicsSceneEvent class provides a base class for all graphics view related events.
The QGraphicsSceneHelpEvent class provides events when a tooltip is requested.
The QGraphicsSceneHoverEvent class provides hover events in the graphics view framework.
The QGraphicsSceneMouseEvent class provides mouse events in the graphics view framework.
The QGraphicsSceneMoveEvent class provides events for widget moving in the graphics view framework.
The QGraphicsSceneResizeEvent class provides events for widget resizing in the graphics view framewor...
The QGraphicsSceneWheelEvent class provides wheel events in the graphics view framework.
The QGraphicsScene class provides a surface for managing a large number of 2D graphical items.
void updateBoundingRect()
The QGraphicsSimpleTextItem class provides a simple text item that you can add to a QGraphicsScene.
void _q_updateBoundingRect(const QSizeF &)
void _q_ensureVisible(QRectF)
QPointF controlOffset() const
QGraphicsTextItemPrivate()
bool _q_mouseOnEdge(QGraphicsSceneMouseEvent *)
QWidgetTextControl * control
QWidgetTextControl * textControl() const
void sendControlEvent(QEvent *e)
The QGraphicsTextItem class provides a text item that you can add to a QGraphicsScene to display form...
The QGraphicsView class provides a widget for displaying the contents of a QGraphicsScene.
\inmodule QtCore\reentrant
The QPolygonF class provides a list of points using floating point precision.
QT_REQUIRE_CONFIG(animation)
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QDir::Filters filters)
static void formatGraphicsItemHelper(QDebug debug, const QGraphicsItem *item)
bool _qt_movableAncestorIsSelected(const QGraphicsItem *item)
static QRectF setupTextLayout(QTextLayout *layout)
QDebug operator<<(QDebug debug, const QGraphicsObject *item)
static QPainterPath qt_graphicsItem_shapeFromPath(const QPainterPath &path, const QPen &pen)
QDebug operator<<(QDebug debug, const QGraphicsItem *item)
static bool qt_QGraphicsItem_isObscured(const QGraphicsItem *item, const QGraphicsItem *other, const QRectF &rect)
bool qt_closestItemLast(const QGraphicsItem *item1, const QGraphicsItem *item2)
Returns true if item2 is on top of item1.
bool qt_closestLeaf(const QGraphicsItem *item1, const QGraphicsItem *item2)
bool qt_notclosestLeaf(const QGraphicsItem *item1, const QGraphicsItem *item2)
bool qt_closestItemFirst(const QGraphicsItem *item1, const QGraphicsItem *item2)
Returns true if item1 is on top of item2.
QT_REQUIRE_CONFIG(graphicsview)
static QRectF adjustedItemBoundingRect(const QGraphicsItem *item)
static QRectF adjustedItemEffectiveBoundingRect(const QGraphicsItem *item)
static void _q_adjustRect(QRectF *rect)
static bool QRectF_intersects(const QRectF &s, const QRectF &r)
static QT_BEGIN_NAMESPACE const int QGRAPHICSSCENE_INDEXTIMER_TIMEOUT
QDebug operator<<(QDebug debug, QIODevice::OpenMode modes)
Q_DECLARE_TYPEINFO(QObjectPrivate::ConnectionList, Q_RELOCATABLE_TYPE)
const QTransform * transformPtr
const QTransform * effectTransform
quint32 wasDirtySceneTransform
QStyleOptionGraphicsItem * option
const QTransform * viewTransform