42 connect( mModeComboBox, qgis::overload<int>::of( &QComboBox::currentIndexChanged ), mStackedWidget, &QStackedWidget::setCurrentIndex );
44 mStartTemporalDateTimeEdit->setDisplayFormat(
"yyyy-MM-dd HH:mm:ss" );
45 mEndTemporalDateTimeEdit->setDisplayFormat(
"yyyy-MM-dd HH:mm:ss" );
47 mSingleFieldComboBox->setLayer( layer );
48 mStartFieldComboBox->setLayer( layer );
49 mEndFieldComboBox->setLayer( layer );
50 mDurationStartFieldComboBox->setLayer( layer );
51 mDurationFieldComboBox->setLayer( layer );
54 mStartFieldComboBox->setAllowEmptyFieldName(
true );
56 mEndFieldComboBox->setAllowEmptyFieldName(
true );
60 mFixedDurationSpinBox->setMinimum( 0 );
61 mFixedDurationSpinBox->setClearValue( 0 );
79 mDurationUnitsComboBox->addItem( title, u );
80 mFixedDurationUnitsComboBox->addItem( title, u );
83 mFixedDurationUnitsComboBox->setEnabled( !mAccumulateCheckBox->isChecked() );
84 mFixedDurationSpinBox->setEnabled( !mAccumulateCheckBox->isChecked() );
85 connect( mAccumulateCheckBox, &QCheckBox::toggled,
this, [ = ](
bool checked )
87 mFixedDurationUnitsComboBox->setEnabled( !checked );
88 mFixedDurationSpinBox->setEnabled( !checked );
91 mStartExpressionWidget->setAllowEmptyFieldName(
true );
92 mEndExpressionWidget->setAllowEmptyFieldName(
true );
93 mStartExpressionWidget->setLayer( layer );
94 mEndExpressionWidget->setLayer( layer );
95 mStartExpressionWidget->registerExpressionContextGenerator(
this );
96 mEndExpressionWidget->registerExpressionContextGenerator(
this );
105 properties->
setIsActive( mTemporalGroupBox->isChecked() );
108 QgsDateTimeRange normalRange = QgsDateTimeRange( mStartTemporalDateTimeEdit->dateTime(),
109 mEndTemporalDateTimeEdit->dateTime() );
113 switch ( properties->
mode() )
119 properties->
setStartField( mSingleFieldComboBox->currentField() );
124 properties->
setStartField( mStartFieldComboBox->currentField() );
129 properties->
setStartField( mDurationStartFieldComboBox->currentField() );
134 properties->
setEndField( mEndFieldComboBox->currentField() );
152 mTemporalGroupBox->setChecked( properties->
isActive() );
154 mModeComboBox->setCurrentIndex( mModeComboBox->findData( properties->
mode() ) );
155 mStackedWidget->setCurrentIndex(
static_cast< int >( properties->
mode() ) );
160 mFixedDurationSpinBox->setValue( properties->
fixedDuration() );
164 mSingleFieldComboBox->setField( properties->
startField() );
165 mStartFieldComboBox->setField( properties->
startField() );
166 mDurationStartFieldComboBox->setField( properties->
startField() );
168 if ( !properties->
endField().isEmpty() )
170 mEndFieldComboBox->setField( properties->
endField() );
172 mDurationFieldComboBox->setField( properties->
durationField() );
173 mDurationUnitsComboBox->setCurrentIndex( mDurationUnitsComboBox->findData( properties->
durationUnits() ) );
174 mFixedDurationUnitsComboBox->setCurrentIndex( mDurationUnitsComboBox->findData( properties->
durationUnits() ) );
179 mEndExpressionWidget->setField( properties->
endExpression() );