Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QGraphicsSceneBspTreeIndexPrivate Class Reference

#include <qgraphicsscenebsptreeindex_p.h>

+ Inheritance diagram for QGraphicsSceneBspTreeIndexPrivate:
+ Collaboration diagram for QGraphicsSceneBspTreeIndexPrivate:

Public Member Functions

 QGraphicsSceneBspTreeIndexPrivate (QGraphicsScene *scene)
 Constructs a private scene bsp index.
 
void purgeRemovedItems ()
 
void _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.
 
void startIndexTimer (int interval=QGRAPHICSSCENE_INDEXTIMER_TIMEOUT)
 
void resetIndex ()
 
void _q_updateSortCache ()
 
void invalidateSortCache ()
 
void addItem (QGraphicsItem *item, bool recursive=false)
 
void removeItem (QGraphicsItem *item, bool recursive=false, bool moveToUnindexedItems=false)
 
QList< QGraphicsItem * > estimateItems (const QRectF &, Qt::SortOrder, bool b=false)
 
- Public Member Functions inherited from QGraphicsSceneIndexPrivate
 QGraphicsSceneIndexPrivate (QGraphicsScene *scene)
 Constructs a private scene index.
 
 ~QGraphicsSceneIndexPrivate ()
 Destructor of private scene index.
 
void init ()
 
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
 
void items_helper (const QRectF &rect, QGraphicsSceneIndexIntersector intersect, QList< QGraphicsItem * > *items, const QTransform &viewTransform, Qt::ItemSelectionMode mode, Qt::SortOrder order, const void *intersectData) const
 
- Public Member Functions inherited from QObjectPrivate
void ensureExtraData ()
 
 QObjectPrivate (int version=QObjectPrivateVersion)
 
virtual ~QObjectPrivate ()
 
void deleteChildren ()
 
void clearBindingStorage ()
 
void checkForIncompatibleLibraryVersion (int version) const
 
void setParent_helper (QObject *)
 
void moveToThread_helper ()
 
void setThreadData_helper (QThreadData *currentData, QThreadData *targetData, QBindingStatus *status)
 
QObjectList receiverList (const char *signal) const
 
void ensureConnectionData ()
 
void addConnection (int signal, Connection *c)
 
int signalIndex (const char *signalName, const QMetaObject **meta=nullptr) const
 
bool isSignalConnected (uint signalIdx, bool checkDeclarative=true) const
 
bool maybeSignalConnected (uint signalIndex) const
 
bool isDeclarativeSignalConnected (uint signalIdx) const
 
void connectNotify (const QMetaMethod &signal)
 
void disconnectNotify (const QMetaMethod &signal)
 
void reinitBindingStorageAfterThreadMove ()
 
virtual std::string flagsForDumping () const
 
virtual void writeToDebugStream (QDebug &) const
 
QtPrivate::QPropertyAdaptorSlotObjectgetPropertyAdaptorSlotObject (const QMetaProperty &property)
 
- Public Member Functions inherited from QObjectData
 QObjectData ()=default
 
virtual ~QObjectData ()=0
 
QMetaObjectdynamicMetaObject () const
 

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 Public Member Functions inherited from QGraphicsSceneIndexPrivate
static bool itemCollidesWithPath (const QGraphicsItem *item, const QPainterPath &path, Qt::ItemSelectionMode mode)
 
- Static Public Member Functions inherited from QObjectPrivate
static bool removeConnection (Connection *c)
 
static QObjectPrivateget (QObject *o)
 
static const QObjectPrivateget (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)
 

Public Attributes

QGraphicsSceneBspTree bsp
 
QRectF sceneRect
 
int bspTreeDepth
 
int indexTimerId
 
bool restartIndexTimer
 
bool regenerateIndex
 
int lastItemCount
 
QList< QGraphicsItem * > indexedItems
 
QList< QGraphicsItem * > unindexedItems
 
QList< QGraphicsItem * > untransformableItems
 
QList< int > freeItemIndexes
 
bool purgePending
 
QSet< QGraphicsItem * > removedItems
 
bool sortCacheEnabled
 
bool updatingSortCache
 
- Public Attributes inherited from QGraphicsSceneIndexPrivate
QGraphicsScenescene
 
- Public Attributes inherited from QObjectPrivate
ExtraDataextraData
 
QAtomicPointer< QThreadDatathreadData
 
QAtomicPointer< ConnectionDataconnections
 
union { 
 
   QObject *   currentChildBeingDeleted 
 
   QAbstractDeclarativeData *   declarativeData 
 
};  
 
QAtomicPointer< QtSharedPointer::ExternalRefCountDatasharedRefcount
 
- Public Attributes inherited from QObjectData
QObjectq_ptr
 
QObjectparent
 
QObjectList children
 
uint isWidget: 1
 
uint blockSig: 1
 
uint wasDeleted: 1
 
uint isDeletingChildren: 1
 
uint sendChildEvents: 1
 
uint receiveChildEvents: 1
 
uint isWindow: 1
 
uint deleteLaterCalled: 1
 
uint isQuickItem: 1
 
uint willBeWidget: 1
 
uint wasWidget: 1
 
uint receiveParentEvents: 1
 
uint unused: 20
 
QAtomicInt postedEvents
 
QDynamicMetaObjectDatametaObject
 
QBindingStorage bindingStorage
 

Additional Inherited Members

- Public Types inherited from QObjectPrivate
typedef void(* StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **)
 
using ConnectionDataPointer = QExplicitlySharedDataPointer<ConnectionData>
 

Detailed Description

Definition at line 74 of file qgraphicsscenebsptreeindex_p.h.

Constructor & Destructor Documentation

◆ QGraphicsSceneBspTreeIndexPrivate()

QGraphicsSceneBspTreeIndexPrivate::QGraphicsSceneBspTreeIndexPrivate ( QGraphicsScene * scene)

Constructs a private scene bsp index.

Definition at line 60 of file qgraphicsscenebsptreeindex.cpp.

Member Function Documentation

◆ _q_updateIndex()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _q_updateSortCache()

void QGraphicsSceneBspTreeIndexPrivate::_q_updateSortCache ( )

Definition at line 229 of file qgraphicsscenebsptreeindex.cpp.

References _q_updateIndex(), QList< T >::at(), climbTree(), QGraphicsItem::d_ptr, i, item, items, QGraphicsItemPrivate::parent, qt_closestLeaf(), QList< T >::size(), sortCacheEnabled, and updatingSortCache.

Referenced by estimateItems().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addItem()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ climbTree()

void QGraphicsSceneBspTreeIndexPrivate::climbTree ( QGraphicsItem * item,
int * stackingOrder )
static

Definition at line 205 of file qgraphicsscenebsptreeindex.cpp.

References QGraphicsItemPrivate::children, climbTree(), QGraphicsItem::d_ptr, QGraphicsItem::flags(), QGraphicsItemPrivate::globalStackingOrder, i, QList< T >::isEmpty(), item, QGraphicsItem::ItemStacksBehindParent, and qt_closestLeaf().

Referenced by _q_updateSortCache(), and climbTree().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ closestItemFirst_withCache()

static bool QGraphicsSceneBspTreeIndexPrivate::closestItemFirst_withCache ( const QGraphicsItem * item1,
const QGraphicsItem * item2 )
inlinestatic

Definition at line 111 of file qgraphicsscenebsptreeindex_p.h.

Referenced by sortItems().

+ Here is the caller graph for this function:

◆ closestItemLast_withCache()

static bool QGraphicsSceneBspTreeIndexPrivate::closestItemLast_withCache ( const QGraphicsItem * item1,
const QGraphicsItem * item2 )
inlinestatic

Definition at line 115 of file qgraphicsscenebsptreeindex_p.h.

Referenced by sortItems().

+ Here is the caller graph for this function:

◆ estimateItems()

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, 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.

+ Here is the call graph for this function:

◆ invalidateSortCache()

void QGraphicsSceneBspTreeIndexPrivate::invalidateSortCache ( )

Definition at line 256 of file qgraphicsscenebsptreeindex.cpp.

References QMetaObject::invokeMethod(), Qt::QueuedConnection, sortCacheEnabled, and updatingSortCache.

Referenced by addItem(), and removeItem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ purgeRemovedItems()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeItem()

void QGraphicsSceneBspTreeIndexPrivate::removeItem ( QGraphicsItem * item,
bool recursive = false,
bool moveToUnindexedItems = false )

◆ resetIndex()

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.

+ Here is the call graph for this function:

◆ sortItems()

void QGraphicsSceneBspTreeIndexPrivate::sortItems ( QList< QGraphicsItem * > * itemList,
Qt::SortOrder order,
bool sortCacheEnabled,
bool onlyTopLevelItems = false )
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, closestItemFirst_withCache(), closestItemLast_withCache(), Qt::DescendingOrder, qt_closestItemFirst(), qt_closestItemLast(), qt_closestLeaf(), qt_notclosestLeaf(), and sortCacheEnabled.

Referenced by estimateItems().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ startIndexTimer()

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().

+ Here is the caller graph for this function:

Member Data Documentation

◆ bsp

QGraphicsSceneBspTree QGraphicsSceneBspTreeIndexPrivate::bsp

◆ bspTreeDepth

int QGraphicsSceneBspTreeIndexPrivate::bspTreeDepth

Definition at line 82 of file qgraphicsscenebsptreeindex_p.h.

Referenced by _q_updateIndex().

◆ freeItemIndexes

QList<int> QGraphicsSceneBspTreeIndexPrivate::freeItemIndexes

◆ indexedItems

QList<QGraphicsItem *> QGraphicsSceneBspTreeIndexPrivate::indexedItems

◆ indexTimerId

int QGraphicsSceneBspTreeIndexPrivate::indexTimerId

Definition at line 83 of file qgraphicsscenebsptreeindex_p.h.

Referenced by _q_updateIndex(), and startIndexTimer().

◆ lastItemCount

int QGraphicsSceneBspTreeIndexPrivate::lastItemCount

Definition at line 86 of file qgraphicsscenebsptreeindex_p.h.

Referenced by _q_updateIndex().

◆ purgePending

bool QGraphicsSceneBspTreeIndexPrivate::purgePending

Definition at line 93 of file qgraphicsscenebsptreeindex_p.h.

Referenced by purgeRemovedItems(), and removeItem().

◆ regenerateIndex

bool QGraphicsSceneBspTreeIndexPrivate::regenerateIndex

Definition at line 85 of file qgraphicsscenebsptreeindex_p.h.

Referenced by _q_updateIndex(), and resetIndex().

◆ removedItems

QSet<QGraphicsItem *> QGraphicsSceneBspTreeIndexPrivate::removedItems

Definition at line 94 of file qgraphicsscenebsptreeindex_p.h.

Referenced by purgeRemovedItems(), and removeItem().

◆ restartIndexTimer

bool QGraphicsSceneBspTreeIndexPrivate::restartIndexTimer

Definition at line 84 of file qgraphicsscenebsptreeindex_p.h.

Referenced by startIndexTimer().

◆ sceneRect

QRectF QGraphicsSceneBspTreeIndexPrivate::sceneRect

Definition at line 81 of file qgraphicsscenebsptreeindex_p.h.

Referenced by _q_updateIndex().

◆ sortCacheEnabled

bool QGraphicsSceneBspTreeIndexPrivate::sortCacheEnabled

◆ unindexedItems

QList<QGraphicsItem *> QGraphicsSceneBspTreeIndexPrivate::unindexedItems

◆ untransformableItems

QList<QGraphicsItem *> QGraphicsSceneBspTreeIndexPrivate::untransformableItems

◆ updatingSortCache

bool QGraphicsSceneBspTreeIndexPrivate::updatingSortCache

Definition at line 103 of file qgraphicsscenebsptreeindex_p.h.

Referenced by _q_updateSortCache(), and invalidateSortCache().


The documentation for this class was generated from the following files: