mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
Add all 'single value' input/output types as expression variables
Since expressions can be written which convert string values to numeric, and vice versa, it doesn't make sense to restrict creation of expression variables to only numeric inputs/outputs. Instead create variables for all sensible inputs/outputs, since users may want to use these in expressions which convert the output to a number....
This commit is contained in:
parent
ac51ae106c
commit
d6cbf30cc4
@ -673,9 +673,14 @@ QMap<QString, QgsProcessingModelAlgorithm::VariableDefinition> QgsProcessingMode
|
||||
return s.replace( QRegularExpression( "[\\s'\"\\(\\):]" ), QStringLiteral( "_" ) );
|
||||
};
|
||||
|
||||
// numeric sources
|
||||
ChildParameterSources sources = availableSourcesForChild( childId, QStringList() << QgsProcessingParameterNumber::typeName(),
|
||||
QStringList() << QgsProcessingOutputNumber::typeName() );
|
||||
// "static"/single value sources
|
||||
ChildParameterSources sources = availableSourcesForChild( childId, QStringList() << QgsProcessingParameterNumber::typeName()
|
||||
<< QgsProcessingParameterBoolean::typeName()
|
||||
<< QgsProcessingParameterExpression::typeName()
|
||||
<< QgsProcessingParameterField::typeName()
|
||||
<< QgsProcessingParameterString::typeName(),
|
||||
QStringList() << QgsProcessingOutputNumber::typeName()
|
||||
<< QgsProcessingOutputString::typeName() );
|
||||
Q_FOREACH ( const ChildParameterSource &source, sources )
|
||||
{
|
||||
QString name;
|
||||
|
Loading…
x
Reference in New Issue
Block a user