mouseEvent reaches other GraphicsItem than clicked on
Here's my implementation of mousePressEvent:
Code:
{
if(event->button()==Qt::RightButton){
Owner owner(id);
owner.exec();
}
if(event->button()==Qt::LeftButton){
if(color == Qt::blue) color = Qt::red;
else color = Qt::blue;
}
}
Owner inherits QInputDialog and Node inherits QGraphicsItem.
The problem is that when I click on the first item, everything is just fine. The item that was hit changes color and I make some input.
But when I click on any other item it doesn't change color. The first one does instead.
What could cause the trouble?