Commit de610cac authored by Thomas Hartmann's avatar Thomas Hartmann

QmlDesigner: crash fix for copy and paste

imports (in the model) are broken (regression)
Since I rely on working imports in copy and paste broke.

I hardcode 4.7 in this patch!

Reviewed-by: Kai Koehne
parent e59d0134
......@@ -455,7 +455,7 @@ void DesignDocumentController::deleteSelected()
void DesignDocumentController::copySelected()
{
QScopedPointer<Model> model(Model::create("Qt/Rectangle"));
QScopedPointer<Model> model(Model::create("import Qt 4.7; Qt/Rectangle"));
model->setMetaInfo(m_d->model->metaInfo());
Q_ASSERT(model);
......
......@@ -170,8 +170,9 @@ void ModelMerger::replaceModel(const ModelNode &modelNode)
{
RewriterTransaction transaction(view()->beginRewriterTransaction());
foreach (const Import &import, modelNode.model()->imports())
view()->model()->addImport(import);
foreach (const Import &import, modelNode.model()->imports()) {
//view()->model()->addImport(import); //###
}
view()->model()->setFileUrl(modelNode.model()->fileUrl());
ModelNode rootNode(view()->rootModelNode());
......
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