Skip to content

Commit

Permalink
Ellipse marker test
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Nov 17, 2020
1 parent 2ecf58c commit 7fbe92e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/src/core/testqgsellipsemarker.cpp
Expand Up @@ -60,6 +60,7 @@ class TestQgsEllipseMarkerSymbol : public QObject
void ellipseMarkerSymbolRoundJoin();
void selected();
void bounds();
void opacityWithDataDefinedColor();

private:
bool mTestHasError = false ;
Expand Down Expand Up @@ -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
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7fbe92e

Please sign in to comment.