I'm working on a project were I'm using a QGraphicsScene to show some multimedia objects such as images and texts using QGraphicsItem. And I have a Widget from where I can drag and drop some files from the user computer to the Scene which triggers the creation of a new QGraphicsItem.
Ok, now here's what I'm trying to do... I'd like to make those QGraphicsItem to change their images, texts, and so on when I drop an element from my Widget. In other words, I'd like to make them behave as some sort of containers that can show the dropped element. Most of this functionality is already implemented, but I coudn't make my QGraphicsItem to accept the drop events at the same time as my QGraphicsScene. When one of them is working, the other one is not.
At the end of each "drag" event from my QGraphicsScene I've inserted this code:
void SpatialScene::dragEnterEvent(QGraphicsSceneDragDropEvent *event)
{
(...)
QGraphicsScene::dragEnterEvent(event);
}
When I did that, the events where reaching my QGraphicsItem just fine, but then all of my drop events where rejected by the QGraphicsScene and I have no Ideia why. (I'm receiving a IgnoreAction in the dropEvent method).
I don't know if I've made my problem clear but... Can someone help me with this? How can I make both QGraphicsScene and its QGraphicsItem to accept the drop events?