Navigation Menu

Skip to content

Commit

Permalink
Fix map item widget properties updating
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Nov 7, 2017
1 parent 45ffb26 commit b276f4c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
14 changes: 4 additions & 10 deletions src/app/layout/qgslayoutmapwidget.cpp
Expand Up @@ -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 )
Expand Down Expand Up @@ -154,6 +153,8 @@ bool QgsLayoutMapWidget::setNewItem( QgsLayoutItem *item )
mMapItem = qobject_cast< QgsLayoutItemMap * >( item );
mItemPropertiesWidget->setItem( mMapItem );

updateGuiElements();

return true;
}

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

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

void QgsLayoutMapWidget::updateGuiElements()
{
if ( !mMapItem )
Expand Down
7 changes: 2 additions & 5 deletions src/app/layout/qgslayoutmapwidget.h
Expand Up @@ -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 );
Expand Down

0 comments on commit b276f4c

Please sign in to comment.