Fix missing definition in data defined buttons

Fixes #19110
This commit is contained in:
Nyall Dawson 2018-06-08 10:09:39 +10:00
parent da89f18ed1
commit f6fa022910

View File

@ -690,6 +690,10 @@ void QgsPropertyOverrideButton::updateGui()
icon = QgsApplication::getThemeIcon( QStringLiteral( "/mIconDataDefineExpressionError.svg" ) );
deftip = tr( "Parse error: %1" ).arg( exp.parserErrorString() );
}
else
{
deftip = mExpressionString;
}
}
else if ( mProperty.propertyType() != QgsProperty::ExpressionBasedProperty && hasField )
{
@ -700,6 +704,10 @@ void QgsPropertyOverrideButton::updateGui()
icon = QgsApplication::getThemeIcon( QStringLiteral( "/mIconDataDefineError.svg" ) );
deftip = tr( "'%1' field missing" ).arg( mFieldName );
}
else
{
deftip = mFieldName;
}
}
setIcon( icon );
@ -724,7 +732,7 @@ void QgsPropertyOverrideButton::updateGui()
mFullDescription += tr( "<b>Valid input types:</b><br>%1<br>" ).arg( mDataTypesString );
}
QString deftype( QLatin1String( "" ) );
QString deftype;
if ( deftip != tr( "undefined" ) )
{
deftype = QStringLiteral( " (%1)" ).arg( mProperty.propertyType() == QgsProperty::ExpressionBasedProperty ? tr( "expression" ) : tr( "field" ) );