forked from qt-creator/qt-creator
QmlDesigner: Change updateTransform to directUpdates
directUpdates is much clearer description of what is the intent of this new mechanism. Change-Id: I196b00b924027f92b62490377b270a85f9da1d1d Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
This commit is contained in:
@@ -123,7 +123,7 @@ void MoveManipulator::setDirectUpdateInNodeInstances(bool directUpdate)
|
|||||||
{
|
{
|
||||||
foreach (FormEditorItem* item, m_itemList) {
|
foreach (FormEditorItem* item, m_itemList) {
|
||||||
if (item && item->qmlItemNode().isValid())
|
if (item && item->qmlItemNode().isValid())
|
||||||
item->qmlItemNode().nodeInstance().setUpdateTransform(!directUpdate);
|
item->qmlItemNode().nodeInstance().setDirectUpdate(directUpdate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -86,8 +86,8 @@ public:
|
|||||||
qint32 parentId() const;
|
qint32 parentId() const;
|
||||||
qint32 instanceId() const;
|
qint32 instanceId() const;
|
||||||
|
|
||||||
void setUpdateTransform(bool updateTransform);
|
void setDirectUpdate(bool directUpdates);
|
||||||
bool updateTransform() const;
|
bool directUpdates() const;
|
||||||
void setX(double x);
|
void setX(double x);
|
||||||
void setY(double y);
|
void setY(double y);
|
||||||
|
|
||||||
|
@@ -52,7 +52,7 @@ public:
|
|||||||
isMovable(false),
|
isMovable(false),
|
||||||
isResizable(false),
|
isResizable(false),
|
||||||
isInLayoutable(false),
|
isInLayoutable(false),
|
||||||
updateTransform(true)
|
directUpdates(false)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
qint32 parentInstanceId;
|
qint32 parentInstanceId;
|
||||||
@@ -72,7 +72,7 @@ public:
|
|||||||
bool isMovable;
|
bool isMovable;
|
||||||
bool isResizable;
|
bool isResizable;
|
||||||
bool isInLayoutable;
|
bool isInLayoutable;
|
||||||
bool updateTransform;
|
bool directUpdates;
|
||||||
|
|
||||||
|
|
||||||
QHash<PropertyName, QVariant> propertyValues;
|
QHash<PropertyName, QVariant> propertyValues;
|
||||||
@@ -135,23 +135,23 @@ qint32 NodeInstance::instanceId() const
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NodeInstance::setUpdateTransform(bool updateTransform)
|
void NodeInstance::setDirectUpdate(bool directUpdates)
|
||||||
{
|
{
|
||||||
if (d)
|
if (d)
|
||||||
d->updateTransform = updateTransform;
|
d->directUpdates = directUpdates;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NodeInstance::updateTransform() const
|
bool NodeInstance::directUpdates() const
|
||||||
{
|
{
|
||||||
if (d)
|
if (d)
|
||||||
return d->updateTransform || d->transform.isRotating() || d->transform.isScaling();
|
return d->directUpdates && !(d->transform.isRotating() || d->transform.isScaling());
|
||||||
else
|
else
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NodeInstance::setX(double x)
|
void NodeInstance::setX(double x)
|
||||||
{
|
{
|
||||||
if(d && !updateTransform()) {
|
if (d && directUpdates()) {
|
||||||
double dx = x - d->transform.dx();
|
double dx = x - d->transform.dx();
|
||||||
d->transform.translate(dx, 0.0);
|
d->transform.translate(dx, 0.0);
|
||||||
}
|
}
|
||||||
@@ -159,7 +159,7 @@ void NodeInstance::setX(double x)
|
|||||||
|
|
||||||
void NodeInstance::setY(double y)
|
void NodeInstance::setY(double y)
|
||||||
{
|
{
|
||||||
if(d && !updateTransform()) {
|
if (d && directUpdates()) {
|
||||||
double dy = y - d->transform.dy();
|
double dy = y - d->transform.dy();
|
||||||
d->transform.translate(0.0, dy);
|
d->transform.translate(0.0, dy);
|
||||||
}
|
}
|
||||||
@@ -407,7 +407,7 @@ InformationName NodeInstance::setInformationContentItemBoundingRect(const QRectF
|
|||||||
|
|
||||||
InformationName NodeInstance::setInformationTransform(const QTransform &transform)
|
InformationName NodeInstance::setInformationTransform(const QTransform &transform)
|
||||||
{
|
{
|
||||||
if (updateTransform() && d->transform != transform) {
|
if (!directUpdates() && d->transform != transform) {
|
||||||
d->transform = transform;
|
d->transform = transform;
|
||||||
return Transform;
|
return Transform;
|
||||||
}
|
}
|
||||||
|
@@ -688,7 +688,7 @@ void NodeInstanceView::updateChildren(const NodeAbstractProperty &newPropertyPar
|
|||||||
qint32 instanceId = childNode.internalId();
|
qint32 instanceId = childNode.internalId();
|
||||||
if (hasInstanceForId(instanceId)) {
|
if (hasInstanceForId(instanceId)) {
|
||||||
NodeInstance instance = instanceForId(instanceId);
|
NodeInstance instance = instanceForId(instanceId);
|
||||||
if (!instance.updateTransform())
|
if (instance.directUpdates())
|
||||||
instance.setParentId(parentInstanceId);
|
instance.setParentId(parentInstanceId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1245,7 +1245,7 @@ void NodeInstanceView::childrenChanged(const ChildrenChangedCommand &command)
|
|||||||
foreach (qint32 instanceId, command.childrenInstances()) {
|
foreach (qint32 instanceId, command.childrenInstances()) {
|
||||||
if (hasInstanceForId(instanceId)) {
|
if (hasInstanceForId(instanceId)) {
|
||||||
NodeInstance instance = instanceForId(instanceId);
|
NodeInstance instance = instanceForId(instanceId);
|
||||||
if (instance.updateTransform()) {
|
if (!instance.directUpdates()) {
|
||||||
instance.setParentId(command.parentInstanceId());
|
instance.setParentId(command.parentInstanceId());
|
||||||
childNodeVector.append(instance.modelNode());
|
childNodeVector.append(instance.modelNode());
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user