35
35
// ////
36
36
37
37
QgsSimpleMarkerSymbolLayerV2::QgsSimpleMarkerSymbolLayerV2 ( QString name, QColor color, QColor borderColor, double size, double angle, QgsSymbolV2::ScaleMethod scaleMethod )
38
- : mOutlineWidth( 0 ), mOutlineWidthUnit( QgsSymbolV2::MM )
38
+ : mOutlineStyle( Qt::SolidLine ), mOutlineWidth( 0 ), mOutlineWidthUnit( QgsSymbolV2::MM )
39
39
{
40
40
mName = name;
41
41
mColor = color;
@@ -80,6 +80,10 @@ QgsSymbolLayerV2* QgsSimpleMarkerSymbolLayerV2::create( const QgsStringMap& prop
80
80
if ( props.contains ( " size_unit" ) )
81
81
m->setSizeUnit ( QgsSymbolLayerV2Utils::decodeOutputUnit ( props[" size_unit" ] ) );
82
82
83
+ if ( props.contains ( " outline_style" ) )
84
+ {
85
+ m->setOutlineStyle ( QgsSymbolLayerV2Utils::decodePenStyle ( props[" outline_style" ] ) );
86
+ }
83
87
if ( props.contains ( " outline_width" ) )
84
88
{
85
89
m->setOutlineWidth ( props[" outline_width" ].toDouble () );
@@ -154,6 +158,7 @@ void QgsSimpleMarkerSymbolLayerV2::startRender( QgsSymbolV2RenderContext& contex
154
158
155
159
mBrush = QBrush ( brushColor );
156
160
mPen = QPen ( penColor );
161
+ mPen .setStyle ( mOutlineStyle );
157
162
mPen .setWidthF ( mOutlineWidth * QgsSymbolLayerV2Utils::lineWidthScaleFactor ( context.renderContext (), mOutlineWidthUnit ) );
158
163
159
164
QColor selBrushColor = context.renderContext ().selectionColor ();
@@ -165,6 +170,7 @@ void QgsSimpleMarkerSymbolLayerV2::startRender( QgsSymbolV2RenderContext& contex
165
170
}
166
171
mSelBrush = QBrush ( selBrushColor );
167
172
mSelPen = QPen ( selPenColor );
173
+ mSelPen .setStyle ( mOutlineStyle );
168
174
mSelPen .setWidthF ( mOutlineWidth * QgsSymbolLayerV2Utils::lineWidthScaleFactor ( context.renderContext (), mOutlineWidthUnit ) );
169
175
170
176
bool hasDataDefinedRotation = context.renderHints () & QgsSymbolV2::DataDefinedRotation || dataDefinedProperty ( " angle" );
@@ -567,6 +573,7 @@ QgsStringMap QgsSimpleMarkerSymbolLayerV2::properties() const
567
573
map[" offset" ] = QgsSymbolLayerV2Utils::encodePoint ( mOffset );
568
574
map[" offset_unit" ] = QgsSymbolLayerV2Utils::encodeOutputUnit ( mOffsetUnit );
569
575
map[" scale_method" ] = QgsSymbolLayerV2Utils::encodeScaleMethod ( mScaleMethod );
576
+ map[" outline_style" ] = QgsSymbolLayerV2Utils::encodePenStyle ( mOutlineStyle );
570
577
map[" outline_width" ] = QString::number ( mOutlineWidth );
571
578
map[" outline_width_unit" ] = QgsSymbolLayerV2Utils::encodeOutputUnit ( mOutlineWidthUnit );
572
579
map[" horizontal_anchor_point" ] = QString::number ( mHorizontalAnchorPoint );
@@ -583,6 +590,7 @@ QgsSymbolLayerV2* QgsSimpleMarkerSymbolLayerV2::clone() const
583
590
m->setOffset ( mOffset );
584
591
m->setSizeUnit ( mSizeUnit );
585
592
m->setOffsetUnit ( mOffsetUnit );
593
+ m->setOutlineStyle ( mOutlineStyle );
586
594
m->setOutlineWidth ( mOutlineWidth );
587
595
m->setOutlineWidthUnit ( mOutlineWidthUnit );
588
596
m->setHorizontalAnchorPoint ( mHorizontalAnchorPoint );
0 commit comments