Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix SVG selector widget not reacting to changes
fixes #43802
  • Loading branch information
3nids authored and nyalldawson committed Jun 29, 2021
1 parent 928a170 commit 3bfdd75
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/gui/layout/qgslayoutpicturewidget.cpp
Expand Up @@ -71,7 +71,8 @@ QgsLayoutPictureWidget::QgsLayoutPictureWidget( QgsLayoutItemPicture *picture )
connect( mStrokeWidthSpinBox, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsLayoutPictureWidget::mStrokeWidthSpinBox_valueChanged );
connect( mPictureRotationOffsetSpinBox, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsLayoutPictureWidget::mPictureRotationOffsetSpinBox_valueChanged );
connect( mNorthTypeComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsLayoutPictureWidget::mNorthTypeComboBox_currentIndexChanged );
connect( mSvgSelectorWidget->sourceLineEdit(), &QgsSvgSourceLineEdit::sourceChanged, this, &QgsLayoutPictureWidget::sourceChanged );
connect( mSvgSelectorWidget, &QgsSvgSelectorWidget::svgSelected, this, &QgsLayoutPictureWidget::sourceChanged );

connect( mSvgSelectorWidget, &QgsSvgSelectorWidget::svgParametersChanged, this, &QgsLayoutPictureWidget::setSvgDynamicParameters );
connect( mRadioSVG, &QRadioButton::toggled, this, &QgsLayoutPictureWidget::modeChanged );
connect( mRadioRaster, &QRadioButton::toggled, this, &QgsLayoutPictureWidget::modeChanged );
Expand Down Expand Up @@ -472,7 +473,7 @@ void QgsLayoutPictureWidget::sourceChanged( const QString &source )
if ( mPicture )
{
mPicture->beginCommand( tr( "Change Picture" ) );
mPicture->setPicturePath( source, QgsLayoutItemPicture::FormatSVG );
mPicture->setPicturePath( source );
mPicture->update();
mPicture->endCommand();
updateSvgParamGui();
Expand Down
2 changes: 2 additions & 0 deletions src/gui/symbology/qgssvgselectorwidget.cpp
Expand Up @@ -433,6 +433,8 @@ QgsSvgSelectorWidget::QgsSvgSelectorWidget( QWidget *parent )
if ( selectedRows.count() > 0 )
mParametersModel->removeParameters( selectedRows );
} );

connect( mSourceLineEdit, &QgsPictureSourceLineEditBase::sourceChanged, this, &QgsSvgSelectorWidget::svgSelected );
}

void QgsSvgSelectorWidget::initParametersModel( const QgsExpressionContextGenerator *generator, QgsVectorLayer *layer )
Expand Down

0 comments on commit 3bfdd75

Please sign in to comment.