Re: Problem with MouseEvents
Subclass the item class and reimplement its mousePressEvent handler. Or subclass the scene or the view and reimplement mousePressEvent there. However in the latter two cases you will first have to detect if you are pointing on an item.
Re: Problem with MouseEvents
I did what you said. But now I need to set a QPixmap for my subclass.
What can I do in the constructor to replace this part of my code?
Code:
QPixmap p2
("C:/Users/Pedro/Desktop/imagens/6.jpg");
scene->addItem(item);
Re: Problem with MouseEvents
Replace QGraphicsPixmapItem with the class you created.
Re: Problem with MouseEvents
You saved my life. Thank you.