forked from qt-creator/qt-creator
QmlDesigner: Check for parent is not required
States actually have a parent. Change-Id: Iaee31dec4d969c2f84224a2d93796d67f39fda77 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
committed by
Thomas Hartmann
parent
6c6fb10ab7
commit
a6d16f85c4
@@ -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);
|
||||
|
Reference in New Issue
Block a user