34 mExtraWidgetLayout =
new QVBoxLayout();
35 mExtraWidgetLayout->setContentsMargins( 0, 0, 0, 0 );
36 mExtraWidgetLayout->addStretch();
37 mExtraWidgetContainer->setLayout( mExtraWidgetLayout );
39 connect( mModeFixedRangeRadio, &QRadioButton::toggled, mFixedTimeRangeFrame, &QWidget::setEnabled );
41 connect( mTemporalGroupBox, &QGroupBox::toggled,
this, &QgsRasterLayerTemporalPropertiesWidget::temporalGroupBoxChecked );
42 connect( mModeRedrawLayer, &QRadioButton::toggled, mLabelRedrawLayer, &QWidget::setEnabled );
44 mStartTemporalDateTimeEdit->setDisplayFormat( QStringLiteral(
"yyyy-MM-dd HH:mm:ss" ) );
45 mEndTemporalDateTimeEdit->setDisplayFormat( QStringLiteral(
"yyyy-MM-dd HH:mm:ss" ) );
49 mModeAutomaticRadio->setEnabled(
false );
50 mModeAutomaticRadio->setChecked(
false );
51 mModeFixedRangeRadio->setChecked(
true );
63 QgsDateTimeRange normalRange = QgsDateTimeRange( mStartTemporalDateTimeEdit->dateTime(),
64 mEndTemporalDateTimeEdit->dateTime() );
66 if ( mModeAutomaticRadio->isChecked() )
67 temporalProperties->
setMode( Qgis::RasterTemporalMode::TemporalRangeFromDataProvider );
68 else if ( mModeFixedRangeRadio->isChecked() )
69 temporalProperties->
setMode( Qgis::RasterTemporalMode::FixedTemporalRange );
70 else if ( mModeRedrawLayer->isChecked() )
71 temporalProperties->
setMode( Qgis::RasterTemporalMode::RedrawLayerOnly );
83 switch ( temporalProperties->
mode() )
85 case Qgis::RasterTemporalMode::TemporalRangeFromDataProvider:
86 mModeAutomaticRadio->setChecked(
true );
88 case Qgis::RasterTemporalMode::FixedTemporalRange:
89 mModeFixedRangeRadio->setChecked(
true );
91 case Qgis::RasterTemporalMode::RedrawLayerOnly:
92 mModeRedrawLayer->setChecked(
true );
96 mStartTemporalDateTimeEdit->setDateTime( temporalProperties->
fixedTemporalRange().begin() );
97 mEndTemporalDateTimeEdit->setDateTime( temporalProperties->
fixedTemporalRange().end() );
99 mTemporalGroupBox->setChecked( temporalProperties->
isActive() );
101 mLabelRedrawLayer->setEnabled( mModeRedrawLayer->isChecked() );
105 widget->syncToLayer( mLayer );
111 mExtraWidgets << widget;
112 mExtraWidgetLayout->insertWidget( mExtraWidgetLayout->count() - 1, widget );
115void QgsRasterLayerTemporalPropertiesWidget::temporalGroupBoxChecked(
bool checked )
119 widget->emit dynamicTemporalControlToggled( checked );
bool hasTemporalCapabilities() const
Returns true if the provider has temporal capabilities available.
QgsRasterDataProviderTemporalCapabilities * temporalCapabilities() override
Returns the provider's temporal capabilities.
Implementation of map layer temporal properties for raster layers.
Qgis::RasterTemporalMode mode() const
Returns the temporal properties mode.
void setMode(Qgis::RasterTemporalMode mode)
Sets the temporal properties mode.
void setFixedTemporalRange(const QgsDateTimeRange &range)
Sets a temporal range to apply to the whole layer.
const QgsDateTimeRange & fixedTemporalRange() const
Returns the fixed temporal range for the layer.
Represents a raster layer.
QgsMapLayerTemporalProperties * temporalProperties() override
Returns the layer's temporal properties.
QgsRasterDataProvider * dataProvider() override
Returns the source data provider.
bool isActive() const
Returns true if the temporal property is active.
void setIsActive(bool active)
Sets whether the temporal property is active.