Skip to content
Permalink
Browse files

Ellipse marker test

(cherry picked from commit f3e3a6b)
  • Loading branch information
nyalldawson committed Nov 20, 2020
1 parent 6a631e2 commit 5a2d4cb8f1473ed88e29e7a392e6869bffd9a282
@@ -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 5a2d4cb

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