Skip to content
Permalink
Browse files

disable inappropriate vector settings when 1D mesh (#36503)

  • Loading branch information
vcloarec committed May 18, 2020
1 parent 7580d2f commit 303a87b5f289383fe4bdabf6c2cce86b0f5e40c2
@@ -181,16 +181,20 @@ QgsMeshRendererVectorSettings QgsMeshRendererVectorSettingsWidget::settings() co

void QgsMeshRendererVectorSettingsWidget::syncToLayer( )
{
if ( !mMeshLayer )
if ( !mMeshLayer && !mMeshLayer->dataProvider() )
return;

if ( mActiveDatasetGroup < 0 )
return;

bool hasFaces = ( mMeshLayer->dataProvider() &&
mMeshLayer->dataProvider()->contains( QgsMesh::ElementType::Face ) );

const QgsMeshRendererSettings rendererSettings = mMeshLayer->rendererSettings();
const QgsMeshRendererVectorSettings settings = rendererSettings.vectorSettings( mActiveDatasetGroup );

mSymbologyVectorComboBox->setCurrentIndex( settings.symbology() );
mSymbologyGroupBox->setVisible( hasFaces );
mSymbologyVectorComboBox->setCurrentIndex( hasFaces ? settings.symbology() : 0 );

// Arrow settings
const QgsMeshRendererVectorArrowSettings arrowSettings = settings.arrowSettings();
@@ -218,7 +222,8 @@ void QgsMeshRendererVectorSettingsWidget::syncToLayer( )
mHeadLengthLineEdit->setText( QString::number( arrowSettings.arrowHeadLengthRatio() * 100.0 ) );

// user grid
mDisplayVectorsOnGridGroupBox->setChecked( settings.isOnUserDefinedGrid() );
mDisplayVectorsOnGridGroupBox->setVisible( hasFaces );
mDisplayVectorsOnGridGroupBox->setChecked( settings.isOnUserDefinedGrid() && hasFaces );
mXSpacingSpinBox->setValue( settings.userGridCellWidth() );
mYSpacingSpinBox->setValue( settings.userGridCellHeight() );

@@ -27,7 +27,7 @@
<number>0</number>
</property>
<item>
<widget class="QGroupBox" name="groupBox">
<widget class="QGroupBox" name="mSymbologyGroupBox">
<property name="title">
<string>Symbology</string>
</property>

0 comments on commit 303a87b

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