Skip to content

Commit

Permalink
Allow setting negative value for parameters (#11837)
Browse files Browse the repository at this point in the history
Fixes #11795
  • Loading branch information
adeas31 committed Jan 19, 2024
1 parent 0317d93 commit 0cd4e24
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion OMEdit/OMEditLIB/Util/Utilities.cpp
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 0cd4e24

Please sign in to comment.