sean.reynolds
16th April 2011, 07:27
Hey Guys,
I currently have a graphics scene with dynamic QGraphicsItems being added to the scene. I would like to snap these items together by dragging one item on top of another and releasing the mouse button.
In the QGraphicsItem class i have the following function
public void dragEnterEvent(QGraphicsSceneDragDropEvent event)
{
System.out.println("Dragged on the item");
}
This code works fine when I drag some item from my desktop (say an Excel file), but it doesn't detect any item in my scene beign dragged on top of it.
Any help would really be appreciated.
Thanks
I currently have a graphics scene with dynamic QGraphicsItems being added to the scene. I would like to snap these items together by dragging one item on top of another and releasing the mouse button.
In the QGraphicsItem class i have the following function
public void dragEnterEvent(QGraphicsSceneDragDropEvent event)
{
System.out.println("Dragged on the item");
}
This code works fine when I drag some item from my desktop (say an Excel file), but it doesn't detect any item in my scene beign dragged on top of it.
Any help would really be appreciated.
Thanks