forked from qt-creator/qt-creator
AssetExport: Export custom id
Task-number: QDS-4114 Change-Id: I013ff674f0e9f59ed0a82803114faffae28bd74a Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -54,6 +54,7 @@ const char HeightTag[] = "height";
|
|||||||
|
|
||||||
const char MetadataTag[] = "metadata";
|
const char MetadataTag[] = "metadata";
|
||||||
const char ChildrenTag[] = "children";
|
const char ChildrenTag[] = "children";
|
||||||
|
const char CustomIdTag[] = "customId";
|
||||||
const char QmlIdTag[] = "qmlId";
|
const char QmlIdTag[] = "qmlId";
|
||||||
const char ExportTypeTag[] = "exportType";
|
const char ExportTypeTag[] = "exportType";
|
||||||
const char ExportTypeComponent[] = "component";
|
const char ExportTypeComponent[] = "component";
|
||||||
|
@@ -29,6 +29,7 @@
|
|||||||
#include "componentexporter.h"
|
#include "componentexporter.h"
|
||||||
|
|
||||||
#include "qmlitemnode.h"
|
#include "qmlitemnode.h"
|
||||||
|
#include "annotation.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
static QString capitalize(const QString &str)
|
static QString capitalize(const QString &str)
|
||||||
@@ -85,6 +86,9 @@ QJsonObject QmlDesigner::ItemNodeDumper::json(QmlDesigner::Component &component)
|
|||||||
metadata.insert(ExportTypeTag, ExportTypeChild);
|
metadata.insert(ExportTypeTag, ExportTypeChild);
|
||||||
metadata.insert(TypeNameTag, QString::fromLatin1(m_node.type()));
|
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);
|
QString typeId = component.exporter().componentUuid(m_node);
|
||||||
if (!typeId.isEmpty())
|
if (!typeId.isEmpty())
|
||||||
metadata.insert(TypeIdTag, typeId);
|
metadata.insert(TypeIdTag, typeId);
|
||||||
|
Reference in New Issue
Block a user