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

QmlDesigner.model: avoid assert when setting current state (again)

Task-number: QTCREATORBUG-5503
Change-Id: Ib6469b584e82f6b0cb579d5ab81658f918fd8690
Reviewed-on: http://codereview.qt.nokia.com/1877

Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@nokia.com>
parent b3642fd3
...@@ -96,6 +96,7 @@ ModelPrivate::ModelPrivate(Model *model) : ...@@ -96,6 +96,7 @@ ModelPrivate::ModelPrivate(Model *model) :
m_internalIdCounter(1) m_internalIdCounter(1)
{ {
m_rootInternalNode = createNode("QtQuick/Item", 1, 0, PropertyListType(), PropertyListType(), QString(), ModelNode::NodeWithoutSource,true); m_rootInternalNode = createNode("QtQuick/Item", 1, 0, PropertyListType(), PropertyListType(), QString(), ModelNode::NodeWithoutSource,true);
m_acutalStateNode = m_rootInternalNode;
} }
ModelPrivate::~ModelPrivate() ModelPrivate::~ModelPrivate()
......
...@@ -63,7 +63,11 @@ void QmlModelView::setCurrentState(const QmlModelState &state) ...@@ -63,7 +63,11 @@ void QmlModelView::setCurrentState(const QmlModelState &state)
if (!state.isValid()) if (!state.isValid())
return; return;
setAcutalStateNode(state.modelNode()); if (!model())
return;
if (actualStateNode() != state.modelNode())
setAcutalStateNode(state.modelNode());
} }
QmlModelState QmlModelView::currentState() const QmlModelState QmlModelView::currentState() const
......
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