def paint(self, painter, option, widget=None): """Overload QGraphicsPathItem method.""" new_option = QStyleOptionGraphicsItem(option) # suppress the "selected" state # this avoids the dashed rectangle surrounding the ray when selected new_option.state = QStyle.State_None QGraphicsPathItem.paint(self, painter, new_option, widget)
def paint(self, painter, option, widget): painter.save() painter.setRenderHint(QPainter.Antialiasing, bool(options.antialiasing)) pen = self.pen() cosm_pen = QPen(pen) cosm_pen.setCosmetic(True) cosm_pen.setWidthF(1.00001) QGraphicsPathItem.paint(self, painter, option, widget) painter.setPen(cosm_pen) painter.setBrush(Qt.NoBrush) painter.setOpacity(0.2) painter.drawPath(self.path()) painter.restore()
def paint(self, painter, option, widget): painter.save() painter.setRenderHint(QPainter.Antialiasing, bool(options.antialiasing)) QGraphicsPathItem.paint(self, painter, option, widget) painter.restore()