QElectroTech
0.70
|
#include <qgimanager.h>
Public Member Functions | |
QGIManager (QGraphicsScene *) | |
virtual | ~QGIManager () |
void | manage (QGraphicsItem *) |
void | release (QGraphicsItem *) |
void | manage (const QList< QGraphicsItem *> &) |
void | release (const QList< QGraphicsItem *> &) |
void | setDestroyQGIOnDelete (bool) |
bool | manages (QGraphicsItem *) const |
Private Member Functions | |
QGIManager (const QGIManager &) | |
Private Attributes | |
QGraphicsScene * | scene |
QHash< QGraphicsItem *, int > | qgi_manager |
bool | destroy_qgi_on_delete |
This class provides a QGraphicsItem manager, which can delete QGraphicsItem as soon as there is no reference to them anymore.
Definition at line 27 of file qgimanager.h.
QGIManager::QGIManager | ( | QGraphicsScene * | sc | ) |
Constructeur
sc | QGraphicsScene a utiliser pour gerer au mieux les QGraphicsItem |
Definition at line 24 of file qgimanager.cpp.
|
virtual |
Destructeur Lors de sa destruction, le QGI Manager detruit les QGraphicsItem restants si ceux-ci n'appartiennent pas a la scene ; ce comportement peut etre change avec la methode setDestroyQGIOnDelete
Definition at line 37 of file qgimanager.cpp.
References destroy_qgi_on_delete, qgi_manager, and scene.
|
private |
void QGIManager::manage | ( | QGraphicsItem * | qgi | ) |
Demande au QGIManager de gerer un QGI
qgi | QGraphicsItem a gerer |
Definition at line 48 of file qgimanager.cpp.
References qgi_manager.
Referenced by DeleteQGraphicsItemCommand::DeleteQGraphicsItemCommand(), and manage().
void QGIManager::manage | ( | const QList< QGraphicsItem *> & | qgis | ) |
Demande au QGIManager de gerer plusieurs QGI
qgis | QGraphicsItems a gerer |
Definition at line 73 of file qgimanager.cpp.
References manage().
bool QGIManager::manages | ( | QGraphicsItem * | qgi | ) | const |
Permet de savoir si ce QGIManager gere ou non un item donne
qgi | QGraphicsItem dont il faut verifier la presence |
Definition at line 101 of file qgimanager.cpp.
References qgi_manager.
void QGIManager::release | ( | QGraphicsItem * | qgi | ) |
Indique au QGIManager qu'une reference vers un QGI a ete detruite S'il n'y a plus de references vers ce QGI et que celui-ci n'est pas present sur la scene de ce QGIManager, alors il sera detruit.
qgi | QGraphicsItem a ne plus gerer |
Definition at line 60 of file qgimanager.cpp.
References qgi_manager, and scene.
Referenced by release(), ElementScene::reset(), and DeleteQGraphicsItemCommand::~DeleteQGraphicsItemCommand().
void QGIManager::release | ( | const QList< QGraphicsItem *> & | qgis | ) |
Indique au QGIManager que pour chaque QGI fourni, une reference vers celui-ci a ete detruite. S'il n'y a plus de references vers un QGI et que celui-ci n'est pas present sur la scene de ce QGIManager, alors il sera detruit.
qgis | QGraphicsItems a ne plus gerer |
Definition at line 84 of file qgimanager.cpp.
References release().
void QGIManager::setDestroyQGIOnDelete | ( | bool | b | ) |
Indique au QGIManager de detruire les QGraphicsItem restants lors de sa destruction si ceux-ci n'appartiennent pas a la scene
Definition at line 92 of file qgimanager.cpp.
References destroy_qgi_on_delete.
|
private |
Definition at line 39 of file qgimanager.h.
Referenced by setDestroyQGIOnDelete(), and ~QGIManager().
|
private |
Definition at line 38 of file qgimanager.h.
Referenced by manage(), manages(), release(), and ~QGIManager().
|
private |
Definition at line 37 of file qgimanager.h.
Referenced by release(), and ~QGIManager().