Skip to content

Commit

Permalink
setExpressionString deactivates QgsProperty if expression string is e…
Browse files Browse the repository at this point in the history
…mpty
  • Loading branch information
jakimowb authored and nyalldawson committed Feb 3, 2022
1 parent 0a0da90 commit 7cdf03e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/core/qgsproperty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,13 +370,20 @@ QgsProperty::operator bool() const
void QgsProperty::setExpressionString( const QString &expression )
{
d.detach();
d->type = ExpressionBasedProperty;
d->expressionString = expression;
d->expression = QgsExpression( expression );
d->expression = QgsExpression(expression);
d->expressionPrepared = false;
d->expressionIsInvalid = false;

if ( d->expressionString.isEmpty() )
{
d->active = false;
d->type = InvalidProperty;
}
else
{
d->type = ExpressionBasedProperty;
}
}

QString QgsProperty::expressionString() const
Expand Down

0 comments on commit 7cdf03e

Please sign in to comment.