Skip to content
Permalink
Browse files

Ellipse marker test

  • Loading branch information
nyalldawson committed Nov 17, 2020
1 parent 2ecf58c commit 7fbe92e2cab1bf8f85f0f4cc8600940fca630e30
@@ -60,6 +60,7 @@ class TestQgsEllipseMarkerSymbol : public QObject
void ellipseMarkerSymbolRoundJoin();
void selected();
void bounds();
void opacityWithDataDefinedColor();

private:
bool mTestHasError = false ;
@@ -228,6 +229,26 @@ void TestQgsEllipseMarkerSymbol::bounds()
QVERIFY( result );
}

void TestQgsEllipseMarkerSymbol::opacityWithDataDefinedColor()
{
mEllipseMarkerLayer->setColor( QColor( 200, 200, 200 ) );
mEllipseMarkerLayer->setStrokeColor( QColor( 0, 0, 0 ) );
mEllipseMarkerLayer->setSymbolName( QStringLiteral( "circle" ) );
mEllipseMarkerLayer->setSymbolName( QStringLiteral( "circle" ) );
mEllipseMarkerLayer->setSymbolHeight( 3 );
mEllipseMarkerLayer->setSymbolWidth( 6 );
mEllipseMarkerLayer->setDataDefinedProperty( QgsSymbolLayer::PropertyFillColor, QgsProperty::fromExpression( QStringLiteral( "if(importance > 2, 'red', 'green')" ) ) );
mEllipseMarkerLayer->setDataDefinedProperty( QgsSymbolLayer::PropertyStrokeColor, QgsProperty::fromExpression( QStringLiteral( "if(importance > 2, 'blue', 'magenta')" ) ) );
mEllipseMarkerLayer->setStrokeWidth( 0.5 );
mMarkerSymbol->setOpacity( 0.5 );

bool result = imageCheck( QStringLiteral( "ellipsemarker_opacityddcolor" ) );
mEllipseMarkerLayer->setDataDefinedProperty( QgsSymbolLayer::PropertyFillColor, QgsProperty() );
mEllipseMarkerLayer->setDataDefinedProperty( QgsSymbolLayer::PropertyStrokeColor, QgsProperty() );
mMarkerSymbol->setOpacity( 1.0 );
QVERIFY( result );
}


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

0 comments on commit 7fbe92e

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