Skip to content
Snippets Groups Projects
Commit 97c3d530 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.model: Allow sharing of meta info between models

This is necessary to copy and paste comopnents between different
models.
parent 5526c210
No related branches found
No related tags found
No related merge requests found
......@@ -86,6 +86,7 @@ public:
const MetaInfo metaInfo() const;
MetaInfo metaInfo();
void setMetaInfo(const MetaInfo &metaInfo);
void attachView(AbstractView *view);
void detachView(AbstractView *view, ViewNotification emitDetachNotify = NotifyView);
......
......@@ -251,6 +251,11 @@ MetaInfo ModelPrivate::metaInfo() const
return m_metaInfo;
}
void ModelPrivate::setMetaInfo(const MetaInfo &metaInfo)
{
m_metaInfo = metaInfo;
}
void ModelPrivate::changeNodeId(const InternalNode::Pointer& internalNodePointer, const QString &id)
{
const QString oldId = internalNodePointer->id();
......@@ -872,6 +877,14 @@ const MetaInfo Model::metaInfo() const
return m_d->metaInfo();
}
/*!
\brief Sets a specific Metainfo on this Model
*/
void Model::setMetaInfo(const MetaInfo &metaInfo)
{
m_d->setMetaInfo(metaInfo);
}
/*!
\brief Returns list of Qml types available within the model.
*/
......
......@@ -98,6 +98,7 @@ public:
InternalNodePointer findNode(const QString &id) const;
MetaInfo metaInfo() const;
void setMetaInfo(const MetaInfo &metaInfo);
void attachView(AbstractView *view);
void detachView(AbstractView *view, bool notifyView);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment