Skip to content
Permalink
Browse files
fix SVG selector widget not reacting to changes (#43805)
* fix SVG selector widget not reacting to changes

fixes #43802

* also set picture mode
  • Loading branch information
3nids committed Jun 22, 2021
2 parents 18b6021 + f24471d commit 17b421aeccb33f01e1f239e15012e889ea344a8a
Showing with 5 additions and 2 deletions.
  1. +3 −2 src/gui/layout/qgslayoutpicturewidget.cpp
  2. +2 −0 src/gui/symbology/qgssvgselectorwidget.cpp
@@ -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 );
@@ -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, mRadioSVG->isChecked() ? QgsLayoutItemPicture::FormatSVG : QgsLayoutItemPicture::FormatRaster );
mPicture->update();
mPicture->endCommand();
updateSvgParamGui();
@@ -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 )

0 comments on commit 17b421a

Please sign in to comment.