Allow to enter empty values in PropertyFloatList and PropertyIntegerList - issue #2535
This commit is contained in:
parent
9ee892eb35
commit
a38a78f6d6
|
@ -1151,9 +1151,10 @@ public:
|
|||
QStringList lines;
|
||||
if (edit) {
|
||||
QString inputText = edit->toPlainText();
|
||||
if (!inputText.isEmpty()) // let pass empty input, regardless of the type, so user can void the value
|
||||
lines = inputText.split(QString::fromLatin1("\n"));
|
||||
}
|
||||
|
||||
if (!lines.isEmpty()) {
|
||||
if (type == 1) { // floats
|
||||
bool ok;
|
||||
int line=1;
|
||||
|
@ -1176,7 +1177,7 @@ public:
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
QDialog::accept();
|
||||
}
|
||||
};
|
||||
|
|
|
@ -2091,7 +2091,6 @@ QVariant PropertyFloatListItem::toString(const QVariant& prop) const
|
|||
list.append(QLatin1String("..."));
|
||||
}
|
||||
QString text = QString::fromUtf8("[%1]").arg(list.join(QLatin1String(",")));
|
||||
|
||||
return QVariant(text);
|
||||
}
|
||||
|
||||
|
@ -2120,6 +2119,8 @@ void PropertyFloatListItem::setValue(const QVariant& value)
|
|||
str << *it << ",";
|
||||
}
|
||||
str << "]";
|
||||
if (data == QString::fromUtf8("[,]"))
|
||||
data = QString::fromUtf8("[]");
|
||||
setPropertyValue(data);
|
||||
}
|
||||
|
||||
|
@ -2193,6 +2194,8 @@ void PropertyIntegerListItem::setValue(const QVariant& value)
|
|||
str << *it << ",";
|
||||
}
|
||||
str << "]";
|
||||
if (data == QString::fromUtf8("[,]"))
|
||||
data = QString::fromUtf8("[]");
|
||||
setPropertyValue(data);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user