How to remove a QGraphicsPixmapItem from a Scene?
Hi, I need to remove some images in the QgraphicsScene, but I don't know how, cause the function remove that is originally a function of QGraphicsItem, don't appear. My code here:
Code:
QTransform transform;
int x = recorGato->col*40+220;
int y = recorGato->row*40+120;
QGraphicsPixmapItem *image2
= qgraphicsitem_cast<QGraphicsPixmapItem
*>
(scene
->itemAt
(x,y,transform
));
image2->setPos(10.0,10.0); //Need to replace move position for remove item here.
Where the only thing I could do to not see this image, is move it to another position (last line of the code I showed).
Thanks for your time.
Re: How to remove a QGraphicsPixmapItem from a Scene?
Is there something wrong with QGraphicsScene::removeItem()?
QGraphicsItem has no function called remove().
Re: How to remove a QGraphicsPixmapItem from a Scene?
Quote:
Originally Posted by
ChrisW67
Thanks, maybe I was confuse about it, maybe I thought removeItem() was a function of QGraphicsItem.