change_Dash_Line_Spaces

change_dashed_style
thomas_lucky13 2 years ago
parent c6ca99f84b
commit 29377dd3c8
  1. 15
      src/domain/UBGraphicsLineItem.cpp

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

Loading…
Cancel
Save