Commit fbd370e2 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.Model: Add notifier refactoring at nodeOrderChanged

RewriterView and NodeInstanceView was not notified about a model change.
parent 6763adce
......@@ -886,17 +886,28 @@ void ModelPrivate::notifyNodeOrderChanged(const InternalNodeListPropertyPointer
bool resetModel = false;
QString description;
try {
if (rewriterView())
rewriterView()->nodeOrderChanged(NodeListProperty(internalListPropertyPointer, model(), rewriterView()),
ModelNode(internalNodePointer, model(), rewriterView()),
oldIndex);
} catch (RewritingException &e) {
description = e.description();
resetModel = true;
}
foreach (const QWeakPointer<AbstractView> &view, m_viewList) {
Q_ASSERT(!view.isNull());
try {
view->nodeOrderChanged(NodeListProperty(internalListPropertyPointer, model(), view.data()),
view->nodeOrderChanged(NodeListProperty(internalListPropertyPointer, model(), view.data()),
ModelNode(internalNodePointer, model(), view.data()),
oldIndex);
} catch (RewritingException &e) {
description = e.description();
resetModel = true;
}
}
if (nodeInstanceView())
nodeInstanceView()->nodeOrderChanged(NodeListProperty(internalListPropertyPointer, model(), nodeInstanceView()),
ModelNode(internalNodePointer, model(), nodeInstanceView()),
oldIndex);
if (resetModel) {
resetModelByRewriter(description);
}
......
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