I'm trying to create something similar to terragens node network view in python using PySide.
I subclassed QGraphicsRectItem using this code.
class Node(QGraphicsRectItem):
def __init__(self,pos):
QGraphicsRectItem.__init__(self,pos.x()-100,pos.y()-30,200,60)
self.setFlag(QGraphicsItem.ItemIsMovable,True)
(...)
Which gives this (with some fancy painting):
I'd like to implent connecting nodes by dragging the mouse from one small rectangle to another, but this results in moving the whole node.
So I don't want the QGraphicsRectItem getting moved when the mouse is pressed inside a small rectangle. How would I be able to do this.
(if needed, I can define something like isInDraggingArea(x,y)
)
Thanks in advance.