def drawEllipse(self, x, y, r): self.Item = qt.QGraphicsEllipseItem(x - r / 2, y - r / 2, r, r) self.Item.setFlag(qt.QGraphicsItem.ItemIsMovable) pen = qt.QPen(qt.Qt.blue) pen.setWidth(3) brush = qt.QBrush(qt.QColor(0xFF, 0, 0, 0x00)) self.Item.setBrush(brush) self.Item.setPen(pen) self.scene.addItem(self.Item)
def drawPoint(self, x, y): self.scene.addRect(x, y, 4, 4, qt.Qt.black, qt.QBrush(qt.Qt.red)) self.scene.update