I thought I could use DragEvents....initially i tried dealing with mouseMove
If i used a mouse move event and detect the itemAt a particularpoint, it always returns the item i'm currently dragging (top most item).
If I wanted it to snap on top of another QGraphicsItem, can I use the mouseReleaseEvent in the QGraphicsScene
like...
{
//Code here to see if the item currently being dragged is on top of another item
super.mouseReleaseEvent(event);
}
public void mouseReleaseEvent(QGraphicsSceneMouseEvent event)
{
//Code here to see if the item currently being dragged is on top of another item
super.mouseReleaseEvent(event);
}
To copy to clipboard, switch view to plain text mode
Added after 1 3 minutes:
Found the solution. ColodingItems...
Block newBlock;
List l1 = collidingItems(selectedBlock);
for (int i = 0; i < l1.size(); i++)
{
newBlock = (Block)l1.get(i);
newBlock.testSetColor(Block.blockState.HOVER);
}
Block newBlock;
List l1 = collidingItems(selectedBlock);
for (int i = 0; i < l1.size(); i++)
{
newBlock = (Block)l1.get(i);
newBlock.testSetColor(Block.blockState.HOVER);
}
To copy to clipboard, switch view to plain text mode
Bookmarks