![]() |
Qt 6.x
The Qt SDK
|
#include <qgraphicsscenebsptreeindex_p.h>
Static Public Member Functions | |
static void | climbTree (QGraphicsItem *item, int *stackingOrder) |
static bool | closestItemFirst_withCache (const QGraphicsItem *item1, const QGraphicsItem *item2) |
static bool | closestItemLast_withCache (const QGraphicsItem *item1, const QGraphicsItem *item2) |
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. | |
![]() | |
static bool | itemCollidesWithPath (const QGraphicsItem *item, const QPainterPath &path, Qt::ItemSelectionMode mode) |
![]() | |
static bool | removeConnection (Connection *c) |
static QObjectPrivate * | get (QObject *o) |
static const QObjectPrivate * | get (const QObject *o) |
template<typename Func1 , typename Func2 > | |
static QMetaObject::Connection | connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection) |
template<typename Func1 , typename Func2 > | |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot) |
static QMetaObject::Connection | connectImpl (const QObject *sender, int signal_index, const QObject *receiver, void **slot, QtPrivate::QSlotObjectBase *slotObj, int type, const int *types, const QMetaObject *senderMetaObject) |
static QMetaObject::Connection | connect (const QObject *sender, int signal_index, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type) |
static QMetaObject::Connection | connect (const QObject *sender, int signal_index, const QObject *receiver, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type) |
static bool | disconnect (const QObject *sender, int signal_index, void **slot) |
static bool | disconnect (const QObject *sender, int signal_index, const QObject *receiver, void **slot) |
Additional Inherited Members | |
![]() | |
typedef void(* | StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **) |
using | ConnectionDataPointer = QExplicitlySharedDataPointer< ConnectionData > |
Definition at line 74 of file qgraphicsscenebsptreeindex_p.h.
QGraphicsSceneBspTreeIndexPrivate::QGraphicsSceneBspTreeIndexPrivate | ( | QGraphicsScene * | scene | ) |
Constructs a private scene bsp index.
Definition at line 60 of file qgraphicsscenebsptreeindex.cpp.
void QGraphicsSceneBspTreeIndexPrivate::_q_updateIndex | ( | ) |
This method will update the BSP index by removing the items from the temporary unindexed list and add them in the indexedItems list.
This will also update the growingItemsBoundingRect if needed. This will update the BSP implementation as well.
Definition at line 82 of file qgraphicsscenebsptreeindex.cpp.
References QGraphicsItemPrivate::AncestorClipsChildren, QGraphicsItemPrivate::AncestorContainsChildren, QGraphicsItemPrivate::ancestorFlags, QList< T >::at(), bsp, bspTreeDepth, QList< T >::clear(), QGraphicsItem::d_ptr, freeItemIndexes, i, indexedItems, indexTimerId, QGraphicsSceneBspTree::initialize(), QGraphicsSceneBspTree::insertItem(), intmaxlog(), QList< T >::isEmpty(), item, QGraphicsItemPrivate::itemDiscovered, QGraphicsItemPrivate::itemIsUntransformable(), lastItemCount, QGraphicsSceneBspTree::leafCount(), purgeRemovedItems(), Q_ASSERT, qAbs(), regenerateIndex, QGraphicsItemPrivate::sceneEffectiveBoundingRect(), sceneRect, QList< T >::size(), QList< T >::takeFirst(), unindexedItems, and untransformableItems.
Referenced by _q_updateSortCache().
void QGraphicsSceneBspTreeIndexPrivate::_q_updateSortCache | ( | ) |
Definition at line 229 of file qgraphicsscenebsptreeindex.cpp.
References _q_updateIndex(), QList< T >::at(), QList< T >::begin(), climbTree(), QGraphicsItem::d_ptr, QList< T >::end(), i, item, items, QGraphicsItemPrivate::parent, qt_closestLeaf(), QList< T >::size(), sortCacheEnabled, and updatingSortCache.
Referenced by estimateItems().
void QGraphicsSceneBspTreeIndexPrivate::addItem | ( | QGraphicsItem * | item, |
bool | recursive = false |
||
) |
Definition at line 266 of file qgraphicsscenebsptreeindex.cpp.
References addItem(), QList< T >::at(), QGraphicsItemPrivate::children, QListSpecialMethodsBase< T >::contains(), QGraphicsItem::d_ptr, QGraphicsItemPrivate::globalStackingOrder, i, QGraphicsItemPrivate::index, indexedItems, invalidateSortCache(), item, purgeRemovedItems(), Q_ASSERT, qWarning, QList< T >::size(), startIndexTimer(), and unindexedItems.
Referenced by addItem(), and removeItem().
|
static |
Definition at line 205 of file qgraphicsscenebsptreeindex.cpp.
References QList< T >::at(), QList< T >::begin(), QGraphicsItemPrivate::children, climbTree(), QGraphicsItem::d_ptr, QList< T >::end(), QGraphicsItem::flags(), QGraphicsItemPrivate::globalStackingOrder, i, QList< T >::isEmpty(), item, QGraphicsItem::ItemStacksBehindParent, qt_closestLeaf(), and QList< T >::size().
Referenced by _q_updateSortCache(), and climbTree().
|
inlinestatic |
Definition at line 111 of file qgraphicsscenebsptreeindex_p.h.
References QGraphicsItem::d_ptr, and QGraphicsItemPrivate::globalStackingOrder.
Referenced by sortItems().
|
inlinestatic |
Definition at line 115 of file qgraphicsscenebsptreeindex_p.h.
References QGraphicsItem::d_ptr, and QGraphicsItemPrivate::globalStackingOrder.
Referenced by sortItems().
QList< QGraphicsItem * > QGraphicsSceneBspTreeIndexPrivate::estimateItems | ( | const QRectF & | rect, |
Qt::SortOrder | order, | ||
bool | b = false |
||
) |
Definition at line 340 of file qgraphicsscenebsptreeindex.cpp.
References _q_updateSortCache(), QList< T >::at(), bsp, QListSpecialMethodsBase< T >::contains(), QGraphicsItem::d_ptr, i, QList< T >::isEmpty(), item, QGraphicsSceneBspTree::items(), QGraphicsItemPrivate::parent, purgeRemovedItems(), Q_ASSERT, rect, QList< T >::size(), sortCacheEnabled, sortItems(), QGraphicsItem::topLevelItem(), unindexedItems, and untransformableItems.
void QGraphicsSceneBspTreeIndexPrivate::invalidateSortCache | ( | ) |
Definition at line 256 of file qgraphicsscenebsptreeindex.cpp.
References QMetaObject::invokeMethod(), Qt::QueuedConnection, sortCacheEnabled, and updatingSortCache.
Referenced by addItem(), and removeItem().
void QGraphicsSceneBspTreeIndexPrivate::purgeRemovedItems | ( | ) |
Removes stale pointers from all data structures.
Definition at line 150 of file qgraphicsscenebsptreeindex.cpp.
References QList< T >::at(), bsp, QList< T >::clear(), QSet< T >::clear(), freeItemIndexes, i, indexedItems, QSet< T >::isEmpty(), purgePending, removedItems, QGraphicsSceneBspTree::removeItems(), and QList< T >::size().
Referenced by _q_updateIndex(), addItem(), estimateItems(), and resetIndex().
void QGraphicsSceneBspTreeIndexPrivate::removeItem | ( | QGraphicsItem * | item, |
bool | recursive = false , |
||
bool | moveToUnindexedItems = false |
||
) |
Definition at line 297 of file qgraphicsscenebsptreeindex.cpp.
References addItem(), QGraphicsItemPrivate::AncestorClipsChildren, QGraphicsItemPrivate::AncestorContainsChildren, QGraphicsItemPrivate::ancestorFlags, QList< T >::at(), bsp, QGraphicsItemPrivate::children, QListSpecialMethodsBase< T >::contains(), QGraphicsItem::d_ptr, freeItemIndexes, i, QGraphicsItemPrivate::inDestructor, QGraphicsItemPrivate::index, indexedItems, invalidateSortCache(), item, QGraphicsItemPrivate::itemDiscovered, QGraphicsItemPrivate::itemIsUntransformable(), purgePending, Q_ASSERT, removedItems, removeItem(), QGraphicsSceneBspTree::removeItem(), QList< T >::removeOne(), QGraphicsItemPrivate::sceneEffectiveBoundingRect(), QList< T >::size(), unindexedItems, and untransformableItems.
Referenced by removeItem().
void QGraphicsSceneBspTreeIndexPrivate::resetIndex | ( | ) |
Definition at line 185 of file qgraphicsscenebsptreeindex.cpp.
References QList< T >::at(), QList< T >::clear(), QGraphicsItem::d_ptr, freeItemIndexes, i, QGraphicsItemPrivate::index, indexedItems, item, QGraphicsItemPrivate::itemDiscovered, purgeRemovedItems(), Q_ASSERT, regenerateIndex, QList< T >::size(), startIndexTimer(), unindexedItems, and untransformableItems.
|
static |
Sort a list of itemList in a specific order and use the cache if requested.
Definition at line 376 of file qgraphicsscenebsptreeindex.cpp.
References Qt::AscendingOrder, QList< T >::begin(), closestItemFirst_withCache(), closestItemLast_withCache(), Qt::DescendingOrder, QList< T >::end(), qt_closestItemFirst(), qt_closestItemLast(), qt_closestLeaf(), qt_notclosestLeaf(), and sortCacheEnabled.
Referenced by estimateItems().
void QGraphicsSceneBspTreeIndexPrivate::startIndexTimer | ( | int | interval = QGRAPHICSSCENE_INDEXTIMER_TIMEOUT | ) |
Starts or restarts the timer used for reindexing unindexed items.
Definition at line 172 of file qgraphicsscenebsptreeindex.cpp.
References indexTimerId, and restartIndexTimer.
Referenced by addItem(), and resetIndex().
QGraphicsSceneBspTree QGraphicsSceneBspTreeIndexPrivate::bsp |
Definition at line 80 of file qgraphicsscenebsptreeindex_p.h.
Referenced by _q_updateIndex(), estimateItems(), purgeRemovedItems(), and removeItem().
int QGraphicsSceneBspTreeIndexPrivate::bspTreeDepth |
Definition at line 82 of file qgraphicsscenebsptreeindex_p.h.
Referenced by _q_updateIndex().
QList<int> QGraphicsSceneBspTreeIndexPrivate::freeItemIndexes |
Definition at line 91 of file qgraphicsscenebsptreeindex_p.h.
Referenced by _q_updateIndex(), purgeRemovedItems(), removeItem(), and resetIndex().
QList<QGraphicsItem *> QGraphicsSceneBspTreeIndexPrivate::indexedItems |
Definition at line 88 of file qgraphicsscenebsptreeindex_p.h.
Referenced by _q_updateIndex(), addItem(), purgeRemovedItems(), removeItem(), and resetIndex().
int QGraphicsSceneBspTreeIndexPrivate::indexTimerId |
Definition at line 83 of file qgraphicsscenebsptreeindex_p.h.
Referenced by _q_updateIndex(), and startIndexTimer().
int QGraphicsSceneBspTreeIndexPrivate::lastItemCount |
Definition at line 86 of file qgraphicsscenebsptreeindex_p.h.
Referenced by _q_updateIndex().
bool QGraphicsSceneBspTreeIndexPrivate::purgePending |
Definition at line 93 of file qgraphicsscenebsptreeindex_p.h.
Referenced by purgeRemovedItems(), and removeItem().
bool QGraphicsSceneBspTreeIndexPrivate::regenerateIndex |
Definition at line 85 of file qgraphicsscenebsptreeindex_p.h.
Referenced by _q_updateIndex(), and resetIndex().
QSet<QGraphicsItem *> QGraphicsSceneBspTreeIndexPrivate::removedItems |
Definition at line 94 of file qgraphicsscenebsptreeindex_p.h.
Referenced by purgeRemovedItems(), and removeItem().
bool QGraphicsSceneBspTreeIndexPrivate::restartIndexTimer |
Definition at line 84 of file qgraphicsscenebsptreeindex_p.h.
Referenced by startIndexTimer().
QRectF QGraphicsSceneBspTreeIndexPrivate::sceneRect |
Definition at line 81 of file qgraphicsscenebsptreeindex_p.h.
Referenced by _q_updateIndex().
bool QGraphicsSceneBspTreeIndexPrivate::sortCacheEnabled |
Definition at line 102 of file qgraphicsscenebsptreeindex_p.h.
Referenced by _q_updateSortCache(), estimateItems(), invalidateSortCache(), and sortItems().
QList<QGraphicsItem *> QGraphicsSceneBspTreeIndexPrivate::unindexedItems |
Definition at line 89 of file qgraphicsscenebsptreeindex_p.h.
Referenced by _q_updateIndex(), addItem(), estimateItems(), removeItem(), and resetIndex().
QList<QGraphicsItem *> QGraphicsSceneBspTreeIndexPrivate::untransformableItems |
Definition at line 90 of file qgraphicsscenebsptreeindex_p.h.
Referenced by _q_updateIndex(), estimateItems(), removeItem(), and resetIndex().
bool QGraphicsSceneBspTreeIndexPrivate::updatingSortCache |
Definition at line 103 of file qgraphicsscenebsptreeindex_p.h.
Referenced by _q_updateSortCache(), and invalidateSortCache().