[fix] Variables can't have spaces in name

This commit is contained in:
Nathan Woodrow 2018-03-19 11:02:54 +10:00 committed by Nyall Dawson
parent 6441b64a58
commit cfdfa47da2

View File

@ -719,6 +719,8 @@ void VariableEditorDelegate::setModelData( QWidget *widget, QAbstractItemModel *
{ {
//edited variable name //edited variable name
QString newName = lineEdit->text(); QString newName = lineEdit->text();
newName = newName.trimmed();
newName = newName.replace( QStringLiteral( " " ), "_" );
//test for validity //test for validity
if ( newName == variableName ) if ( newName == variableName )