QmlDesigner.subComponentManager: remove the need for a QDeclarativeEngine

There were cases where a QDeclarativeEngine was crashing.

Reviewed-by: Kai Koehne
This commit is contained in:
Thomas Hartmann
2011-03-08 13:56:03 +01:00
parent 18c4b4bcbf
commit d47ce7d286
3 changed files with 34 additions and 64 deletions

View File

@@ -287,9 +287,6 @@ QList<RewriterView::Error> DesignDocumentController::loadMaster(QPlainTextEdit *
m_d->subComponentModel = Model::create("QtQuick.Rectangle", 1, 0);
m_d->subComponentModel->setFileUrl(m_d->searchPath);
m_d->subComponentManager = new SubComponentManager(m_d->masterModel->metaInfo(), this);
m_d->subComponentManager->update(m_d->searchPath, m_d->textModifier->text().toUtf8());
m_d->rewriterView = new RewriterView(RewriterView::Amend, m_d->masterModel.data());
m_d->rewriterView->setTextModifier( m_d->textModifier);
connect(m_d->rewriterView.data(), SIGNAL(errorsChanged(const QList<RewriterView::Error> &)),
@@ -298,7 +295,8 @@ QList<RewriterView::Error> DesignDocumentController::loadMaster(QPlainTextEdit *
m_d->masterModel->attachView(m_d->rewriterView.data());
m_d->model = m_d->masterModel;
m_d->subComponentManager = new SubComponentManager(m_d->masterModel->metaInfo(), this);
m_d->subComponentManager->update(m_d->searchPath, m_d->model->imports());
loadCurrentModel();