AssetExport: Export custom id

Task-number: QDS-4114
Change-Id: I013ff674f0e9f59ed0a82803114faffae28bd74a
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Vikas Pachdha
2021-04-16 19:01:07 +02:00
parent 3d4b5c0269
commit ee3e4f9e25
2 changed files with 5 additions and 0 deletions

View File

@@ -54,6 +54,7 @@ const char HeightTag[] = "height";
const char MetadataTag[] = "metadata";
const char ChildrenTag[] = "children";
const char CustomIdTag[] = "customId";
const char QmlIdTag[] = "qmlId";
const char ExportTypeTag[] = "exportType";
const char ExportTypeComponent[] = "component";

View File

@@ -29,6 +29,7 @@
#include "componentexporter.h"
#include "qmlitemnode.h"
#include "annotation.h"
namespace {
static QString capitalize(const QString &str)
@@ -85,6 +86,9 @@ QJsonObject QmlDesigner::ItemNodeDumper::json(QmlDesigner::Component &component)
metadata.insert(ExportTypeTag, ExportTypeChild);
metadata.insert(TypeNameTag, QString::fromLatin1(m_node.type()));
if (m_node.hasCustomId())
metadata.insert(CustomIdTag, m_node.customId());
QString typeId = component.exporter().componentUuid(m_node);
if (!typeId.isEmpty())
metadata.insert(TypeIdTag, typeId);