Allow user variables to be set from glabels-batch command line (#75)

This commit is contained in:
Jim Evins
2019-10-12 21:57:04 -04:00
parent 1a900d0ebc
commit 7a02c0b226
6 changed files with 60 additions and 2 deletions
+21
View File
@@ -85,6 +85,27 @@ namespace glabels
}
///
/// Set initial value of multiple variables
///
void Variables::setVariables( const QMap<QString,QString>& definitions )
{
for ( auto& name : definitions.keys() )
{
if ( hasVariable( name ) )
{
(*this)[name].setInitialValue( definitions[name] );
}
else
{
addVariable( Variable( Variable::Type::STRING,
name,
definitions[name] ) );
}
}
}
///
/// Reset variables to their initial values
///