mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
[layouts] Update map settings variables in UI when map extent/rotation changes
Fixes #24136
This commit is contained in:
parent
1afdd935cf
commit
86c83537f9
@ -195,6 +195,13 @@ Sets the layout item
|
||||
%Docstring
|
||||
Sets the master layout associated with the item.
|
||||
|
||||
.. versionadded:: 3.10
|
||||
%End
|
||||
|
||||
void updateVariables();
|
||||
%Docstring
|
||||
Updates the variables widget, refreshing the values of variables shown.
|
||||
|
||||
.. versionadded:: 3.10
|
||||
%End
|
||||
|
||||
|
@ -181,6 +181,8 @@ QgsLayoutMapWidget::QgsLayoutMapWidget( QgsLayoutItemMap *item )
|
||||
loadOverviewEntries();
|
||||
|
||||
connect( mMapRotationSpinBox, static_cast < void ( QgsDoubleSpinBox::* )( double ) > ( &QgsDoubleSpinBox::valueChanged ), this, &QgsLayoutMapWidget::rotationChanged );
|
||||
connect( mMapItem, &QgsLayoutItemMap::extentChanged, mItemPropertiesWidget, &QgsLayoutItemPropertiesWidget::updateVariables );
|
||||
connect( mMapItem, &QgsLayoutItemMap::mapRotationChanged, mItemPropertiesWidget, &QgsLayoutItemPropertiesWidget::updateVariables );
|
||||
|
||||
blockAllSignals( false );
|
||||
}
|
||||
@ -211,6 +213,8 @@ bool QgsLayoutMapWidget::setNewItem( QgsLayoutItem *item )
|
||||
if ( mMapItem )
|
||||
{
|
||||
disconnect( mMapItem, &QgsLayoutObject::changed, this, &QgsLayoutMapWidget::updateGuiElements );
|
||||
disconnect( mMapItem, &QgsLayoutItemMap::extentChanged, mItemPropertiesWidget, &QgsLayoutItemPropertiesWidget::updateVariables );
|
||||
disconnect( mMapItem, &QgsLayoutItemMap::mapRotationChanged, mItemPropertiesWidget, &QgsLayoutItemPropertiesWidget::updateVariables );
|
||||
}
|
||||
|
||||
mMapItem = qobject_cast< QgsLayoutItemMap * >( item );
|
||||
@ -221,6 +225,8 @@ bool QgsLayoutMapWidget::setNewItem( QgsLayoutItem *item )
|
||||
if ( mMapItem )
|
||||
{
|
||||
connect( mMapItem, &QgsLayoutObject::changed, this, &QgsLayoutMapWidget::updateGuiElements );
|
||||
connect( mMapItem, &QgsLayoutItemMap::extentChanged, mItemPropertiesWidget, &QgsLayoutItemPropertiesWidget::updateVariables );
|
||||
connect( mMapItem, &QgsLayoutItemMap::mapRotationChanged, mItemPropertiesWidget, &QgsLayoutItemPropertiesWidget::updateVariables );
|
||||
mOverviewFrameStyleButton->registerExpressionContextGenerator( mMapItem );
|
||||
}
|
||||
|
||||
|
@ -244,6 +244,13 @@ class GUI_EXPORT QgsLayoutItemPropertiesWidget: public QWidget, private Ui::QgsL
|
||||
*/
|
||||
void setMasterLayout( QgsMasterLayoutInterface *masterLayout );
|
||||
|
||||
/**
|
||||
* Updates the variables widget, refreshing the values of variables shown.
|
||||
*
|
||||
* \since QGIS 3.10
|
||||
*/
|
||||
void updateVariables();
|
||||
|
||||
protected slots:
|
||||
//! Initializes data defined buttons to current atlas coverage layer
|
||||
void initializeDataDefinedButtons();
|
||||
@ -302,7 +309,6 @@ class GUI_EXPORT QgsLayoutItemPropertiesWidget: public QWidget, private Ui::QgsL
|
||||
void setValuesForGuiNonPositionElements();
|
||||
|
||||
void variablesChanged();
|
||||
void updateVariables();
|
||||
|
||||
private:
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user