Commit 0b0b485f authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.model: add convertTypeToImportAlias() to ModelNode

We expose convertTypeToImportAlias() in ModelNode.
parent 8723da0f
...@@ -173,6 +173,8 @@ public: ...@@ -173,6 +173,8 @@ public:
void setCustomParserSource(const QString&); void setCustomParserSource(const QString&);
QString customParserSource() const; QString customParserSource() const;
QString convertTypeToImportAlias() const;
private: // functions private: // functions
Internal::InternalNodePointer internalNode() const; Internal::InternalNodePointer internalNode() const;
QString generateNewId() const; QString generateNewId() const;
......
...@@ -960,4 +960,16 @@ QString ModelNode::customParserSource() const ...@@ -960,4 +960,16 @@ QString ModelNode::customParserSource() const
return internalNode()->customParserSource(); return internalNode()->customParserSource();
} }
QString ModelNode::convertTypeToImportAlias() const
{
if (!isValid()) {
throw InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__);
}
if (model()->rewriterView())
return model()->rewriterView()->convertTypeToImportAlias(type());
return type();
}
} }
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