|
|
@ -94,11 +94,20 @@ QColor UBGraphicsLineItem::color() const |
|
|
|
void UBGraphicsLineItem::setStyle(const Qt::PenStyle& style) |
|
|
|
void UBGraphicsLineItem::setStyle(const Qt::PenStyle& style) |
|
|
|
{ |
|
|
|
{ |
|
|
|
QPen pen = QPen(color()); |
|
|
|
QPen pen = QPen(color()); |
|
|
|
|
|
|
|
if(style == Qt::PenStyle::DashLine) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
QVector <qreal> dashes; |
|
|
|
|
|
|
|
qreal space = 5; |
|
|
|
|
|
|
|
dashes << 5 << space; |
|
|
|
|
|
|
|
pen.setDashPattern(dashes); |
|
|
|
|
|
|
|
} else |
|
|
|
|
|
|
|
{ |
|
|
|
pen.setStyle(style); |
|
|
|
pen.setStyle(style); |
|
|
|
if (style==Qt::PenStyle::DotLine) |
|
|
|
if (style==Qt::PenStyle::DotLine) |
|
|
|
{ |
|
|
|
{ |
|
|
|
pen.setCapStyle(Qt::PenCapStyle::RoundCap); |
|
|
|
pen.setCapStyle(Qt::PenCapStyle::RoundCap); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
pen.setWidth(mOriginalWidth); |
|
|
|
pen.setWidth(mOriginalWidth); |
|
|
|
QGraphicsLineItem::setPen(pen); |
|
|
|
QGraphicsLineItem::setPen(pen); |
|
|
|
} |
|
|
|
} |
|
|
|