Let the DesignMode recover when the qml contains an error on first load

If the qml contains an error on frist call of
DesignDocumentController::loadMaster, we did not wire up the components
to the model. If the user then fixed the qml, the Design mode widgets
were 'enabled', but didn't contain any meaningful input.

Fixed by always wiring up the components. Unfortunately this shows the
'default' model with just a Rectangle.
This commit is contained in:
Kai Koehne
2010-01-13 11:44:13 +01:00
parent e929a40108
commit 84c30ea99e
2 changed files with 11 additions and 9 deletions

View File

@@ -332,10 +332,10 @@ QList<RewriterView::Error> DesignDocumentController::loadMaster(QPlainTextEdit *
//m_d->masterModel = Model::create(m_d->textModifier, m_d->searchPath, errors);
m_d->masterModel = Model::create("Item", 4, 6);
m_d->masterModel = Model::create("Qt/Rectangle", 4, 6);
m_d->masterModel->setFileUrl(m_d->searchPath);
m_d->subComponentModel = Model::create("Item", 4, 6);
m_d->subComponentModel = Model::create("Qt/Rectangle", 4, 6);
m_d->subComponentModel->setFileUrl(m_d->searchPath);
m_d->subComponentManager = new SubComponentManager(m_d->masterModel->metaInfo(), this);
@@ -354,13 +354,9 @@ QList<RewriterView::Error> DesignDocumentController::loadMaster(QPlainTextEdit *
m_d->masterModel->attachView(m_d->viewLogger.data());
#endif
// m_d->masterModel->detachView(m_d->rewriterView.data());
loadCurrentModel();
QList<RewriterView::Error> errors = m_d->rewriterView->errors();
if (errors.isEmpty())
loadCurrentModel();
return errors;
return m_d->rewriterView->errors();
}
void DesignDocumentController::changeCurrentModelTo(const ModelNode &componentNode)