Basic shape add new CustomDashLine style with

Dash Pattern (<< 10 << 10 );


git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5194 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
scorpio810
2017-12-29 23:13:35 +00:00
parent 46bdb3f849
commit 1137318384
3 changed files with 15 additions and 1 deletions

View File

@@ -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<qreal>() << 10 << 10 );
else pen.setStyle(Qt::DashLine);
pen.setColor(QColor(element.attribute("color", "#000000")));

View File

@@ -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<qreal>() << 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)

View File

@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>261</width>
<height>293</height>
<height>346</height>
</rect>
</property>
<property name="windowTitle">
@@ -54,6 +54,11 @@
<string>Traits points points</string>
</property>
</item>
<item>
<property name="text">
<string>Tiret custom</string>
</property>
</item>
</widget>
</item>
<item row="1" column="1">