forked from qt-creator/qt-creator
QmlDesigner: Don't use direct update together with anchors
Task-number: QTCREATORBUG-12584 Change-Id: I2649f43421e48863d002ae1db34ec5f2276fafd9 Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
This commit is contained in:
@@ -91,6 +91,8 @@ public:
|
|||||||
void setX(double x);
|
void setX(double x);
|
||||||
void setY(double y);
|
void setY(double y);
|
||||||
|
|
||||||
|
bool hasAnchors() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void setProperty(const PropertyName &name, const QVariant &value);
|
void setProperty(const PropertyName &name, const QVariant &value);
|
||||||
InformationName setInformation(InformationName name,
|
InformationName setInformation(InformationName name,
|
||||||
|
@@ -144,7 +144,7 @@ void NodeInstance::setDirectUpdate(bool directUpdates)
|
|||||||
bool NodeInstance::directUpdates() const
|
bool NodeInstance::directUpdates() const
|
||||||
{
|
{
|
||||||
if (d)
|
if (d)
|
||||||
return d->directUpdates && !(d->transform.isRotating() || d->transform.isScaling());
|
return d->directUpdates && !(d->transform.isRotating() || d->transform.isScaling() || hasAnchors());
|
||||||
else
|
else
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -165,6 +165,19 @@ void NodeInstance::setY(double y)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool NodeInstance::hasAnchors() const
|
||||||
|
{
|
||||||
|
return hasAnchor("anchors.fill")
|
||||||
|
|| hasAnchor("anchors.centerIn")
|
||||||
|
|| hasAnchor("anchors.top")
|
||||||
|
|| hasAnchor("anchors.left")
|
||||||
|
|| hasAnchor("anchors.right")
|
||||||
|
|| hasAnchor("anchors.bottom")
|
||||||
|
|| hasAnchor("anchors.horizontalCenter")
|
||||||
|
|| hasAnchor("anchors.verticalCenter")
|
||||||
|
|| hasAnchor("anchors.baseline");
|
||||||
|
}
|
||||||
|
|
||||||
bool NodeInstance::isValid() const
|
bool NodeInstance::isValid() const
|
||||||
{
|
{
|
||||||
return instanceId() >= 0 && modelNode().isValid();
|
return instanceId() >= 0 && modelNode().isValid();
|
||||||
|
Reference in New Issue
Block a user