Skip to content
Permalink
Browse files
[processing] Add missing years, decades, centuries to duration parame…
…ter widget
  • Loading branch information
nirvn authored and nyalldawson committed Sep 6, 2021
1 parent 4d2c24e commit b16e7053e063b43689554af10f7fd3ff4c82f19a
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/gui/processing/qgsprocessingwidgetwrapperimpl.cpp
@@ -1267,6 +1267,9 @@ QgsProcessingDurationParameterDefinitionWidget::QgsProcessingDurationParameterDe
mUnitsCombo->addItem( QgsUnitTypes::toString( QgsUnitTypes::TemporalHours ), QgsUnitTypes::TemporalHours );
mUnitsCombo->addItem( QgsUnitTypes::toString( QgsUnitTypes::TemporalDays ), QgsUnitTypes::TemporalDays );
mUnitsCombo->addItem( QgsUnitTypes::toString( QgsUnitTypes::TemporalWeeks ), QgsUnitTypes::TemporalWeeks );
mUnitsCombo->addItem( tr( "years (365.25 days)" ), QgsUnitTypes::TemporalYears );
mUnitsCombo->addItem( QgsUnitTypes::toString( QgsUnitTypes::TemporalDecades ), QgsUnitTypes::TemporalDecades );
mUnitsCombo->addItem( QgsUnitTypes::toString( QgsUnitTypes::TemporalCenturies ), QgsUnitTypes::TemporalCenturies );
vlayout->addWidget( mUnitsCombo );

if ( const QgsProcessingParameterDuration *durationParam = dynamic_cast<const QgsProcessingParameterDuration *>( definition ) )
@@ -1338,6 +1341,9 @@ QWidget *QgsProcessingDurationWidgetWrapper::createWidget()
mUnitsCombo->addItem( QgsUnitTypes::toString( QgsUnitTypes::TemporalHours ), QgsUnitTypes::TemporalHours );
mUnitsCombo->addItem( QgsUnitTypes::toString( QgsUnitTypes::TemporalDays ), QgsUnitTypes::TemporalDays );
mUnitsCombo->addItem( QgsUnitTypes::toString( QgsUnitTypes::TemporalWeeks ), QgsUnitTypes::TemporalWeeks );
mUnitsCombo->addItem( tr( "years (365.25 days)" ), QgsUnitTypes::TemporalYears );
mUnitsCombo->addItem( QgsUnitTypes::toString( QgsUnitTypes::TemporalDecades ), QgsUnitTypes::TemporalDecades );
mUnitsCombo->addItem( QgsUnitTypes::toString( QgsUnitTypes::TemporalCenturies ), QgsUnitTypes::TemporalCenturies );

QHBoxLayout *layout = new QHBoxLayout();
layout->addWidget( spin, 1 );

0 comments on commit b16e705

Please sign in to comment.