![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
Represents a single span within a structured signature. More...
#include <signaturespan.h>
Public Member Functions | |
| QJsonObject | toJson () const |
| Converts the SignatureSpan to a QJsonObject for template rendering. | |
| QString | plainText () const |
| Returns the concatenated plain text of this span and all its children, recursively. | |
Public Attributes | |
| SpanRole | role { SpanRole::Text } |
| QString | text |
| QString | href |
| QList< SignatureSpan > | children |
Represents a single span within a structured signature.
SignatureSpan is a format-agnostic representation of one semantic element within a function or member signature. Spans carry a semantic role, display text, an optional link target, and optional children for nested structures such as template declarations.
Unlike CodeMarker's tagged strings, SignatureSpan captures semantic knowledge directly in the IR. Any generator consuming the IR can render signatures correctly without calling back into QDoc internals.
This is a pure value type with no dependencies on QDoc's core infrastructure. It belongs in QDocLib.
Definition at line 27 of file signaturespan.h.
|
nodiscard |
Returns the concatenated plain text of this span and all its children, recursively.
The span's own text is emitted first, followed by the concatenated plain text of all children. No separators are inserted — spans carry their own whitespace as Text spans.
Definition at line 105 of file signaturespan.cpp.
|
nodiscard |
Converts the SignatureSpan to a QJsonObject for template rendering.
The JSON includes a role key with the kebab-case role identifier and a text key with the span's display text. The href key is omitted when empty. The children array is omitted when empty.
Definition at line 78 of file signaturespan.cpp.
| QList<SignatureSpan> IR::SignatureSpan::children |
Definition at line 32 of file signaturespan.h.
| QString IR::SignatureSpan::href |
Definition at line 31 of file signaturespan.h.
| SpanRole IR::SignatureSpan::role { SpanRole::Text } |
Definition at line 29 of file signaturespan.h.
Referenced by NodeExtractor::buildCppSynopsisSpans(), NodeExtractor::buildExtraSpans(), NodeExtractor::buildQmlItemSpans(), NodeExtractor::buildTemplateDeclSpans(), and NodeExtractor::buildTypeSpans().
| QString IR::SignatureSpan::text |
Definition at line 30 of file signaturespan.h.