void QgsLayoutItemShape::setSymbol( QgsFillSymbol *symbol ) { if ( !symbol ) return; mShapeStyleSymbol.reset( symbol->clone() ); refreshSymbol(); }
void QgsLayoutItemPolyline::createDefaultPolylineStyleSymbol() { QgsStringMap properties; properties.insert( QStringLiteral( "color" ), QStringLiteral( "0,0,0,255" ) ); properties.insert( QStringLiteral( "width" ), QStringLiteral( "0.3" ) ); properties.insert( QStringLiteral( "capstyle" ), QStringLiteral( "square" ) ); mPolylineStyleSymbol.reset( QgsLineSymbol::createSimple( properties ) ); refreshSymbol(); }
QgsLayoutItemShape::QgsLayoutItemShape( QgsLayout *layout ) : QgsLayoutItem( layout ) , mCornerRadius( 0 ) { setBackgroundEnabled( false ); setFrameEnabled( false ); QgsStringMap properties; properties.insert( QStringLiteral( "color" ), QStringLiteral( "white" ) ); properties.insert( QStringLiteral( "style" ), QStringLiteral( "solid" ) ); properties.insert( QStringLiteral( "style_border" ), QStringLiteral( "solid" ) ); properties.insert( QStringLiteral( "color_border" ), QStringLiteral( "black" ) ); properties.insert( QStringLiteral( "width_border" ), QStringLiteral( "0.3" ) ); properties.insert( QStringLiteral( "joinstyle" ), QStringLiteral( "miter" ) ); mShapeStyleSymbol.reset( QgsFillSymbol::createSimple( properties ) ); refreshSymbol(); connect( this, &QgsLayoutItemShape::sizePositionChanged, this, [ = ] { updateBoundingRect(); update(); } ); }
void QgsComposerShape::setShapeStyleSymbol( QgsFillSymbolV2* symbol ) { delete mShapeStyleSymbol; mShapeStyleSymbol = static_cast<QgsFillSymbolV2*>( symbol->clone() ); refreshSymbol(); }
void QgsComposerShape::setShapeStyleSymbol( QgsFillSymbolV2* symbol ) { delete mShapeStyleSymbol; mShapeStyleSymbol = symbol; refreshSymbol(); }
void QgsLayoutItemPolyline::setSymbol( QgsLineSymbol *symbol ) { mPolylineStyleSymbol.reset( static_cast<QgsLineSymbol *>( symbol->clone() ) ); refreshSymbol(); }