Skip to content
Permalink
Browse files

[processing] Fix missing [optional] text in string parameter label

Fixes #19817
  • Loading branch information
nyalldawson committed Sep 16, 2018
1 parent 195539d commit 8790c4c99e0213fb7eed842b3467c8ad34450f18
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/gui/processing/qgsprocessingwidgetwrapper.cpp
@@ -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();
}

0 comments on commit 8790c4c

Please sign in to comment.
You can’t perform that action at this time.