def hoverEnterEvent(self, event: QGraphicsSceneHoverEvent):
        """
        hoverEnterEvent

        Parameters
        ----------
        event : QGraphicsSceneHoverEvent
        """
        self._geometry.hovered = True
        self.update()
        self._scene.connection_hovered.emit(self.connection, event.screenPos())
        event.accept()
예제 #2
0
    def hoverEnterEvent(self, event: QGraphicsSceneHoverEvent):
        """
        hoverEnterEvent

        Parameters
        ----------
        event : QGraphicsSceneHoverEvent
        """
        # void
        # bring all the colliding nodes to background
        overlap_items = self.collidingItems()
        for item in overlap_items:
            if item.zValue() > 0.0:
                item.setZValue(0.0)

        # bring self node forward
        self.setZValue(1.0)
        self._node.geometry.hovered = True
        self.update()
        self._scene.node_hovered.emit(self._node, event.screenPos())
        event.accept()