QtBase
v6.3.1
|
The QGraphicsSceneIndex class provides a base class to implement a custom indexing algorithm for discovering items in QGraphicsScene. More...
#include <qgraphicssceneindex_p.h>
Protected Slots | |
virtual void | updateSceneRect (const QRectF &rect) |
Protected Member Functions | |
virtual void | clear () |
virtual void | addItem (QGraphicsItem *item)=0 |
virtual void | removeItem (QGraphicsItem *item)=0 |
virtual void | deleteItem (QGraphicsItem *item) |
virtual void | itemChange (const QGraphicsItem *item, QGraphicsItem::GraphicsItemChange, const void *const value) |
virtual void | prepareBoundingRectChange (const QGraphicsItem *item) |
QGraphicsSceneIndex (QGraphicsSceneIndexPrivate &dd, QGraphicsScene *scene) | |
Protected Member Functions inherited from QObject | |
QObject * | sender () const |
int | senderSignalIndex () const |
int | receivers (const char *signal) const |
bool | isSignalConnected (const QMetaMethod &signal) const |
virtual void | timerEvent (QTimerEvent *event) |
virtual void | childEvent (QChildEvent *event) |
virtual void | customEvent (QEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
QObject (QObjectPrivate &dd, QObject *parent=nullptr) | |
Friends | |
class | QGraphicsScene |
class | QGraphicsScenePrivate |
class | QGraphicsItem |
class | QGraphicsItemPrivate |
class | QGraphicsSceneBspTreeIndex |
The QGraphicsSceneIndex class provides a base class to implement a custom indexing algorithm for discovering items in QGraphicsScene.
Definition at line 74 of file qgraphicssceneindex_p.h.
QGraphicsSceneIndex::QGraphicsSceneIndex | ( | QGraphicsScene * | scene = nullptr | ) |
Constructs an abstract scene index for a given scene.
Definition at line 348 of file qgraphicssceneindex.cpp.
|
virtual |
Destroys the scene index.
Definition at line 366 of file qgraphicssceneindex.cpp.
|
protected |
Definition at line 357 of file qgraphicssceneindex.cpp.
|
protectedpure virtual |
This pure virtual function inserts an item to the scene index.
Implemented in QGraphicsSceneLinearIndex, and QGraphicsSceneBspTreeIndex.
|
protectedvirtual |
This virtual function removes all items in the scene index.
Reimplemented in QGraphicsSceneLinearIndex, and QGraphicsSceneBspTreeIndex.
Definition at line 559 of file qgraphicssceneindex.cpp.
|
protectedvirtual |
This method is called when an item has been deleted. The default implementation call removeItem. Be carefull, if your implementation of removeItem use pure virtual method of QGraphicsItem like boundingRect(), then you should reimplement this method.
Definition at line 591 of file qgraphicssceneindex.cpp.
|
virtual |
This virtual function return an estimation of items at position point. This method return a list sorted using order.
Definition at line 515 of file qgraphicssceneindex.cpp.
|
pure virtual |
Implemented in QGraphicsSceneLinearIndex, and QGraphicsSceneBspTreeIndex.
|
virtual |
Reimplemented in QGraphicsSceneBspTreeIndex.
Definition at line 520 of file qgraphicssceneindex.cpp.
|
protectedvirtual |
This virtual function is called by QGraphicsItem to notify the index that some part of the item 's state changes. By reimplementing this function, your can react to a change, and in some cases, (depending on change,) adjustments in the index can be made.
change is the parameter of the item that is changing. value is the value that changed; the type of the value depends on change.
The default implementation does nothing.
Reimplemented in QGraphicsSceneBspTreeIndex.
Definition at line 609 of file qgraphicssceneindex.cpp.
|
virtual |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Returns all visible items that, depending on mode, are either inside or intersect with the specified path and return a list sorted using order.
The default value for mode is Qt::IntersectsItemShape; all items whose exact shape intersects with or is contained by path are returned.
deviceTransform is the transformation apply to the view.
This method use the estimation of the index (estimateItems) and refine the list to get an exact result. If you want to implement your own refinement algorithm you can reimplement this method.
Definition at line 500 of file qgraphicssceneindex.cpp.
|
virtual |
Returns all visible items that, depending on mode, are at the specified pos and return a list sorted using order.
The default value for mode is Qt::IntersectsItemShape; all items whose exact shape intersects with pos are returned.
deviceTransform is the transformation apply to the view.
This method use the estimation of the index (estimateItems) and refine the list to get an exact result. If you want to implement your own refinement algorithm you can reimplement this method.
Definition at line 400 of file qgraphicssceneindex.cpp.
|
virtual |
Definition at line 465 of file qgraphicssceneindex.cpp.
|
virtual |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Returns all visible items that, depending on mode, are either inside or intersect with the specified rect and return a list sorted using order.
The default value for mode is Qt::IntersectsItemShape; all items whose exact shape intersects with or is contained by rect are returned.
deviceTransform is the transformation apply to the view.
This method use the estimation of the index (estimateItems) and refine the list to get an exact result. If you want to implement your own refinement algorithm you can reimplement this method.
Definition at line 432 of file qgraphicssceneindex.cpp.
|
pure virtual |
This pure virtual function all items in the index and sort them using order.
Implemented in QGraphicsSceneLinearIndex, and QGraphicsSceneBspTreeIndex.
|
protectedvirtual |
Notify the index for a geometry change of an item.
Reimplemented in QGraphicsSceneBspTreeIndex.
Definition at line 621 of file qgraphicssceneindex.cpp.
|
protectedpure virtual |
This pure virtual function removes an item to the scene index.
Implemented in QGraphicsSceneLinearIndex, and QGraphicsSceneBspTreeIndex.
QGraphicsScene * QGraphicsSceneIndex::scene | ( | ) | const |
Returns the scene of this index.
Definition at line 374 of file qgraphicssceneindex.cpp.
Notifies the index that the scene's scene rect has changed. rect is thew new scene rect.
Definition at line 551 of file qgraphicssceneindex.cpp.
|
friend |
Definition at line 113 of file qgraphicssceneindex_p.h.
|
friend |
Definition at line 114 of file qgraphicssceneindex_p.h.
|
friend |
Definition at line 111 of file qgraphicssceneindex_p.h.
|
friend |
Definition at line 115 of file qgraphicssceneindex_p.h.
|
friend |
Definition at line 112 of file qgraphicssceneindex_p.h.