File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 1414#include < QPainter>
1515#include < QSize>
1616
17+ #include < cmath>
18+
1719QgsSymbolV2::QgsSymbolV2 (SymbolType type, QgsSymbolLayerV2List layers)
1820 : mType(type), mLayers(layers)
1921{
@@ -43,13 +45,17 @@ QgsSymbolV2::~QgsSymbolV2()
4345
4446QgsSymbolV2* QgsSymbolV2::defaultSymbol (QGis::GeometryType geomType)
4547{
48+ QgsSymbolV2* s;
4649 switch (geomType)
4750 {
48- case QGis::Point: return new QgsMarkerSymbolV2 ();
49- case QGis::Line: return new QgsLineSymbolV2 ();
50- case QGis::Polygon: return new QgsFillSymbolV2 ();
51+ case QGis::Point: s = new QgsMarkerSymbolV2 (); break ;
52+ case QGis::Line: s = new QgsLineSymbolV2 (); break ;
53+ case QGis::Polygon: s = new QgsFillSymbolV2 (); break ;
5154 default : QgsDebugMsg (" unknown layer's geometry type" ); return NULL ;
5255 }
56+
57+ s->setColor ( QColor::fromHsv (rand () % 360 , 64 + rand () % 192 , 128 + rand () % 128 ) );
58+ return s;
5359}
5460
5561
You can’t perform that action at this time.
0 commit comments