11using namespace Qt::Literals::StringLiterals;
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
58 case SpanRole::Text:
return u"text"_s;
59 case SpanRole::Type:
return u"type"_s;
60 case SpanRole::Name:
return u"name"_s;
61 case SpanRole::Parameter:
return u"parameter"_s;
62 case SpanRole::Operator:
return u"operator"_s;
63 case SpanRole::Extra:
return u"extra"_s;
64 case SpanRole::TemplateDecl:
return u"template-decl"_s;
65 case SpanRole::Link:
return u"link"_s;
66 case SpanRole::ExternalRef:
return u"external-ref"_s;
72
73
74
75
76
77
81 json[
"role"_L1] = spanRoleId(role);
82 json[
"text"_L1] = text;
85 json[
"href"_L1] = href;
87 if (!children.isEmpty()) {
89 for (
const auto &child : children)
90 childArr.append(child.toJson());
91 json[
"children"_L1] = childArr;
98
99
100
101
102
103
104
107 if (children.isEmpty())
111 parts.reserve(children.size() + 1);
116 for (
const auto &child : children)
117 parts.append(child.plainText());
119 return parts.join(u""_s);
static QString spanRoleId(SpanRole role)
Combined button and popup list for selecting options.
Represents a single span within a structured signature.
QString plainText() const
Returns the concatenated plain text of this span and all its children, recursively.
QJsonObject toJson() const
Converts the SignatureSpan to a QJsonObject for template rendering.