def hoverMove(self, item: QGraphicsItem, event: QGraphicsSceneHoverEvent, flag: bool = None): """flag is for the case where an item in the path also needs to implement the hover method Args: item: Description event: Description flag: Description """ self.show() self.updateLocation(item, item.mapToScene(QPointF(event.pos()))) pos_scene = item.mapToScene(QPointF(event.pos())) pos_item = item.mapFromScene(pos_scene) if flag is None: self.setTopStrand(self.helixIndex(pos_item)[1] == 0) else: self.setTopStrand(flag) new_position = self.helixPos(pos_item) if new_position is not None: self.setPos(new_position)