Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Avoid some unnecessary styleChanged signals
These signals are expensive to emit, because they trigger a full
update of the style dock contents
  • Loading branch information
nyalldawson committed Oct 22, 2018
1 parent 65884db commit 844eada
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/qgsmaplayer.cpp
Expand Up @@ -207,8 +207,11 @@ QgsRectangle QgsMapLayer::extent() const
return mExtent;
}

void QgsMapLayer::setBlendMode( QPainter::CompositionMode blendMode )
void QgsMapLayer::setBlendMode( const QPainter::CompositionMode blendMode )
{
if ( mBlendMode == blendMode )
return;

mBlendMode = blendMode;
emit blendModeChanged( blendMode );
emit styleChanged();
Expand Down
5 changes: 5 additions & 0 deletions src/core/qgsvectorlayer.cpp
Expand Up @@ -3942,6 +3942,9 @@ QVariant QgsVectorLayer::aggregate( QgsAggregateCalculator::Aggregate aggregate,

void QgsVectorLayer::setFeatureBlendMode( QPainter::CompositionMode featureBlendMode )
{
if ( mFeatureBlendMode == featureBlendMode )
return;

mFeatureBlendMode = featureBlendMode;
emit featureBlendModeChanged( featureBlendMode );
emit styleChanged();
Expand All @@ -3954,6 +3957,8 @@ QPainter::CompositionMode QgsVectorLayer::featureBlendMode() const

void QgsVectorLayer::setOpacity( double opacity )
{
if ( qgsDoubleNear( mLayerOpacity, opacity ) )
return;
mLayerOpacity = opacity;
emit opacityChanged( opacity );
emit styleChanged();
Expand Down

0 comments on commit 844eada

Please sign in to comment.