Skip to content

Commit c5b04ef

Browse files
committedMay 19, 2015
Fix attributes from some symbols were not available for data defined
symbology (line marker, line pattern)
1 parent bbb1c4a commit c5b04ef

File tree

6 files changed

+24
-0
lines changed

6 files changed

+24
-0
lines changed
 

‎python/core/symbology-ng/qgsfillsymbollayerv2.sip

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,8 @@ class QgsLinePatternFillSymbolLayer: QgsImageFillSymbolLayer
759759
bool setSubSymbol( QgsSymbolV2* symbol );
760760
QgsSymbolV2* subSymbol();
761761

762+
QSet<QString> usedAttributes() const;
763+
762764
};
763765

764766
class QgsPointPatternFillSymbolLayer : QgsImageFillSymbolLayer

‎python/core/symbology-ng/qgslinesymbollayerv2.sip

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ class QgsMarkerLineSymbolLayerV2 : QgsLineSymbolLayerV2
207207
void setMapUnitScale( const QgsMapUnitScale& scale );
208208
QgsMapUnitScale mapUnitScale() const;
209209

210+
QSet<QString> usedAttributes() const;
211+
210212
protected:
211213

212214
void renderPolylineInterval( const QPolygonF& points, QgsSymbolV2RenderContext& context );

‎src/core/symbology-ng/qgsfillsymbollayerv2.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2284,6 +2284,14 @@ QgsSymbolV2* QgsLinePatternFillSymbolLayer::subSymbol()
22842284
return mFillLineSymbol;
22852285
}
22862286

2287+
QSet<QString> QgsLinePatternFillSymbolLayer::usedAttributes() const
2288+
{
2289+
QSet<QString> attr = QgsFillSymbolLayerV2::usedAttributes();
2290+
if ( mFillLineSymbol )
2291+
attr.unite( mFillLineSymbol->usedAttributes() );
2292+
return attr;
2293+
}
2294+
22872295
double QgsLinePatternFillSymbolLayer::estimateMaxBleed() const
22882296
{
22892297
return 0;

‎src/core/symbology-ng/qgsfillsymbollayerv2.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -925,6 +925,8 @@ class CORE_EXPORT QgsLinePatternFillSymbolLayer: public QgsImageFillSymbolLayer
925925
bool setSubSymbol( QgsSymbolV2* symbol ) override;
926926
QgsSymbolV2* subSymbol() override;
927927

928+
QSet<QString> usedAttributes() const override;
929+
928930
protected:
929931
/**Distance (in mm or map units) between lines*/
930932
double mDistance;

‎src/core/symbology-ng/qgslinesymbollayerv2.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,6 +1469,14 @@ QgsMapUnitScale QgsMarkerLineSymbolLayerV2::mapUnitScale() const
14691469
return QgsMapUnitScale();
14701470
}
14711471

1472+
QSet<QString> QgsMarkerLineSymbolLayerV2::usedAttributes() const
1473+
{
1474+
QSet<QString> attr = QgsLineSymbolLayerV2::usedAttributes();
1475+
if ( mMarker )
1476+
attr.unite( mMarker->usedAttributes() );
1477+
return attr;
1478+
}
1479+
14721480
double QgsMarkerLineSymbolLayerV2::estimateMaxBleed() const
14731481
{
14741482
return ( mMarker->size() / 2.0 ) + mOffset;

‎src/core/symbology-ng/qgslinesymbollayerv2.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,8 @@ class CORE_EXPORT QgsMarkerLineSymbolLayerV2 : public QgsLineSymbolLayerV2
256256
void setMapUnitScale( const QgsMapUnitScale& scale ) override;
257257
QgsMapUnitScale mapUnitScale() const override;
258258

259+
QSet<QString> usedAttributes() const override;
260+
259261
protected:
260262

261263
void renderPolylineInterval( const QPolygonF& points, QgsSymbolV2RenderContext& context );

0 commit comments

Comments
 (0)
Please sign in to comment.