diff options
author | Thomas Hartmann <Thomas.Hartmann@digia.com> | 2013-02-06 13:47:29 +0100 |
---|---|---|
committer | Thomas Hartmann <Thomas.Hartmann@digia.com> | 2013-02-06 14:39:53 +0100 |
commit | 195738752bb85505f5b3eca77d8a2e15603d0cf2 (patch) | |
tree | fc62da0a8f0675afb57e7ccbfb5d06abe750e486 | |
parent | d53454960dc681fdfee6b286ee6d9b440e35d15d (diff) | |
download | qt-creator-195738752bb85505f5b3eca77d8a2e15603d0cf2.tar.gz |
QmlDesigner: crash fix in document handling
If in case of an error we should not detach the rewriter
and we always should attach the other views for simplicity.
The model is a valid ( Item {} ) and all the views are in a proper state.
This makes recovering and changing the mode back simpler, since the error
case is not a special one.
We do disable the widgets and show the error message of course.
Change-Id: I433a31a3c9ae36909089dff4d1eb1716141e809b
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
-rw-r--r-- | src/plugins/qmldesigner/qmldesignerplugin.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/plugins/qmldesigner/qmldesignerplugin.cpp b/src/plugins/qmldesigner/qmldesignerplugin.cpp index 43952f59e3..2db901e4a7 100644 --- a/src/plugins/qmldesigner/qmldesignerplugin.cpp +++ b/src/plugins/qmldesigner/qmldesignerplugin.cpp @@ -290,15 +290,14 @@ void QmlDesignerPlugin::activateAutoSynchronization() resetModelSelection(); + viewManager().attachComponentView(); + viewManager().attachViewsExceptRewriterAndComponetView(); QList<RewriterView::Error> errors = currentDesignDocument()->qmlSyntaxErrors(); if (errors.isEmpty()) { - viewManager().attachComponentView(); - viewManager().attachViewsExceptRewriterAndComponetView(); selectModelNodeUnderTextCursor(); m_mainWidget->enableWidgets(); } else { - viewManager().detachRewriterView(); m_mainWidget->disableWidgets(); m_mainWidget->showErrorMessage(errors); } |