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