Skip to content
Permalink
Browse files

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 844eada7636c4fefd8a608a7c5103be6240a1c5f
Showing with 9 additions and 1 deletion.
  1. +4 −1 src/core/qgsmaplayer.cpp
  2. +5 −0 src/core/qgsvectorlayer.cpp
@@ -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();
@@ -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();
@@ -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();

0 comments on commit 844eada

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