Commit a6d16f85 authored by Thomas Hartmann's avatar Thomas Hartmann Committed by Thomas Hartmann

QmlDesigner: Check for parent is not required

States actually have a parent.

Change-Id: Iaee31dec4d969c2f84224a2d93796d67f39fda77
Reviewed-by: Tim Jenssen's avatarTim Jenssen <tim.jenssen@qt.io>
parent 6c6fb10a
......@@ -72,9 +72,8 @@ void QmlStateNodeInstance::deactivateState()
void QmlStateNodeInstance::setPropertyVariant(const PropertyName &name, const QVariant &value)
{
bool hasParent = parent();
bool isStateOfTheRootModelNode = parentInstance() && parentInstance()->isRootNodeInstance();
if (name == "when" && (!hasParent || isStateOfTheRootModelNode))
if (name == "when" && (isStateOfTheRootModelNode))
return;
ObjectNodeInstance::setPropertyVariant(name, value);
......@@ -82,9 +81,9 @@ void QmlStateNodeInstance::setPropertyVariant(const PropertyName &name, const QV
void QmlStateNodeInstance::setPropertyBinding(const PropertyName &name, const QString &expression)
{
bool hasParent = parent();
bool isStateOfTheRootModelNode = parentInstance() && parentInstance()->isRootNodeInstance();
if (name == "when" && (!hasParent || isStateOfTheRootModelNode))
if (name == "when" && (isStateOfTheRootModelNode))
return;
ObjectNodeInstance::setPropertyBinding(name, expression);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment