Skip to content
Permalink
Browse files

Fix attributes from some symbols were not available for data defined

symbology (line marker, line pattern)
  • Loading branch information
nyalldawson committed May 19, 2015
1 parent 2abdfa0 commit e94a8cc453d031988bdf28fbdb32c38413a807cd
@@ -759,6 +759,8 @@ class QgsLinePatternFillSymbolLayer: QgsImageFillSymbolLayer
bool setSubSymbol( QgsSymbolV2* symbol );
QgsSymbolV2* subSymbol();

QSet<QString> usedAttributes() const;

};

class QgsPointPatternFillSymbolLayer : QgsImageFillSymbolLayer
@@ -207,6 +207,8 @@ class QgsMarkerLineSymbolLayerV2 : QgsLineSymbolLayerV2
void setMapUnitScale( const QgsMapUnitScale& scale );
QgsMapUnitScale mapUnitScale() const;

QSet<QString> usedAttributes() const;

protected:

void renderPolylineInterval( const QPolygonF& points, QgsSymbolV2RenderContext& context );
@@ -2314,6 +2314,14 @@ QgsSymbolV2* QgsLinePatternFillSymbolLayer::subSymbol()
return mFillLineSymbol;
}

QSet<QString> QgsLinePatternFillSymbolLayer::usedAttributes() const
{
QSet<QString> attr = QgsFillSymbolLayerV2::usedAttributes();
if ( mFillLineSymbol )
attr.unite( mFillLineSymbol->usedAttributes() );
return attr;
}

double QgsLinePatternFillSymbolLayer::estimateMaxBleed() const
{
return 0;
@@ -925,6 +925,8 @@ class CORE_EXPORT QgsLinePatternFillSymbolLayer: public QgsImageFillSymbolLayer
bool setSubSymbol( QgsSymbolV2* symbol ) override;
QgsSymbolV2* subSymbol() override;

QSet<QString> usedAttributes() const override;

protected:
/**Distance (in mm or map units) between lines*/
double mDistance;
@@ -1495,6 +1495,14 @@ QgsMapUnitScale QgsMarkerLineSymbolLayerV2::mapUnitScale() const
return QgsMapUnitScale();
}

QSet<QString> QgsMarkerLineSymbolLayerV2::usedAttributes() const
{
QSet<QString> attr = QgsLineSymbolLayerV2::usedAttributes();
if ( mMarker )
attr.unite( mMarker->usedAttributes() );
return attr;
}

double QgsMarkerLineSymbolLayerV2::estimateMaxBleed() const
{
return ( mMarker->size() / 2.0 ) + mOffset;
@@ -256,6 +256,8 @@ class CORE_EXPORT QgsMarkerLineSymbolLayerV2 : public QgsLineSymbolLayerV2
void setMapUnitScale( const QgsMapUnitScale& scale ) override;
QgsMapUnitScale mapUnitScale() const override;

QSet<QString> usedAttributes() const override;

protected:

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

0 comments on commit e94a8cc

Please sign in to comment.
You can’t perform that action at this time.