Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Improve onFeatureAdded and onAttributeValueChanged
  • Loading branch information
lbartoletti committed Apr 30, 2018
1 parent 07caafe commit 68f463e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/core/qgspointlocator.cpp
Expand Up @@ -842,10 +842,11 @@ void QgsPointLocator::onFeatureAdded( QgsFeatureId fid )
if ( !f.hasGeometry() )
return;

std::unique_ptr< QgsFeatureRenderer > renderer( mLayer->renderer() ? mLayer->renderer()->clone() : nullptr );
QgsRenderContext *ctx = nullptr;
if ( mContext )
{
std::unique_ptr< QgsFeatureRenderer > renderer( mLayer->renderer() ? mLayer->renderer()->clone() : nullptr );
QgsRenderContext *ctx = nullptr;

mContext->expressionContext() << QgsExpressionContextUtils::layerScope( mLayer );
ctx = mContext.get();
if ( renderer && ctx )
Expand Down Expand Up @@ -920,8 +921,11 @@ void QgsPointLocator::onAttributeValueChanged( QgsFeatureId fid, int idx, const
{
Q_UNUSED( idx );
Q_UNUSED( value );
onFeatureDeleted( fid );
onFeatureAdded( fid );
if ( mContext )
{
onFeatureDeleted( fid );
onFeatureAdded( fid );
}
}


Expand Down

0 comments on commit 68f463e

Please sign in to comment.