def set_line_from_shape(self, shape): pen = QPen() pen.setWidthF(getattr(shape, 'linewidth', 1.0)) if hasattr(shape, 'linestyle'): if shape.linestyle == 'dash': pen.setDashPattern([3.0, 4.0, 6.0, 4.0]) pen.setDashOffset(5.0) alpha = getattr(shape, 'alpha', 1.0) color = self.__get_color(shape.color, alpha) pen.setColor(color) self.cr.setPen(pen)
def set_line_from_shape(self, shape): pen = QPen() pen.setWidthF(getattr(shape, 'linewidth', 1.0)) if hasattr(shape, 'linestyle'): if shape.linestyle == 'dash': pen.setDashPattern([ 3.0, 4.0, 6.0, 4.0]) pen.setDashOffset(5.0) alpha = getattr(shape, 'alpha', 1.0) color = self.__get_color(shape.color, alpha) pen.setColor(color) self.cr.setPen(pen)