forked from qt-creator/qt-creator
QmlDesigner.FormEditor: Fix handling of property changes
Change-Id: I49d36574d4021b4c73c64873b1f21698c038498d Task-number: QTCREATORBUG-5226 Reviewed-on: http://codereview.qt.nokia.com/914 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
This commit is contained in:
committed by
Thomas Hartmann
parent
5e2f3f0d5e
commit
7ba726529e
@@ -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)
|
||||
void FormEditorView::instancePropertyChange(const QList<QPair<ModelNode, QString> > &propertyList)
|
||||
{
|
||||
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));
|
||||
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();
|
||||
|
||||
|
Reference in New Issue
Block a user