def dropEvent(self, event): pos = self.mapToScene(event.pos()) geo_pos = self.world_map.to_geographical_coordinates(pos.x(), pos.y()) if event.mimeData().hasFormat('application/x-dnditemdata'): new_gnode = GraphicalNetworkNode(self) new_gnode.setPos(pos) # update the nodes coordinates at creation new_gnode.node.longitude, new_gnode.node.latitude = geo_pos
def dropEvent(self, event): pos = self.mapToScene(event.pos()) if event.mimeData().hasFormat('application/x-dnditemdata'): network_gnode = GraphicalNetworkNode(self.network_view) # add the node to the logical site self.site.ps['node'].add(network_gnode.node) new_node = GraphicalNetworkNode(self, network_gnode.node) new_node.setPos(pos)
def dropEvent(self, event): pos = self.mapToScene(event.pos()) if event.mimeData().hasFormat('application/x-dnditemdata'): from graphical_objects.graphical_network_node import GraphicalNetworkNode new_gnode = GraphicalNetworkNode(self) if new_gnode.node.subtype != 'port': self.node.structure[new_gnode.node.name] = new_gnode.node.structure else: self.node.structure[new_gnode.node.name] = [] new_gnode.setPos(pos)
def dropEvent(self, event): pos = self.mapToScene(event.pos()) if event.mimeData().hasFormat('application/x-dnditemdata'): from graphical_objects.graphical_network_node import GraphicalNetworkNode new_gnode = GraphicalNetworkNode(self) if new_gnode.node.subtype != 'port': self.node.structure[ new_gnode.node.name] = new_gnode.node.structure else: self.node.structure[new_gnode.node.name] = [] new_gnode.setPos(pos)
def dropEvent(self, event): pos = self.mapToScene(event.pos()) if event.mimeData().hasFormat('application/x-dnditemdata'): network_gnode = GraphicalNetworkNode(self.network_view) new_node = GraphicalNetworkNode(self, network_gnode.node) new_node.setPos(pos)
def dropEvent(self, event): pos = self.mapToScene(event.pos()) if event.mimeData().hasFormat('application/x-dnditemdata'): from graphical_objects.graphical_network_node import GraphicalNetworkNode new_gnode = GraphicalNetworkNode(self) new_gnode.setPos(pos)