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

QmlDesigner: avoid syncronization errors when going to text mode and back

To be safe to change to the base state (and back).

Reviewed-by: Kai Koehne
parent ce80090d
......@@ -161,8 +161,19 @@ void DesignDocumentController::detachNodeInstanceView()
void DesignDocumentController::attachNodeInstanceView()
{
QmlModelState state;
if (m_d->nodeInstanceView)
model()->attachView(m_d->nodeInstanceView.data());
//We go back to base state (and back again) to avoid side effects from text editing.
if (m_d->statesEditorView) {
state = m_d->statesEditorView->currentState();
m_d->statesEditorView->setCurrentState(m_d->statesEditorView->baseState());
}
if (state.isValid() && m_d->statesEditorView)
m_d->statesEditorView->setCurrentState(state);
}
QWidget *DesignDocumentController::centralWidget() 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