#include <VP1GraphicsItemCollection.h>
Definition at line 53 of file VP1GraphicsItemCollection.h.
◆ INTERACTIONMODE
◆ VP1GraphicsItemCollection() [1/2]
| VP1GraphicsItemCollection::VP1GraphicsItemCollection |
( |
QObject * | parent = 0 | ) |
|
◆ ~VP1GraphicsItemCollection()
| VP1GraphicsItemCollection::~VP1GraphicsItemCollection |
( |
| ) |
|
|
virtual |
◆ VP1GraphicsItemCollection() [2/2]
◆ addItem()
| void VP1GraphicsItemCollection::addItem |
( |
QGraphicsItem * | item, |
|
|
const bool & | active = false, |
|
|
const bool & | movable = false ) |
Definition at line 94 of file VP1GraphicsItemCollection.cxx.
95{
96 assert(!
m_d->items2active.contains(item)&&
"Please do not add the same item twice");
97 assert(!
item->flags()&&
"Please do not add any flags to your items!!");
98
100
101 m_d->scene->addItem(item);
102 item->setFlag(QGraphicsItem::ItemIsMovable,(movable&&(!
m_d->ignoreall_move)));
103 }
104 assert(!
m_d->items2active.contains(item));
105 m_d->items2active.insert(item,active);
106 if (active)
108 if (movable)
110}
◆ attachToView()
Definition at line 240 of file VP1GraphicsItemCollection.cxx.
241{
245
249 for (it=
m_d->items2active.begin();it!=itE;++it) {
250 m_d->scene->addItem(
it.key());
251 }
252
253 m_d->setEnabledMovableItems(!
m_d->ignoreall_move);
254}
QHash< QGraphicsItem *, bool >::iterator ItemDataMapItr
◆ clear()
| void VP1GraphicsItemCollection::clear |
( |
const bool & | deleteitems = true | ) |
|
Definition at line 175 of file VP1GraphicsItemCollection.cxx.
176{
177
179 m_d->view->clearSelections();
180
183
184 for (it=
m_d->items2active.begin();it!=itE;++it)
185 m_d->scene->removeItem(
it.key());
186 }
187 if (deleteitems) {
188
189 for (it=
m_d->items2active.begin();it!=itE;++it) {
191 }
192 }
193 m_d->items2active.clear();
194 m_d->movableitems.clear();
196}
◆ detachFromView()
| void VP1GraphicsItemCollection::detachFromView |
( |
| ) |
|
◆ hasItem()
| bool VP1GraphicsItemCollection::hasItem |
( |
QGraphicsItem * | item | ) |
const |
◆ interactionMode()
◆ isAttachedToView()
| bool VP1GraphicsItemCollection::isAttachedToView |
( |
| ) |
|
◆ itemBelongsAndIsPresentlyActive()
| bool VP1GraphicsItemCollection::itemBelongsAndIsPresentlyActive |
( |
QGraphicsItem * | item | ) |
const |
Definition at line 330 of file VP1GraphicsItemCollection.cxx.
331{
333 return false;
334 QHash<QGraphicsItem*,bool>::const_iterator
it =
m_d->items2active.find(item);
335
336
337 if (it==
m_d->items2active.constEnd())
338 return false;
339 else
341}
int nPresentlyActiveItems() const
◆ itemGotEvent
| void VP1GraphicsItemCollection::itemGotEvent |
( |
QGraphicsItem * | , |
|
|
QEvent * | ) const |
|
signal |
◆ itemGotEventPrivate()
| void VP1GraphicsItemCollection::itemGotEventPrivate |
( |
QGraphicsItem * | item, |
|
|
QEvent * | event ) const |
|
private |
◆ itemPicked
| void VP1GraphicsItemCollection::itemPicked |
( |
QGraphicsItem * | | ) |
const |
|
signal |
◆ itemPickedPrivate()
| void VP1GraphicsItemCollection::itemPickedPrivate |
( |
QGraphicsItem * | item | ) |
const |
|
private |
◆ nActiveItems()
| int VP1GraphicsItemCollection::nActiveItems |
( |
| ) |
const |
◆ nItems()
| int VP1GraphicsItemCollection::nItems |
( |
| ) |
const |
◆ nMovableItems()
| int VP1GraphicsItemCollection::nMovableItems |
( |
| ) |
const |
◆ nPresentlyActiveItems()
| int VP1GraphicsItemCollection::nPresentlyActiveItems |
( |
| ) |
const |
◆ nPresentlyMovableItems()
| int VP1GraphicsItemCollection::nPresentlyMovableItems |
( |
| ) |
const |
◆ operator=()
◆ real_detachFromView()
| void VP1GraphicsItemCollection::real_detachFromView |
( |
| ) |
|
|
private |
◆ reattachToView()
| void VP1GraphicsItemCollection::reattachToView |
( |
| ) |
|
◆ removeItem()
| bool VP1GraphicsItemCollection::removeItem |
( |
QGraphicsItem * | item | ) |
|
Definition at line 115 of file VP1GraphicsItemCollection.cxx.
116{
118 if (it==
m_d->items2active.end())
119 return false;
123 m_d->scene->removeItem(item);
124 }
125 m_d->items2active.erase(it);
126 assert(!
m_d->items2active.contains(item));
127
128 if (!
m_d->movableitems.empty()) {
129 QSet<QGraphicsItem*>::iterator it2 =
m_d->movableitems.find(item);
130 if (it2!=
m_d->movableitems.end()) {
131 assert(
m_d->movableitems.contains(item));
132 m_d->movableitems.erase(it2);
133 }
134 }
135 assert(!
m_d->movableitems.contains(item));
136 return true;
137}
◆ selectionChanged
| void VP1GraphicsItemCollection::selectionChanged |
( |
QList< QGraphicsItem * > | | ) |
const |
|
signal |
◆ selectionChangedPrivate()
| void VP1GraphicsItemCollection::selectionChangedPrivate |
( |
const QList< QGraphicsItem * > & | items | ) |
const |
|
private |
◆ setActive()
| bool VP1GraphicsItemCollection::setActive |
( |
QGraphicsItem * | item, |
|
|
const bool & | active = true ) |
◆ setInteractionMode()
| void VP1GraphicsItemCollection::setInteractionMode |
( |
const INTERACTIONMODE & | im | ) |
|
Definition at line 77 of file VP1GraphicsItemCollection.cxx.
78{
79 assert(!
m_d->scene&&
"VP1GraphicsItemCollection::setInteractionMode can not be called while a scene is attached.");
81 std::cout<<"VP1GraphicsItemCollection::setInteractionMode can not be called while a scene is attached."<<std::endl;
82 return;
83 }
84 m_d->interactionmode =
im;
85}
◆ setMovable()
| bool VP1GraphicsItemCollection::setMovable |
( |
QGraphicsItem * | item, |
|
|
const bool & | movable = true ) |
Definition at line 140 of file VP1GraphicsItemCollection.cxx.
141{
143 if (it==
m_d->items2active.end())
144 return false;
145 if (movable==
m_d->movableitems.contains(item))
146 return true;
147 if (movable) {
148 assert(!
m_d->movableitems.contains(item));
150 } else {
151 assert(
m_d->movableitems.contains(item));
152 m_d->movableitems.remove(item);
153 assert(!
m_d->movableitems.contains(item));
154 }
155 if (!
m_d->ignoreall_move)
156 item->setFlag(QGraphicsItem::ItemIsMovable,movable);
157 return true;
158}
◆ setTemporaryIgnoreInteractions()
| void VP1GraphicsItemCollection::setTemporaryIgnoreInteractions |
( |
const bool & | b | ) |
|
|
private |
◆ setTemporaryIgnoreMovable()
| void VP1GraphicsItemCollection::setTemporaryIgnoreMovable |
( |
const bool & | b | ) |
|
|
private |
◆ VP1GraphicsView
◆ m_d
| Imp* VP1GraphicsItemCollection::m_d |
|
private |
The documentation for this class was generated from the following files: