QmlDesigner: fixes copy and paste of components

This patch ensures that meta info is available for all models
during copy and paste
This commit is contained in:
Thomas Hartmann
2010-01-18 18:50:01 +01:00
parent 97c3d5302f
commit 5dce709263
3 changed files with 13 additions and 4 deletions

View File

@@ -542,6 +542,8 @@ void DesignDocumentController::deleteSelected()
void DesignDocumentController::copySelected()
{
QScopedPointer<Model> model(Model::create("Qt/Rectangle"));
model->setMetaInfo(m_d->model->metaInfo());
Q_ASSERT(model);
DesignDocumentControllerView view;
@@ -603,6 +605,8 @@ void DesignDocumentController::cutSelected()
void DesignDocumentController::paste()
{
QScopedPointer<Model> model(Model::create("empty"));
model->setMetaInfo(m_d->model->metaInfo());
model->setFileUrl(m_d->model->fileUrl());
Q_ASSERT(model);
if (!m_d->model)