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")
|
if (propertyName == "clip")
|
||||||
item->setFlag(QGraphicsItem::ItemClipsChildrenToShape, qmlItemNode.instanceValue("clip").toBool());
|
item->setFlag(QGraphicsItem::ItemClipsChildrenToShape, qmlItemNode.instanceValue("clip").toBool());
|
||||||
|
|
||||||
|
if (propertyName == "z")
|
||||||
|
item->setZValue(qmlItemNode.instanceValue("z").toDouble());
|
||||||
|
|
||||||
if (!qmlItemNode.isRootNode()) {
|
if (!qmlItemNode.isRootNode()) {
|
||||||
if (propertyName == "visible")
|
if (propertyName == "visible")
|
||||||
item->setContentVisible(qmlItemNode.instanceValue("visible").toBool());
|
item->setContentVisible(qmlItemNode.instanceValue("visible").toBool());
|
||||||
|
@@ -573,17 +573,23 @@ QmlItemNode findRecursiveQmlItemNode(const QmlObjectNode &firstQmlObjectNode)
|
|||||||
return QmlItemNode();
|
return QmlItemNode();
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormEditorView::otherPropertyChanged(const QmlObjectNode &qmlObjectNode, const QString &propertyName)
|
void FormEditorView::instancePropertyChange(const QList<QPair<ModelNode, QString> > &propertyList)
|
||||||
{
|
{
|
||||||
Q_ASSERT(qmlObjectNode.isValid());
|
typedef QPair<ModelNode, QString> NodePropertyPair;
|
||||||
|
foreach (const NodePropertyPair &nodePropertyPair, propertyList) {
|
||||||
QmlItemNode itemNode = findRecursiveQmlItemNode(qmlObjectNode);
|
const QmlItemNode itemNode(nodePropertyPair.first);
|
||||||
|
const QString propertyName = nodePropertyPair.second;
|
||||||
if (itemNode.isValid() && scene()->hasItemForQmlItemNode(itemNode)) {
|
if (itemNode.isValid() && scene()->hasItemForQmlItemNode(itemNode)) {
|
||||||
|
static QStringList skipList = QStringList() << "x" << "y" << "width" << "height";
|
||||||
|
if (!skipList.contains(propertyName)) {
|
||||||
m_scene->synchronizeOtherProperty(itemNode, propertyName);
|
m_scene->synchronizeOtherProperty(itemNode, propertyName);
|
||||||
m_currentTool->formEditorItemsChanged(QList<FormEditorItem*>() << m_scene->itemForQmlItemNode(itemNode));
|
m_currentTool->formEditorItemsChanged(QList<FormEditorItem*>() << m_scene->itemForQmlItemNode(itemNode));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QmlModelView::instancePropertyChange(propertyList);
|
||||||
|
}
|
||||||
|
|
||||||
void FormEditorView::updateGraphicsIndicators()
|
void FormEditorView::updateGraphicsIndicators()
|
||||||
{
|
{
|
||||||
|
@@ -108,6 +108,7 @@ public:
|
|||||||
void instancesRenderImageChanged(const QVector<ModelNode> &nodeList);
|
void instancesRenderImageChanged(const QVector<ModelNode> &nodeList);
|
||||||
void instancesPreviewImageChanged(const QVector<ModelNode> &nodeList);
|
void instancesPreviewImageChanged(const QVector<ModelNode> &nodeList);
|
||||||
void instancesChildrenChanged(const QVector<ModelNode> &nodeList);
|
void instancesChildrenChanged(const QVector<ModelNode> &nodeList);
|
||||||
|
void instancePropertyChange(const QList<QPair<ModelNode, QString> > &propertyList);
|
||||||
|
|
||||||
void rewriterBeginTransaction();
|
void rewriterBeginTransaction();
|
||||||
void rewriterEndTransaction();
|
void rewriterEndTransaction();
|
||||||
@@ -123,7 +124,6 @@ signals:
|
|||||||
void ItemCreatorDeActivated();
|
void ItemCreatorDeActivated();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void otherPropertyChanged(const QmlObjectNode &qmlObjectNode, const QString &propertyName);
|
|
||||||
void stateChanged(const QmlModelState &newQmlModelState, const QmlModelState &oldQmlModelState);
|
void stateChanged(const QmlModelState &newQmlModelState, const QmlModelState &oldQmlModelState);
|
||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user