Skip to content
Permalink
Browse files

emit dataset group changed after it effectively changed

  • Loading branch information
vcloarec authored and nyalldawson committed Jun 14, 2020
1 parent 5cc0a22 commit 300fc9e9afd75a9c8287c561842c8bbd1a65a317
Showing with 19 additions and 2 deletions.
  1. +0 −2 src/app/mesh/qgsrenderermeshpropertieswidget.cpp
  2. +19 −0 src/core/mesh/qgsmeshlayer.cpp
@@ -169,7 +169,6 @@ void QgsRendererMeshPropertiesWidget::onActiveScalarGroupChanged( int groupIndex
mMeshRendererScalarSettingsWidget->syncToLayer();
mContoursGroupBox->setChecked( groupIndex >= 0 );
mContoursGroupBox->setEnabled( groupIndex >= 0 );
emit mMeshLayer->activeScalarDatasetGroupChanged( groupIndex );
}

void QgsRendererMeshPropertiesWidget::onActiveVectorGroupChanged( int groupIndex )
@@ -181,5 +180,4 @@ void QgsRendererMeshPropertiesWidget::onActiveVectorGroupChanged( int groupIndex
mMeshRendererVectorSettingsWidget->syncToLayer();
mVectorsGroupBox->setChecked( groupIndex >= 0 );
mVectorsGroupBox->setEnabled( groupIndex >= 0 );
emit mMeshLayer->activeVectorDatasetGroupChanged( groupIndex );
}
@@ -267,7 +267,16 @@ QgsMeshRendererSettings QgsMeshLayer::rendererSettings() const

void QgsMeshLayer::setRendererSettings( const QgsMeshRendererSettings &settings )
{
int oldActiveScalar = mRendererSettings.activeScalarDatasetGroup();
int oldActiveVector = mRendererSettings.activeVectorDatasetGroup();
mRendererSettings = settings;

if ( oldActiveScalar != mRendererSettings.activeScalarDatasetGroup() )
emit activeScalarDatasetGroupChanged( mRendererSettings.activeScalarDatasetGroup() );

if ( oldActiveVector != mRendererSettings.activeVectorDatasetGroup() )
emit activeVectorDatasetGroupChanged( mRendererSettings.activeScalarDatasetGroup() );

emit rendererChanged();
triggerRepaint();
}
@@ -820,14 +829,24 @@ QgsMeshDatasetIndex QgsMeshLayer::staticScalarDatasetIndex() const

void QgsMeshLayer::setStaticVectorDatasetIndex( const QgsMeshDatasetIndex &staticVectorDatasetIndex )
{
int oldActiveVector = mRendererSettings.activeVectorDatasetGroup();

mStaticVectorDatasetIndex = staticVectorDatasetIndex.dataset();
mRendererSettings.setActiveVectorDatasetGroup( staticVectorDatasetIndex.group() );

if ( oldActiveVector != mRendererSettings.activeVectorDatasetGroup() )
emit activeVectorDatasetGroupChanged( mRendererSettings.activeScalarDatasetGroup() );
}

void QgsMeshLayer::setStaticScalarDatasetIndex( const QgsMeshDatasetIndex &staticScalarDatasetIndex )
{
int oldActiveScalar = mRendererSettings.activeScalarDatasetGroup();

mStaticScalarDatasetIndex = staticScalarDatasetIndex.dataset();
mRendererSettings.setActiveScalarDatasetGroup( staticScalarDatasetIndex.group() );

if ( oldActiveScalar != mRendererSettings.activeScalarDatasetGroup() )
emit activeScalarDatasetGroupChanged( mRendererSettings.activeScalarDatasetGroup() );
}

QgsMeshSimplificationSettings QgsMeshLayer::meshSimplificationSettings() const

0 comments on commit 300fc9e

Please sign in to comment.
You can’t perform that action at this time.