added these 3 functions and finally it works
void dragEnterEvent ( QGraphicsSceneDragDropEvent * event )
{
cout << "drag entered in graphics item 2" << endl;
event->acceptProposedAction();
}
void dropEvent ( QGraphicsSceneDragDropEvent * event )
{
cout << "dropped in graphics item 2" << endl;
event->acceptProposedAction();
}
void dragMoveEvent ( QGraphicsSceneDragDropEvent * event )
{
cout << "drag moved in graphics item 2" << endl;
event->acceptProposedAction();
}
void dragEnterEvent ( QGraphicsSceneDragDropEvent * event )
{
cout << "drag entered in graphics item 2" << endl;
event->acceptProposedAction();
}
void dropEvent ( QGraphicsSceneDragDropEvent * event )
{
cout << "dropped in graphics item 2" << endl;
event->acceptProposedAction();
}
void dragMoveEvent ( QGraphicsSceneDragDropEvent * event )
{
cout << "drag moved in graphics item 2" << endl;
event->acceptProposedAction();
}
To copy to clipboard, switch view to plain text mode
Still maybe there is a way to accept drops by graphics scene directly?
Bookmarks