Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
IR::SignatureSpan Struct Reference

Represents a single span within a structured signature. More...

#include <signaturespan.h>

Collaboration diagram for IR::SignatureSpan:

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< SignatureSpanchildren

Detailed Description

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.

See also
SpanRole

Definition at line 27 of file signaturespan.h.

Member Function Documentation

◆ plainText()

QString IR::SignatureSpan::plainText ( ) const
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.

◆ toJson()

QJsonObject IR::SignatureSpan::toJson ( ) const
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.

Member Data Documentation

◆ children

QList<SignatureSpan> IR::SignatureSpan::children

Definition at line 32 of file signaturespan.h.

◆ href

QString IR::SignatureSpan::href

Definition at line 31 of file signaturespan.h.

◆ role

◆ text

QString IR::SignatureSpan::text

Definition at line 30 of file signaturespan.h.


The documentation for this struct was generated from the following files: