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 );
43 mStartTemporalDateTimeEdit->setDisplayFormat( QStringLiteral(
"yyyy-MM-dd HH:mm:ss" ) );
44 mEndTemporalDateTimeEdit->setDisplayFormat( QStringLiteral(
"yyyy-MM-dd HH:mm:ss" ) );
48 mModeAutomaticRadio->setEnabled(
false );
49 mModeAutomaticRadio->setChecked(
false );
50 mModeFixedRangeRadio->setChecked(
true );
62 QgsDateTimeRange normalRange = QgsDateTimeRange( mStartTemporalDateTimeEdit->dateTime(),
63 mEndTemporalDateTimeEdit->dateTime() );
65 if ( mModeAutomaticRadio->isChecked() )
67 else if ( mModeFixedRangeRadio->isChecked() )
80 switch ( temporalProperties->
mode() )
83 mModeAutomaticRadio->setChecked(
true );
86 mModeFixedRangeRadio->setChecked(
true );
90 mStartTemporalDateTimeEdit->setDateTime( temporalProperties->
fixedTemporalRange().begin() );
91 mEndTemporalDateTimeEdit->setDateTime( temporalProperties->
fixedTemporalRange().end() );
93 mTemporalGroupBox->setChecked( temporalProperties->
isActive() );
97 widget->syncToLayer( mLayer );
103 mExtraWidgets << widget;
104 mExtraWidgetLayout->insertWidget( mExtraWidgetLayout->count() - 1, widget );
107 void QgsRasterLayerTemporalPropertiesWidget::temporalGroupBoxChecked(
bool checked )
111 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.
void setMode(TemporalMode mode)
Sets the temporal properties mode.
@ ModeFixedTemporalRange
Mode when temporal properties have fixed start and end datetimes.
@ ModeTemporalRangeFromDataProvider
Mode when raster layer delegates temporal range handling to the dataprovider.
TemporalMode mode() const
Returns 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.