Skip to content

Commit

Permalink
Allow setting negative value for parameters (#11837) (#11838)
Browse files Browse the repository at this point in the history
Fixes #11795
  • Loading branch information
adeas31 committed Jan 19, 2024
1 parent a1eac4e commit 5ddc1fc
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion OMEdit/OMEditLIB/Util/Utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -639,9 +639,18 @@ qreal Utilities::convertUnit(qreal value, qreal offset, qreal scaleFactor)
*/
bool Utilities::isValueLiteralConstant(QString value)
{
/* Issue #11795. Allow setting negative values for parameters.
* In future we should use proper regular expressions for this. Maybe when we switch to Qt 6.
*/
if (value.compare(QStringLiteral("-")) == 0) {
return true;
}

bool ok = true;
value.toDouble(&ok);
if (ok) return true;
if (ok) {
return true;
}

QStringList valuesArray = StringHandler::removeFirstLastCurlBrackets(value).split(",");
foreach (QString valueElement, valuesArray) {
Expand Down

0 comments on commit 5ddc1fc

Please sign in to comment.