[TD]Standard Line Styles - Gui components
This commit is contained in:
@@ -500,32 +500,8 @@ void QGISectionLine::paint ( QPainter * painter, const QStyleOptionGraphicsItem
|
||||
|
||||
void QGISectionLine::setTools()
|
||||
{
|
||||
// Use our own style
|
||||
if (m_styleCurrent == Qt::DashDotLine) {
|
||||
QVector<qreal> dashes;
|
||||
// the stroke width is double the one of center lines, but we like to
|
||||
// have the same spacing. thus these values must be half as large
|
||||
qreal space = 2; // in unit r_width
|
||||
qreal dash = 8;
|
||||
// dot must be really small when using CapStyle RoundCap but > 0
|
||||
// for CapStyle FlatCap you would need to set it to 1
|
||||
qreal dot = 0.000001;
|
||||
|
||||
dashes << dot << space << dash << space;
|
||||
|
||||
// TODO for fanciness: calculate the offset so both arrows start with a
|
||||
// dash!
|
||||
|
||||
m_pen.setDashPattern(dashes);
|
||||
|
||||
m_pen.setDashOffset(2);
|
||||
}
|
||||
else {
|
||||
m_pen.setStyle(m_styleCurrent);
|
||||
}
|
||||
m_pen.setWidthF(m_width);
|
||||
m_pen.setColor(m_colCurrent);
|
||||
m_pen.setCapStyle(Qt::RoundCap);
|
||||
m_brush.setStyle(m_brushCurrent);
|
||||
m_brush.setColor(m_colCurrent);
|
||||
|
||||
@@ -541,3 +517,9 @@ void QGISectionLine::setTools()
|
||||
m_symbol1->setDefaultTextColor(m_colCurrent);
|
||||
m_symbol2->setDefaultTextColor(m_colCurrent);
|
||||
}
|
||||
|
||||
|
||||
void QGISectionLine::setLinePen(QPen isoPen)
|
||||
{
|
||||
m_pen = isoPen;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user