Hi,
I have a code that generates two QList:
QList<QGraphicsItems *>
QList<QPointF>
When a user clicks on the middle mouse on a scene, a new item is added to the first list and its position is added to the second list.
I want to be able to remove an item from a scene if the user clicks on the middle mouse on the item on the scene. something like:
if (e->buttons().testFlag(Qt::MidButton))
{
QGraphicsItem *item;
item = itemAt(e->scenePos());
if (item)
{
this->Scene->removeItem(item);
/* remove the location of the item from QList<QPointF> */
}
I was thinking that if I'll have a way to know the location of the item in the QList<QGraphicsItems *>, I'll be able to remove its position from QList<QPointF>.
How can I do this?
Thank you for any solutions.
Bookmarks