Skip to content

Commit

Permalink
[processing] Fix missing [optional] text in string parameter label
Browse files Browse the repository at this point in the history
Fixes #19817
  • Loading branch information
nyalldawson committed Sep 16, 2018
1 parent 195539d commit 8790c4c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/gui/processing/qgsprocessingwidgetwrapper.cpp
Expand Up @@ -124,7 +124,10 @@ QLabel *QgsAbstractProcessingParameterWidgetWrapper::createLabel()
case QgsProcessingGui::Standard:
case QgsProcessingGui::Modeler:
{
std::unique_ptr< QLabel > label = qgis::make_unique< QLabel >( mParameterDefinition->description() );
QString description = mParameterDefinition->description();
if ( parameterDefinition()->flags() & QgsProcessingParameterDefinition::FlagOptional )
description = QObject::tr( "%1 [optional]" ).arg( description );
std::unique_ptr< QLabel > label = qgis::make_unique< QLabel >( description );
label->setToolTip( mParameterDefinition->toolTip() );
return label.release();
}
Expand Down

0 comments on commit 8790c4c

Please sign in to comment.