Skip to content
Permalink
Browse files

Centroid fill test

(cherry picked from commit 6ef01f5)
  • Loading branch information
nyalldawson committed Nov 20, 2020
1 parent d4bf8ce commit 4d956a5842f9892d1393e5a7a3461c6b546124fb
@@ -59,6 +59,7 @@ class TestQgsCentroidFillSymbol : public QObject
void centroidFillClipOnCurrentPartOnly();
void centroidFillClipOnCurrentPartOnlyBiggest();
void centroidFillClipMultiplayerPoints();
void opacityWithDataDefinedColor();

private:
bool mTestHasError = false ;
@@ -199,6 +200,22 @@ void TestQgsCentroidFillSymbol::centroidFillClipMultiplayerPoints()
mFillSymbol->changeSymbolLayer( 0, mCentroidFill );
}


void TestQgsCentroidFillSymbol::opacityWithDataDefinedColor()
{
QgsSimpleFillSymbolLayer simpleFill( QColor( 255, 255, 255, 100 ) );

mCentroidFill->subSymbol()->symbolLayer( 0 )->setDataDefinedProperty( QgsSymbolLayer::PropertyFillColor, QgsProperty::fromExpression( QStringLiteral( "if(Name='Dam', 'red', 'green')" ) ) );
mCentroidFill->subSymbol()->symbolLayer( 0 )->setDataDefinedProperty( QgsSymbolLayer::PropertyStrokeColor, QgsProperty::fromExpression( QStringLiteral( "if(Name='Dam', 'blue', 'magenta')" ) ) );
dynamic_cast< QgsSimpleMarkerSymbolLayer * >( mCentroidFill->subSymbol()->symbolLayer( 0 ) )->setStrokeWidth( 0.5 );
dynamic_cast< QgsSimpleMarkerSymbolLayer * >( mCentroidFill->subSymbol()->symbolLayer( 0 ) )->setSize( 5 );
mCentroidFill->subSymbol()->setOpacity( 0.5 );
mFillSymbol->setOpacity( 0.5 );

QVERIFY( imageCheck( "symbol_centroidfill_opacityddcolor" ) );
}


//
// Private helper functions not called directly by CTest
//
Binary file not shown.

0 comments on commit 4d956a5

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