10using namespace Qt::Literals::StringLiterals;
13
14
15
16
17
18
19
20
21
22
23
24
38 obj[
"label"_L1] = label;
47 case NodeType::Namespace:
return classificationObject(
"namespace"_L1,
"Namespace"_L1);
48 case NodeType::Class:
return classificationObject(
"class"_L1,
"Class"_L1);
49 case NodeType::Struct:
return classificationObject(
"struct"_L1,
"Struct"_L1);
50 case NodeType::Union:
return classificationObject(
"union"_L1,
"Union"_L1);
51 case NodeType::HeaderFile:
return classificationObject(
"header-file"_L1,
"Header file"_L1);
52 case NodeType::Page:
return classificationObject(
"page"_L1,
"Page"_L1);
53 case NodeType::Enum:
return classificationObject(
"enum"_L1,
"Enum"_L1);
54 case NodeType::Example:
return classificationObject(
"example"_L1,
"Example"_L1);
55 case NodeType::ExternalPage:
return classificationObject(
"external-page"_L1,
"External page"_L1);
56 case NodeType::TypeAlias:
return classificationObject(
"type-alias"_L1,
"Type alias"_L1);
57 case NodeType::Typedef:
return classificationObject(
"typedef"_L1,
"Typedef"_L1);
58 case NodeType::Function:
return classificationObject(
"function"_L1,
"Function"_L1);
59 case NodeType::Property:
return classificationObject(
"property"_L1,
"Property"_L1);
60 case NodeType::Proxy:
return classificationObject(
"proxy"_L1,
"Proxy"_L1);
61 case NodeType::Variable:
return classificationObject(
"variable"_L1,
"Variable"_L1);
62 case NodeType::Group:
return classificationObject(
"group"_L1,
"Group"_L1);
63 case NodeType::Module:
return classificationObject(
"module"_L1,
"Module"_L1);
64 case NodeType::QmlType:
return classificationObject(
"qml-type"_L1,
"QML type"_L1);
65 case NodeType::QmlValueType:
return classificationObject(
"qml-value-type"_L1,
"QML value type"_L1);
66 case NodeType::QmlModule:
return classificationObject(
"qml-module"_L1,
"QML module"_L1);
67 case NodeType::QmlProperty:
return classificationObject(
"qml-property"_L1,
"QML property"_L1);
68 case NodeType::QmlEnum:
return classificationObject(
"qml-enum"_L1,
"QML enum"_L1);
69 case NodeType::SharedComment:
return classificationObject(
"shared-comment"_L1,
"Shared comment"_L1);
70 case NodeType::Collection:
return classificationObject(
"collection"_L1,
"Collection"_L1);
79 case Genus::DontCare:
return std::nullopt;
80 case Genus::CPP:
return classificationObject(
"cpp"_L1,
"C++"_L1);
81 case Genus::QML:
return classificationObject(
"qml"_L1,
"QML"_L1);
82 case Genus::DOC:
return classificationObject(
"doc"_L1,
"Documentation"_L1);
83 case Genus::API:
return classificationObject(
"api"_L1,
"API"_L1);
92 case Status::Deprecated:
return classificationObject(
"deprecated"_L1,
"Deprecated"_L1);
93 case Status::Preliminary:
return classificationObject(
"preliminary"_L1,
"Preliminary"_L1);
94 case Status::Active:
return classificationObject(
"active"_L1,
"Active"_L1);
95 case Status::Internal:
return classificationObject(
"internal"_L1,
"Internal"_L1);
96 case Status::DontDocument:
return classificationObject(
"ignored"_L1,
"Ignored"_L1);
105 case Access::Public:
return classificationObject(
"public"_L1,
"Public"_L1);
106 case Access::Protected:
return classificationObject(
"protected"_L1,
"Protected"_L1);
107 case Access::Private:
return classificationObject(
"private"_L1,
"Private"_L1);
113
114
115
116
117
118
119
120
121
122
123
124
125
133 if (
const auto t = nodeTypeToJson(nodeType))
134 json[
"nodeType"_L1] = *t;
135 if (
const auto g = genusToJson(genus))
136 json[
"genus"_L1] = *g;
137 json[
"status"_L1] = statusToJson(status);
138 json[
"access"_L1] = accessToJson(access);
141 json[
"title"_L1] = title;
142 json[
"fullTitle"_L1] = fullTitle;
143 json[
"url"_L1] = url;
144 json[
"brief"_L1] = brief;
147 if (!contentJson.isEmpty())
148 json[
"content"_L1] = contentJson;
Status
Specifies the status of the QQmlIncubator.
static QJsonObject classificationObject(const QString &id, const QString &label)
static QJsonObject accessToJson(Access a)
static std::optional< QJsonObject > genusToJson(Genus g)
static QJsonObject statusToJson(Status s)
static std::optional< QJsonObject > nodeTypeToJson(NodeType t)
Intermediate representation for a documentation topic.
QJsonObject toJson() const
Converts the DocumentIR to a QJsonObject for template rendering.