Skip to content

Commit 7fb8de9

Browse files
authored
Merge pull request #6242 from nyalldawson/black
Default to a dark gray instead of black for symbol outlines
2 parents 5b9be7a + 16e98f2 commit 7fb8de9

27 files changed

+69
-31
lines changed

src/core/symbology/qgsellipsesymbollayer.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
QgsEllipseSymbolLayer::QgsEllipseSymbolLayer()
3131
: mSymbolName( QStringLiteral( "circle" ) )
32-
, mStrokeColor( Qt::black )
32+
, mStrokeColor( QColor( 70, 70, 70 ) )
3333
{
3434
mColor = Qt::white;
3535
mPen.setColor( mStrokeColor );

src/core/symbology/qgsfillsymbollayer.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1712,7 +1712,7 @@ QgsSVGFillSymbolLayer::QgsSVGFillSymbolLayer( const QString &svgFilePath, double
17121712
mStrokeWidth = 0.3;
17131713
mAngle = angle;
17141714
mColor = QColor( 255, 255, 255 );
1715-
mSvgStrokeColor = QColor( 0, 0, 0 );
1715+
mSvgStrokeColor = QColor( 70, 70, 70 );
17161716
mSvgStrokeWidth = 0.2;
17171717
setDefaultSvgParams();
17181718
mSvgPattern = nullptr;
@@ -1729,7 +1729,7 @@ QgsSVGFillSymbolLayer::QgsSVGFillSymbolLayer( const QByteArray &svgData, double
17291729
mStrokeWidth = 0.3;
17301730
mAngle = angle;
17311731
mColor = QColor( 255, 255, 255 );
1732-
mSvgStrokeColor = QColor( 0, 0, 0 );
1732+
mSvgStrokeColor = QColor( 70, 70, 70 );
17331733
mSvgStrokeWidth = 0.2;
17341734
setSubSymbol( new QgsLineSymbol() );
17351735
setDefaultSvgParams();

src/core/symbology/qgsfillsymbollayer.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
#define DEFAULT_SIMPLEFILL_COLOR QColor(0,0,255)
2424
#define DEFAULT_SIMPLEFILL_STYLE Qt::SolidPattern
25-
#define DEFAULT_SIMPLEFILL_BORDERCOLOR QColor(0,0,0)
25+
#define DEFAULT_SIMPLEFILL_BORDERCOLOR QColor( 70, 70, 70 )
2626
#define DEFAULT_SIMPLEFILL_BORDERSTYLE Qt::SolidLine
2727
#define DEFAULT_SIMPLEFILL_BORDERWIDTH DEFAULT_LINE_WIDTH
2828
#define DEFAULT_SIMPLEFILL_JOINSTYLE Qt::BevelJoin

src/core/symbology/qgslinesymbollayer.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
class QgsExpression;
2727

28-
#define DEFAULT_SIMPLELINE_COLOR QColor(0,0,0)
28+
#define DEFAULT_SIMPLELINE_COLOR QColor(70,70,70)
2929
#define DEFAULT_SIMPLELINE_WIDTH DEFAULT_LINE_WIDTH
3030
#define DEFAULT_SIMPLELINE_PENSTYLE Qt::SolidLine
3131
#define DEFAULT_SIMPLELINE_JOINSTYLE Qt::BevelJoin

src/core/symbology/qgsmarkersymbollayer.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1698,8 +1698,8 @@ QgsSvgMarkerSymbolLayer::QgsSvgMarkerSymbolLayer( const QString &path, double si
16981698
mScaleMethod = scaleMethod;
16991699
mStrokeWidth = 0.2;
17001700
mStrokeWidthUnit = QgsUnitTypes::RenderMillimeters;
1701-
mColor = QColor( Qt::black );
1702-
mStrokeColor = QColor( Qt::black );
1701+
mColor = QColor( 70, 70, 70 );
1702+
mStrokeColor = QColor( 70, 70, 70 );
17031703
updateDefaultAspectRatio();
17041704
}
17051705

src/core/symbology/qgsmarkersymbollayer.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
#define DEFAULT_SIMPLEMARKER_NAME "circle"
2525
#define DEFAULT_SIMPLEMARKER_COLOR QColor(255,0,0)
26-
#define DEFAULT_SIMPLEMARKER_BORDERCOLOR QColor(0,0,0)
26+
#define DEFAULT_SIMPLEMARKER_BORDERCOLOR QColor( 70, 70, 70 )
2727
#define DEFAULT_SIMPLEMARKER_JOINSTYLE Qt::BevelJoin
2828
#define DEFAULT_SIMPLEMARKER_SIZE DEFAULT_POINT_SIZE
2929
#define DEFAULT_SIMPLEMARKER_ANGLE 0
@@ -650,7 +650,7 @@ class CORE_EXPORT QgsSvgMarkerSymbolLayer : public QgsMarkerSymbolLayer
650650
#define DEFAULT_FONTMARKER_FONT "Dingbats"
651651
#define DEFAULT_FONTMARKER_CHR QChar('A')
652652
#define DEFAULT_FONTMARKER_SIZE POINT2MM(12)
653-
#define DEFAULT_FONTMARKER_COLOR QColor(Qt::black)
653+
#define DEFAULT_FONTMARKER_COLOR QColor( 70, 70, 70 )
654654
#define DEFAULT_FONTMARKER_BORDERCOLOR QColor(Qt::white)
655655
#define DEFAULT_FONTMARKER_JOINSTYLE Qt::MiterJoin
656656
#define DEFAULT_FONTMARKER_ANGLE 0

tests/src/core/testqgscentroidfillsymbol.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include <qgssymbol.h>
3131
#include <qgssinglesymbolrenderer.h>
3232
#include <qgsfillsymbollayer.h>
33+
#include "qgsmarkersymbollayer.h"
3334

3435
//qgis test includes
3536
#include "qgsrenderchecker.h"
@@ -94,6 +95,7 @@ void TestQgsCentroidFillSymbol::initTestCase()
9495

9596
//setup gradient fill
9697
mCentroidFill = new QgsCentroidFillSymbolLayer();
98+
static_cast< QgsSimpleMarkerSymbolLayer * >( mCentroidFill->subSymbol()->symbolLayer( 0 ) )->setStrokeColor( Qt::black );
9799
mFillSymbol = new QgsFillSymbol();
98100
mFillSymbol->changeSymbolLayer( 0, mCentroidFill );
99101
mSymbolRenderer = new QgsSingleSymbolRenderer( mFillSymbol );

tests/src/core/testqgslayertree.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ void TestQgsLayerTree::testLegendSymbolCategorized()
381381
renderer->setSourceSymbol( QgsSymbol::defaultSymbol( QgsWkbTypes::PointGeometry ) );
382382
QgsStringMap props;
383383
props.insert( QStringLiteral( "color" ), QStringLiteral( "#ff0000" ) );
384+
props.insert( QStringLiteral( "outline_color" ), QStringLiteral( "#000000" ) );
384385
renderer->addCategory( QgsRendererCategory( "a", QgsMarkerSymbol::createSimple( props ), QStringLiteral( "a" ) ) );
385386
props.insert( QStringLiteral( "color" ), QStringLiteral( "#00ff00" ) );
386387
renderer->addCategory( QgsRendererCategory( "b", QgsMarkerSymbol::createSimple( props ), QStringLiteral( "b" ) ) );
@@ -397,6 +398,7 @@ void TestQgsLayerTree::testLegendSymbolGraduated()
397398
renderer->setSourceSymbol( QgsSymbol::defaultSymbol( QgsWkbTypes::PointGeometry ) );
398399
QgsStringMap props;
399400
props.insert( QStringLiteral( "color" ), QStringLiteral( "#ff0000" ) );
401+
props.insert( QStringLiteral( "outline_color" ), QStringLiteral( "#000000" ) );
400402
renderer->addClass( QgsRendererRange( 1, 2, QgsMarkerSymbol::createSimple( props ), QStringLiteral( "a" ) ) );
401403
props.insert( QStringLiteral( "color" ), QStringLiteral( "#00ff00" ) );
402404
renderer->addClass( QgsRendererRange( 2, 3, QgsMarkerSymbol::createSimple( props ), QStringLiteral( "b" ) ) );
@@ -411,6 +413,7 @@ void TestQgsLayerTree::testLegendSymbolRuleBased()
411413
QgsRuleBasedRenderer::Rule *root = new QgsRuleBasedRenderer::Rule( nullptr );
412414
QgsStringMap props;
413415
props.insert( QStringLiteral( "color" ), QStringLiteral( "#ff0000" ) );
416+
props.insert( QStringLiteral( "outline_color" ), QStringLiteral( "#000000" ) );
414417
root->appendChild( new QgsRuleBasedRenderer::Rule( QgsMarkerSymbol::createSimple( props ), 0, 0, QStringLiteral( "\"col1\"=1" ) ) );
415418
props.insert( QStringLiteral( "color" ), QStringLiteral( "#00ff00" ) );
416419
root->appendChild( new QgsRuleBasedRenderer::Rule( QgsMarkerSymbol::createSimple( props ), 0, 0, QStringLiteral( "\"col1\"=2" ) ) );
@@ -509,6 +512,7 @@ void TestQgsLayerTree::testRendererLegend( QgsFeatureRenderer *renderer )
509512
//another test - check directly setting symbol at renderer
510513
QgsStringMap props;
511514
props.insert( QStringLiteral( "color" ), QStringLiteral( "#00ffff" ) );
515+
props.insert( QStringLiteral( "outline_color" ), QStringLiteral( "#000000" ) );
512516
renderer->setLegendSymbolItem( symbolList.at( 2 ).ruleKey(), QgsMarkerSymbol::createSimple( props ) );
513517
m->refreshLayerLegend( n );
514518
symbolNode = dynamic_cast< QgsSymbolLegendNode * >( m->findLegendNode( vl->id(), symbolList.at( 2 ).ruleKey() ) );

tests/src/core/testqgslayoutatlas.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ void TestQgsLayoutAtlas::init()
130130
// fix the renderer, fill with green
131131
QgsStringMap props;
132132
props.insert( QStringLiteral( "color" ), QStringLiteral( "0,127,0" ) );
133+
props.insert( QStringLiteral( "outline_color" ), QStringLiteral( "0,0,0" ) );
133134
QgsFillSymbol *fillSymbol = QgsFillSymbol::createSimple( props );
134135
QgsSingleSymbolRenderer *renderer = new QgsSingleSymbolRenderer( fillSymbol );
135136
mVectorLayer->setRenderer( renderer );
@@ -157,6 +158,7 @@ void TestQgsLayoutAtlas::init()
157158
// set the fill symbol of the overview map
158159
QgsStringMap props2;
159160
props2.insert( QStringLiteral( "color" ), QStringLiteral( "127,0,0,127" ) );
161+
props2.insert( QStringLiteral( "outline_color" ), QStringLiteral( "0,0,0" ) );
160162
QgsFillSymbol *fillSymbol2 = QgsFillSymbol::createSimple( props2 );
161163
mOverview->overview()->setFrameSymbol( fillSymbol2 );
162164

tests/src/core/testqgslayoutitem.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -1877,6 +1877,7 @@ void TestQgsLayoutItem::blendMode()
18771877
QgsFillSymbol *fillSymbol = new QgsFillSymbol();
18781878
fillSymbol->changeSymbolLayer( 0, simpleFill );
18791879
simpleFill->setColor( QColor( 255, 150, 0 ) );
1880+
simpleFill->setStrokeColor( Qt::black );
18801881
mComposerRect1->setSymbol( fillSymbol );
18811882
delete fillSymbol;
18821883

@@ -1889,6 +1890,7 @@ void TestQgsLayoutItem::blendMode()
18891890
QgsFillSymbol *fillSymbol2 = new QgsFillSymbol();
18901891
fillSymbol2->changeSymbolLayer( 0, simpleFill2 );
18911892
simpleFill2->setColor( QColor( 0, 100, 150 ) );
1893+
simpleFill2->setStrokeColor( Qt::black );
18921894
mComposerRect2->setSymbol( fillSymbol2 );
18931895
delete fillSymbol2;
18941896

@@ -1926,6 +1928,7 @@ void TestQgsLayoutItem::opacity()
19261928
QgsFillSymbol *fillSymbol = new QgsFillSymbol();
19271929
fillSymbol->changeSymbolLayer( 0, simpleFill );
19281930
simpleFill->setColor( QColor( 255, 150, 0 ) );
1931+
simpleFill->setStrokeColor( Qt::black );
19291932
mComposerRect1->setSymbol( fillSymbol );
19301933
delete fillSymbol;
19311934

@@ -1938,6 +1941,7 @@ void TestQgsLayoutItem::opacity()
19381941
QgsFillSymbol *fillSymbol2 = new QgsFillSymbol();
19391942
fillSymbol2->changeSymbolLayer( 0, simpleFill2 );
19401943
simpleFill2->setColor( QColor( 0, 100, 150 ) );
1944+
simpleFill2->setStrokeColor( Qt::black );
19411945
mComposerRect2->setSymbol( fillSymbol2 );
19421946
delete fillSymbol2;
19431947

tests/src/core/testqgslayoutmapgrid.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "qgsmultirenderchecker.h"
2121
#include "qgslayoutitemmap.h"
2222
#include "qgslayoutitemmapgrid.h"
23+
#include "qgsmarkersymbollayer.h"
2324
#include "qgsfontutils.h"
2425
#include "qgsproject.h"
2526
#include <QObject>
@@ -233,6 +234,7 @@ void TestQgsLayoutMapGrid::markerGrid()
233234
map->grid()->setIntervalY( 2000 );
234235
map->grid()->setGridLineWidth( 0.5 );
235236
map->grid()->setGridLineColor( QColor( 0, 0, 0 ) );
237+
static_cast< QgsSimpleMarkerSymbolLayer * >( map->grid()->markerSymbol()->symbolLayer( 0 ) )->setStrokeColor( Qt::black );
236238
map->updateBoundingRect();
237239
l.addLayoutItem( map );
238240

tests/src/core/testqgslayoutpage.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "qgssinglesymbolrenderer.h"
2525
#include "qgsfillsymbollayer.h"
2626
#include "qgslinesymbollayer.h"
27+
#include "qgsmarkersymbollayer.h"
2728
#include "qgsmultirenderchecker.h"
2829
#include "qgslayoutpagecollection.h"
2930
#include <QObject>
@@ -234,6 +235,7 @@ void TestQgsLayoutPage::markerLinePaper()
234235
l.pageCollection()->addPage( page.release() );
235236

236237
QgsMarkerLineSymbolLayer *markerLine = new QgsMarkerLineSymbolLayer();
238+
static_cast< QgsSimpleMarkerSymbolLayer * >( markerLine->subSymbol()->symbolLayer( 0 ) )->setStrokeColor( Qt::black );
237239
std::unique_ptr< QgsFillSymbol > markerLineSymbol = qgis::make_unique< QgsFillSymbol >();
238240
markerLineSymbol->changeSymbolLayer( 0, markerLine );
239241
l.pageCollection()->setPageStyleSymbol( markerLineSymbol.get() );

tests/src/core/testqgslayoutshapes.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ void TestQgsLayoutShapes::shapeRotation()
303303
QgsFillSymbol *fillSymbol = new QgsFillSymbol();
304304
fillSymbol->changeSymbolLayer( 0, simpleFill );
305305
simpleFill->setColor( QColor( 255, 150, 0 ) );
306+
simpleFill->setStrokeColor( Qt::black );
306307
//simpleFill->setStrokeColor( Qt::yellow );
307308
//simpleFill->setStrokeWidth( 6 );
308309
shape->setSymbol( fillSymbol );

tests/src/core/testqgspointpatternfillsymbol.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ void TestQgsPointPatternFillSymbol::pointPatternFillSymbol()
133133

134134
QgsStringMap properties;
135135
properties.insert( QStringLiteral( "color" ), QStringLiteral( "0,0,0,255" ) );
136+
properties.insert( QStringLiteral( "outline_color" ), QStringLiteral( "#000000" ) );
136137
properties.insert( QStringLiteral( "name" ), QStringLiteral( "circle" ) );
137138
properties.insert( QStringLiteral( "size" ), QStringLiteral( "5.0" ) );
138139
QgsMarkerSymbol *pointSymbol = QgsMarkerSymbol::createSimple( properties );
@@ -147,6 +148,7 @@ void TestQgsPointPatternFillSymbol::dataDefinedSubSymbol()
147148

148149
QgsStringMap properties;
149150
properties.insert( QStringLiteral( "color" ), QStringLiteral( "0,0,0,255" ) );
151+
properties.insert( QStringLiteral( "outline_color" ), QStringLiteral( "#000000" ) );
150152
properties.insert( QStringLiteral( "name" ), QStringLiteral( "circle" ) );
151153
properties.insert( QStringLiteral( "size" ), QStringLiteral( "5.0" ) );
152154
QgsMarkerSymbol *pointSymbol = QgsMarkerSymbol::createSimple( properties );

tests/src/core/testqgssymbol.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "qgslinesymbollayer.h"
3131
#include "qgsfillsymbollayer.h"
3232
#include "qgssinglesymbolrenderer.h"
33+
#include "qgsmarkersymbollayer.h"
3334

3435
#include "qgsstyle.h"
3536

@@ -177,6 +178,7 @@ void TestQgsSymbol::testCanvasClip()
177178

178179
QgsMarkerLineSymbolLayer *markerLine = new QgsMarkerLineSymbolLayer();
179180
markerLine->setPlacement( QgsMarkerLineSymbolLayer:: CentralPoint );
181+
static_cast< QgsSimpleMarkerSymbolLayer *>( markerLine->subSymbol()->symbolLayer( 0 ) )->setStrokeColor( Qt::black );
180182
QgsLineSymbol *lineSymbol = new QgsLineSymbol();
181183
lineSymbol->changeSymbolLayer( 0, markerLine );
182184
QgsSingleSymbolRenderer *renderer = new QgsSingleSymbolRenderer( lineSymbol );
@@ -196,6 +198,7 @@ void TestQgsSymbol::testCanvasClip()
196198
ms.setLayers( QList<QgsMapLayer *>() << mpPolysLayer );
197199

198200
QgsCentroidFillSymbolLayer *centroidFill = new QgsCentroidFillSymbolLayer();
201+
static_cast< QgsSimpleMarkerSymbolLayer * >( centroidFill->subSymbol()->symbolLayer( 0 ) )->setStrokeColor( Qt::black );
199202
QgsFillSymbol *fillSymbol = new QgsFillSymbol();
200203
fillSymbol->changeSymbolLayer( 0, centroidFill );
201204
renderer = new QgsSingleSymbolRenderer( fillSymbol );

tests/src/python/test_qgsannotation.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ def tearDown(self):
5555
def testTextAnnotation(self):
5656
""" test rendering a text annotation"""
5757
a = QgsTextAnnotation()
58+
a.fillSymbol().symbolLayer(0).setStrokeColor(QColor(0, 0, 0))
59+
a.markerSymbol().symbolLayer(0).setStrokeColor(QColor(0, 0, 0))
5860
a.setFrameSize(QSizeF(300, 200))
5961
a.setFrameOffsetFromReferencePoint(QPointF(40, 50))
6062
doc = QTextDocument()
@@ -71,6 +73,8 @@ def testTextAnnotation(self):
7173
def testSvgAnnotation(self):
7274
""" test rendering a svg annotation"""
7375
a = QgsSvgAnnotation()
76+
a.fillSymbol().symbolLayer(0).setStrokeColor(QColor(0, 0, 0))
77+
a.markerSymbol().symbolLayer(0).setStrokeColor(QColor(0, 0, 0))
7478
a.setFrameSize(QSizeF(300, 200))
7579
a.setFrameOffsetFromReferencePoint(QPointF(40, 50))
7680
svg = TEST_DATA_DIR + "/sample_svg.svg"
@@ -86,6 +90,8 @@ def testSvgAnnotation(self):
8690
def testHtmlAnnotation(self):
8791
""" test rendering a html annotation"""
8892
a = QgsHtmlAnnotation()
93+
a.fillSymbol().symbolLayer(0).setStrokeColor(QColor(0, 0, 0))
94+
a.markerSymbol().symbolLayer(0).setStrokeColor(QColor(0, 0, 0))
8995
a.setFrameSize(QSizeF(400, 250))
9096
a.setFrameOffsetFromReferencePoint(QPointF(70, 90))
9197
html = TEST_DATA_DIR + "/test_html.html"
@@ -104,6 +110,8 @@ def testHtmlAnnotationWithFeature(self):
104110
'test', "memory")
105111

106112
a = QgsHtmlAnnotation()
113+
a.fillSymbol().symbolLayer(0).setStrokeColor(QColor(0, 0, 0))
114+
a.markerSymbol().symbolLayer(0).setStrokeColor(QColor(0, 0, 0))
107115
a.setFrameSize(QSizeF(400, 250))
108116
a.setFrameOffsetFromReferencePoint(QPointF(70, 90))
109117
a.setMapLayer(layer)
@@ -121,6 +129,7 @@ def testHtmlAnnotationWithFeature(self):
121129
def testRelativePosition(self):
122130
""" test rendering an annotation without map point"""
123131
a = QgsHtmlAnnotation()
132+
a.fillSymbol().symbolLayer(0).setStrokeColor(QColor(0, 0, 0))
124133
a.setFrameSize(QSizeF(400, 250))
125134
a.setHasFixedMapPosition(False)
126135
html = TEST_DATA_DIR + "/test_html.html"
@@ -131,6 +140,7 @@ def testRelativePosition(self):
131140
def testMargins(self):
132141
""" test rendering an annotation with margins"""
133142
a = QgsHtmlAnnotation()
143+
a.fillSymbol().symbolLayer(0).setStrokeColor(QColor(0, 0, 0))
134144
a.setFrameSize(QSizeF(400, 250))
135145
a.setHasFixedMapPosition(False)
136146
a.setContentsMargin(QgsMargins(15, 10, 30, 20))
@@ -144,7 +154,7 @@ def testFillSymbol(self):
144154
a = QgsTextAnnotation()
145155
a.setFrameSize(QSizeF(400, 250))
146156
a.setHasFixedMapPosition(False)
147-
a.setFillSymbol(QgsFillSymbol.createSimple({'color': 'blue', 'width_border': '5'}))
157+
a.setFillSymbol(QgsFillSymbol.createSimple({'color': 'blue', 'width_border': '5', 'outline_color': 'black'}))
148158
im = self.renderAnnotation(a, QPointF(20, 30))
149159
self.assertTrue(self.imageCheck('annotation_fillstyle', 'annotation_fillstyle', im))
150160

tests/src/python/test_qgsfillsymbollayers.py

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def testSimpleLineWithOffset(self):
5858
""" test that rendering a polygon with simple line symbol with offset results in closed line"""
5959
layer = QgsSimpleLineSymbolLayer()
6060
layer.setOffset(-1)
61+
layer.setColor(QColor(0, 0, 0))
6162

6263
symbol = QgsFillSymbol()
6364
symbol.changeSymbolLayer(0, layer)

tests/src/python/test_qgsgeometrygeneratorsymbollayer.py

+10-7
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import os
2929

3030
from qgis.PyQt.QtCore import QSize
31-
31+
from qgis.PyQt.QtGui import QColor
3232
from qgis.core import (
3333
QgsVectorLayer,
3434
QgsSingleSymbolRenderer,
@@ -68,9 +68,9 @@ def setUp(self):
6868
QgsProject.instance().addMapLayer(self.points_layer)
6969

7070
# Create style
71-
sym1 = QgsFillSymbol.createSimple({'color': '#fdbf6f'})
71+
sym1 = QgsFillSymbol.createSimple({'color': '#fdbf6f', 'outline_color': 'black'})
7272
sym2 = QgsLineSymbol.createSimple({'color': '#fdbf6f'})
73-
sym3 = QgsMarkerSymbol.createSimple({'color': '#fdbf6f'})
73+
sym3 = QgsMarkerSymbol.createSimple({'color': '#fdbf6f', 'outline_color': 'black'})
7474

7575
self.polys_layer.setRenderer(QgsSingleSymbolRenderer(sym1))
7676
self.lines_layer.setRenderer(QgsSingleSymbolRenderer(sym2))
@@ -88,6 +88,7 @@ def test_marker(self):
8888
sym = self.polys_layer.renderer().symbol()
8989
sym_layer = QgsGeometryGeneratorSymbolLayer.create({'geometryModifier': 'centroid($geometry)'})
9090
sym_layer.setSymbolType(QgsSymbol.Marker)
91+
sym_layer.subSymbol().symbolLayer(0).setStrokeColor(QColor(0, 0, 0))
9192
sym.changeSymbolLayer(0, sym_layer)
9293

9394
rendered_layers = [self.polys_layer]
@@ -101,12 +102,14 @@ def test_marker(self):
101102
def test_mixed(self):
102103
sym = self.polys_layer.renderer().symbol()
103104

104-
buffer_layer = QgsGeometryGeneratorSymbolLayer.create({'geometryModifier': 'buffer($geometry, "value"/15)'})
105+
buffer_layer = QgsGeometryGeneratorSymbolLayer.create({'geometryModifier': 'buffer($geometry, "value"/15)', 'outline_color': 'black'})
105106
buffer_layer.setSymbolType(QgsSymbol.Fill)
107+
buffer_layer.subSymbol().symbolLayer(0).setStrokeColor(QColor(0, 0, 0))
106108
self.assertIsNotNone(buffer_layer.subSymbol())
107109
sym.appendSymbolLayer(buffer_layer)
108-
marker_layer = QgsGeometryGeneratorSymbolLayer.create({'geometryModifier': 'centroid($geometry)'})
110+
marker_layer = QgsGeometryGeneratorSymbolLayer.create({'geometryModifier': 'centroid($geometry)', 'outline_color': 'black'})
109111
marker_layer.setSymbolType(QgsSymbol.Marker)
112+
marker_layer.subSymbol().symbolLayer(0).setStrokeColor(QColor(0, 0, 0))
110113
sym.appendSymbolLayer(marker_layer)
111114

112115
rendered_layers = [self.polys_layer]
@@ -120,7 +123,7 @@ def test_mixed(self):
120123
def test_buffer_lines(self):
121124
sym = self.lines_layer.renderer().symbol()
122125

123-
buffer_layer = QgsGeometryGeneratorSymbolLayer.create({'geometryModifier': 'buffer($geometry, "value"/15)'})
126+
buffer_layer = QgsGeometryGeneratorSymbolLayer.create({'geometryModifier': 'buffer($geometry, "value"/15)', 'outline_color': 'black'})
124127
buffer_layer.setSymbolType(QgsSymbol.Fill)
125128
self.assertIsNotNone(buffer_layer.subSymbol())
126129
sym.appendSymbolLayer(buffer_layer)
@@ -136,7 +139,7 @@ def test_buffer_lines(self):
136139
def test_buffer_points(self):
137140
sym = self.points_layer.renderer().symbol()
138141

139-
buffer_layer = QgsGeometryGeneratorSymbolLayer.create({'geometryModifier': 'buffer($geometry, "staff"/15)'})
142+
buffer_layer = QgsGeometryGeneratorSymbolLayer.create({'geometryModifier': 'buffer($geometry, "staff"/15)', 'outline_color': 'black'})
140143
buffer_layer.setSymbolType(QgsSymbol.Fill)
141144
self.assertIsNotNone(buffer_layer.subSymbol())
142145
sym.appendSymbolLayer(buffer_layer)

0 commit comments

Comments
 (0)