def __init__(self): # Parent constructor(s) View.__init__(self) QTextEdit.__init__(self) self.acceptUpdate = True self.nodes = {} self.edges = {} self.graphName = "my_graph" self.textCursor().insertText("graph " + self.graphName + " {\n}") self.checker = DotAttrsUtils()
def __init__(self): # Parent constructor(s) View.__init__(self) QGraphicsView.__init__(self) self.nodes = {} self.edges = {} self.nodeHasBeenMoved = False # Enable Antiliasing self.setRenderHint(QPainter.Antialiasing) # Rectangular selection self.setDragMode(QGraphicsView.RubberBandDrag) self.setRubberBandSelectionMode(Qt.IntersectsItemShape) # Init scene self.scene = QGraphicsScene() self.setScene(self.scene) self.resetSceneRect() self.scene.installEventFilter(self) self.show()