Skip to content
Permalink
Browse files
Fix map item widget properties updating
  • Loading branch information
nyalldawson committed Nov 7, 2017
1 parent 45ffb26 commit b276f4c4b924d03553e0d1b94d41ac4a0602a956
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
@@ -105,9 +105,8 @@ QgsLayoutMapWidget::QgsLayoutMapWidget( QgsLayoutItemMap *item )
if ( item )
{
mLabel->setText( tr( "Map %1" ).arg( item->id() ) );
#if 0 //TODO
connect( item, &QgsLayoutObject::itemChanged, this, &QgsLayoutMapWidget::setGuiElementValues );
#endif
connect( item, &QgsLayoutObject::changed, this, &QgsLayoutMapWidget::updateGuiElements );

#if 0 //TODO
QgsAtlasComposition *atlas = atlasComposition();
if ( atlas )
@@ -154,6 +153,8 @@ bool QgsLayoutMapWidget::setNewItem( QgsLayoutItem *item )
mMapItem = qobject_cast< QgsLayoutItemMap * >( item );
mItemPropertiesWidget->setItem( mMapItem );

updateGuiElements();

return true;
}

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

void QgsLayoutMapWidget::setGuiElementValues()
{
mScaleLineEdit->blockSignals( true );
updateGuiElements();
mScaleLineEdit->blockSignals( false );
}

void QgsLayoutMapWidget::updateGuiElements()
{
if ( !mMapItem )
@@ -91,17 +91,14 @@ class QgsLayoutMapWidget: public QgsLayoutItemBaseWidget, private Ui::QgsLayoutM
protected:
bool setNewItem( QgsLayoutItem *item ) override;

//! Sets the current composer map values to the GUI elements
virtual void updateGuiElements();

protected slots:
//! Initializes data defined buttons to current atlas coverage layer
void populateDataDefinedButtons();

private slots:

//! Sets the GUI elements to the values of mPicture
void setGuiElementValues();
//! Sets the current composer map values to the GUI elements
void updateGuiElements();

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

0 comments on commit b276f4c

Please sign in to comment.