After some test I have found that if the mouse cursor is "over" an item, a call to set the cursor of the view is ignored.

So going back to Bazs ideas I added a check to re-update the view cursor whenever an item is left.

Thanks for all the help!

class MyRect(QGraphicsRectItem):
    ...
    def hoverLeaveEvent(self, hoverEvent):
        self.scene()._viewCursorReset = True

class MyView(QGraphicsView):
    ...
    def mouseMoveEvent(self, mouseEvent):
        ...
        if self.scene()._viewCursorReset:
            # update cursors
            # only once if view is reentered
            self.updateItems()
            self.scene()._viewCursorReset = False
        ...

class MyScene(QGraphicsScene):
    ...
    def __init__(self, parent=None):
        ...
        self._viewCursorReset = True
        ...
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to