Commit 59ab229b authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.documentController: switching to master model on mode change

Change-Id: If40ad93083d36eddf2090d50f2944ff7a3f77539
Reviewed-on: http://codereview.qt.nokia.com/727

Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@nokia.com>
parent ad80aa20
......@@ -230,6 +230,7 @@ void DesignDocumentController::blockModelSync(bool block)
m_d->textModifier->deactivateChangeSignals();
} else {
activeQtVersionChanged();
changeToMasterModel();
QmlModelState state;
//We go back to base state (and back again) to avoid side effects from text editing.
if (m_d->statesEditorView && m_d->statesEditorView->model()) {
......@@ -393,11 +394,7 @@ void DesignDocumentController::changeCurrentModelTo(const ModelNode &componentNo
}
if (m_d->model == m_d->subComponentModel) {
//change back to master model
m_d->model->detachView(m_d->rewriterView.data());
m_d->rewriterView->setTextModifier(m_d->textModifier);
m_d->model = m_d->masterModel;
m_d->model->attachView(m_d->rewriterView.data());
changeToMasterModel();
}
if (!componentNode.isRootNode()) {
Q_ASSERT(m_d->model == m_d->masterModel);
......
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