Skip to content

Commit b276f4c

Browse files
committed
Fix map item widget properties updating
1 parent 45ffb26 commit b276f4c

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

src/app/layout/qgslayoutmapwidget.cpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,8 @@ QgsLayoutMapWidget::QgsLayoutMapWidget( QgsLayoutItemMap *item )
105105
if ( item )
106106
{
107107
mLabel->setText( tr( "Map %1" ).arg( item->id() ) );
108-
#if 0 //TODO
109-
connect( item, &QgsLayoutObject::itemChanged, this, &QgsLayoutMapWidget::setGuiElementValues );
110-
#endif
108+
connect( item, &QgsLayoutObject::changed, this, &QgsLayoutMapWidget::updateGuiElements );
109+
111110
#if 0 //TODO
112111
QgsAtlasComposition *atlas = atlasComposition();
113112
if ( atlas )
@@ -154,6 +153,8 @@ bool QgsLayoutMapWidget::setNewItem( QgsLayoutItem *item )
154153
mMapItem = qobject_cast< QgsLayoutItemMap * >( item );
155154
mItemPropertiesWidget->setItem( mMapItem );
156155

156+
updateGuiElements();
157+
157158
return true;
158159
}
159160

@@ -603,13 +604,6 @@ void QgsLayoutMapWidget::mYMaxLineEdit_editingFinished()
603604
updateComposerExtentFromGui();
604605
}
605606

606-
void QgsLayoutMapWidget::setGuiElementValues()
607-
{
608-
mScaleLineEdit->blockSignals( true );
609-
updateGuiElements();
610-
mScaleLineEdit->blockSignals( false );
611-
}
612-
613607
void QgsLayoutMapWidget::updateGuiElements()
614608
{
615609
if ( !mMapItem )

src/app/layout/qgslayoutmapwidget.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,14 @@ class QgsLayoutMapWidget: public QgsLayoutItemBaseWidget, private Ui::QgsLayoutM
9191
protected:
9292
bool setNewItem( QgsLayoutItem *item ) override;
9393

94-
//! Sets the current composer map values to the GUI elements
95-
virtual void updateGuiElements();
96-
9794
protected slots:
9895
//! Initializes data defined buttons to current atlas coverage layer
9996
void populateDataDefinedButtons();
10097

10198
private slots:
10299

103-
//! Sets the GUI elements to the values of mPicture
104-
void setGuiElementValues();
100+
//! Sets the current composer map values to the GUI elements
101+
void updateGuiElements();
105102

106103
//! Enables or disables the atlas margin around feature option depending on coverage layer type
107104
void atlasLayerChanged( QgsVectorLayer *layer );

0 commit comments

Comments
 (0)