diff --git a/sources/qetxml.cpp b/sources/qetxml.cpp index 2d26c2f0f..3440f5ea7 100644 --- a/sources/qetxml.cpp +++ b/sources/qetxml.cpp @@ -39,6 +39,7 @@ QDomElement QETXML::penToXml(QDomDocument &parent_document,QPen pen) case Qt::DotLine : style = "DotLine"; break; case Qt::DashDotLine : style = "DashDotLine"; break; case Qt::DashDotDotLine : style = "DashDotDotLine"; break; + case Qt::CustomDashLine : style = "CustomDashLine"; break; default : style = "Unknow"; break; } @@ -71,6 +72,8 @@ QPen QETXML::penFromXml(const QDomElement &element) else if (style == "DotLine") pen.setStyle(Qt::DotLine); else if (style == "DashDotLine") pen.setStyle(Qt::DashDotLine); else if (style == "DashDotDotLine") pen.setStyle(Qt::DashDotDotLine); + else if (style == "CustomDashLine") pen.setStyle(Qt::CustomDashLine), + pen.setDashPattern( QVector() << 10 << 10 ); else pen.setStyle(Qt::DashLine); pen.setColor(QColor(element.attribute("color", "#000000"))); diff --git a/sources/ui/shapegraphicsitempropertieswidget.cpp b/sources/ui/shapegraphicsitempropertieswidget.cpp index 86c081589..d0e6a3a63 100644 --- a/sources/ui/shapegraphicsitempropertieswidget.cpp +++ b/sources/ui/shapegraphicsitempropertieswidget.cpp @@ -109,6 +109,12 @@ QUndoCommand* ShapeGraphicsItemPropertiesWidget::associatedUndo() const new_pen.setStyle(Qt::PenStyle(ui->m_style_cb->currentIndex() + 1)); new_pen.setWidthF(ui->m_size_dsb->value()); + + if (ui->m_style_cb->currentIndex() ==5) { + new_pen.setDashPattern( QVector() << 10 << 10 ); + new_pen.setStyle( Qt::CustomDashLine ); + } + //painter.setPen( new_pen ); new_pen.setColor(ui->m_color_pb->palette().color(QPalette::Button)); if (new_pen != old_pen) diff --git a/sources/ui/shapegraphicsitempropertieswidget.ui b/sources/ui/shapegraphicsitempropertieswidget.ui index a580ba3cb..bbfcfd40c 100644 --- a/sources/ui/shapegraphicsitempropertieswidget.ui +++ b/sources/ui/shapegraphicsitempropertieswidget.ui @@ -7,7 +7,7 @@ 0 0 261 - 293 + 346 @@ -54,6 +54,11 @@ Traits points points + + + Tiret custom + +