forked from qt-creator/qt-creator
QmlDesigner.model: Allow sharing of meta info between models
This is necessary to copy and paste comopnents between different models.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user