Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Hide the temporal limit handling combo box when a vector layer
temporal mode is set to redraw layer only
  • Loading branch information
nyalldawson committed Dec 16, 2021
1 parent b6f8fa1 commit 3914388
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions src/gui/qgsvectorlayertemporalpropertieswidget.cpp
Expand Up @@ -40,6 +40,24 @@ QgsVectorLayerTemporalPropertiesWidget::QgsVectorLayerTemporalPropertiesWidget(
mModeComboBox->addItem( tr( "Redraw Layer Only" ), static_cast< int >( Qgis::VectorTemporalMode::RedrawLayerOnly ) );

connect( mModeComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), mStackedWidget, &QStackedWidget::setCurrentIndex );
connect( mModeComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, [ = ]
{
switch ( static_cast< Qgis::VectorTemporalMode>( mModeComboBox->currentData().toInt() ) )
{
case Qgis::VectorTemporalMode::FixedTemporalRange:
case Qgis::VectorTemporalMode::FeatureDateTimeInstantFromField:
case Qgis::VectorTemporalMode::FeatureDateTimeStartAndEndFromFields:
case Qgis::VectorTemporalMode::FeatureDateTimeStartAndDurationFromFields:
case Qgis::VectorTemporalMode::FeatureDateTimeStartAndEndFromExpressions:
mLimitsComboBox->show();
mLimitsLabel->show();
break;
case Qgis::VectorTemporalMode::RedrawLayerOnly:
mLimitsComboBox->hide();
mLimitsLabel->hide();
break;
}
} );

mLimitsComboBox->addItem( tr( "Include Start, Exclude End (default)" ), static_cast< int >( Qgis::VectorTemporalLimitMode::IncludeBeginExcludeEnd ) );
mLimitsComboBox->addItem( tr( "Include Start, Include End" ), static_cast< int >( Qgis::VectorTemporalLimitMode::IncludeBeginIncludeEnd ) );
Expand Down
2 changes: 1 addition & 1 deletion src/ui/qgsvectorlayertemporalpropertieswidgetbase.ui
Expand Up @@ -449,7 +449,7 @@ background: white;QgsCollapsibleGroupBoxBasic::title, QgsCollapsibleGroupBox::ti
<widget class="QComboBox" name="mLimitsComboBox"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_15">
<widget class="QLabel" name="mLimitsLabel">
<property name="text">
<string>Limits</string>
</property>
Expand Down

0 comments on commit 3914388

Please sign in to comment.