Commit 7ba72652 authored by Marco Bubke's avatar Marco Bubke Committed by Thomas Hartmann

QmlDesigner.FormEditor: Fix handling of property changes

Change-Id: I49d36574d4021b4c73c64873b1f21698c038498d
Task-number:  QTCREATORBUG-5226
Reviewed-on: http://codereview.qt.nokia.com/914Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@nokia.com>
parent 5e2f3f0d
......@@ -196,6 +196,9 @@ void FormEditorScene::synchronizeOtherProperty(const QmlItemNode &qmlItemNode, c
if (propertyName == "clip")
item->setFlag(QGraphicsItem::ItemClipsChildrenToShape, qmlItemNode.instanceValue("clip").toBool());
if (propertyName == "z")
item->setZValue(qmlItemNode.instanceValue("z").toDouble());
if (!qmlItemNode.isRootNode()) {
if (propertyName == "visible")
item->setContentVisible(qmlItemNode.instanceValue("visible").toBool());
......
......@@ -573,16 +573,22 @@ QmlItemNode findRecursiveQmlItemNode(const QmlObjectNode &firstQmlObjectNode)
return QmlItemNode();
}
void FormEditorView::otherPropertyChanged(const QmlObjectNode &qmlObjectNode, const QString &propertyName)
{
Q_ASSERT(qmlObjectNode.isValid());
QmlItemNode itemNode = findRecursiveQmlItemNode(qmlObjectNode);
if (itemNode.isValid() && scene()->hasItemForQmlItemNode(itemNode)) {
m_scene->synchronizeOtherProperty(itemNode, propertyName);
m_currentTool->formEditorItemsChanged(QList<FormEditorItem*>() << m_scene->itemForQmlItemNode(itemNode));
void FormEditorView::instancePropertyChange(const QList<QPair<ModelNode, QString> > &propertyList)
{
typedef QPair<ModelNode, QString> NodePropertyPair;
foreach (const NodePropertyPair &nodePropertyPair, propertyList) {
const QmlItemNode itemNode(nodePropertyPair.first);
const QString propertyName = nodePropertyPair.second;
if (itemNode.isValid() && scene()->hasItemForQmlItemNode(itemNode)) {
static QStringList skipList = QStringList() << "x" << "y" << "width" << "height";
if (!skipList.contains(propertyName)) {
m_scene->synchronizeOtherProperty(itemNode, propertyName);
m_currentTool->formEditorItemsChanged(QList<FormEditorItem*>() << m_scene->itemForQmlItemNode(itemNode));
}
}
}
QmlModelView::instancePropertyChange(propertyList);
}
void FormEditorView::updateGraphicsIndicators()
......
......@@ -108,6 +108,7 @@ public:
void instancesRenderImageChanged(const QVector<ModelNode> &nodeList);
void instancesPreviewImageChanged(const QVector<ModelNode> &nodeList);
void instancesChildrenChanged(const QVector<ModelNode> &nodeList);
void instancePropertyChange(const QList<QPair<ModelNode, QString> > &propertyList);
void rewriterBeginTransaction();
void rewriterEndTransaction();
......@@ -123,7 +124,6 @@ signals:
void ItemCreatorDeActivated();
protected:
void otherPropertyChanged(const QmlObjectNode &qmlObjectNode, const QString &propertyName);
void stateChanged(const QmlModelState &newQmlModelState, const QmlModelState &oldQmlModelState);
void reset();
......
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