Exemple #1
0
QgsComposerShape::QgsComposerShape( qreal x, qreal y, qreal width, qreal height, QgsComposition* composition ): QgsComposerItem( x, y, width, height, composition ),
    mShape( Ellipse ),
    mCornerRadius( 0 )
{
  setSceneRect( QRectF( x, y, width, height ) );
  setFrameEnabled( true );
}
Exemple #2
0
QgsComposerShape::QgsComposerShape( QgsComposition* composition ): QgsComposerItem( composition ),
    mShape( Ellipse ),
    mCornerRadius( 0 ),
    mUseSymbolV2( false ), //default to not using SymbolV2 for shapes, to preserve 2.0 api
    mShapeStyleSymbol( 0 ),
    mMaxSymbolBleed( 0 )
{
  setFrameEnabled( true );
  createDefaultShapeStyleSymbol();
}
Exemple #3
0
QgsComposerShape::QgsComposerShape( qreal x, qreal y, qreal width, qreal height, QgsComposition* composition ):
    QgsComposerItem( x, y, width, height, composition ),
    mShape( Ellipse ),
    mCornerRadius( 0 ),
    mUseSymbolV2( false ), //default to not using SymbolV2 for shapes, to preserve 2.0 api
    mShapeStyleSymbol( 0 ),
    mMaxSymbolBleed( 0 )
{
  setSceneRect( QRectF( x, y, width, height ) );
  setFrameEnabled( true );
  createDefaultShapeStyleSymbol();
}
QgsComposerShape::QgsComposerShape( QgsComposition* composition ): QgsComposerItem( composition ),
    mShape( Ellipse ),
    mCornerRadius( 0 ),
    mUseSymbolV2( false ), //default to not using SymbolV2 for shapes, to preserve 2.0 api
    mShapeStyleSymbol( 0 ),
    mMaxSymbolBleed( 0 )
{
  setFrameEnabled( true );
  createDefaultShapeStyleSymbol();

  if ( mComposition )
  {
    //connect to atlas feature changes
    //to update symbol style (in case of data-defined symbology)
    connect( &mComposition->atlasComposition(), SIGNAL( featureChanged( QgsFeature* ) ), this, SLOT( repaint() ) );
  }
}
Exemple #5
0
QgsComposerShape::QgsComposerShape( QgsComposition *composition )
  : QgsComposerItem( composition )
  , mShape( Ellipse )
  , mCornerRadius( 0 )
  , mUseSymbol( false ) //default to not using symbol for shapes, to preserve 2.0 api
  , mShapeStyleSymbol( nullptr )
  , mMaxSymbolBleed( 0 )
{
  setFrameEnabled( true );
  createDefaultShapeStyleSymbol();

  if ( mComposition )
  {
    //connect to atlas feature changes
    //to update symbol style (in case of data-defined symbology)
    connect( &mComposition->atlasComposition(), &QgsAtlasComposition::featureChanged, this, &QgsComposerItem::repaint );
  }
}
Exemple #6
0
QgsComposerShape::QgsComposerShape( qreal x, qreal y, qreal width, qreal height, QgsComposition* composition )
    : QgsComposerItem( x, y, width, height, composition )
    , mShape( Ellipse )
    , mCornerRadius( 0 )
    , mUseSymbol( false ) //default to not using Symbol for shapes, to preserve 2.0 api
    , mShapeStyleSymbol( nullptr )
    , mMaxSymbolBleed( 0 )
{
    setSceneRect( QRectF( x, y, width, height ) );
    setFrameEnabled( true );
    createDefaultShapeStyleSymbol();

    if ( mComposition )
    {
        //connect to atlas feature changes
        //to update symbol style (in case of data-defined symbology)
        connect( &mComposition->atlasComposition(), SIGNAL( featureChanged( QgsFeature* ) ), this, SLOT( repaint() ) );
    }
}
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();
  } );
}
Exemple #8
0
void QgsComposerShape::setUseSymbolV2( bool useSymbolV2 )
{
  mUseSymbolV2 = useSymbolV2;
  setFrameEnabled( !useSymbolV2 );
}
Exemple #9
0
void QgsComposerShape::setUseSymbol( bool useSymbol )
{
  mUseSymbol = useSymbol;
  setFrameEnabled( !useSymbol );
}
Exemple #10
0
QgsComposerShape::QgsComposerShape( QgsComposition* composition ): QgsComposerItem( composition ), mShape( Ellipse ), mCornerRadius( 0 )
{
  setFrameEnabled( true );
}