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
LinkIR Struct Reference

Intermediate representation for a resolved hyperlink. More...

#include <linkir.h>

Collaboration diagram for LinkIR:

Public Types

enum class  State : unsigned char { Resolved , External , Unresolved , Broken }
 Optional title/tooltip attribute. More...

Public Member Functions

QJsonObject toJson () const
 Converts the LinkIR to a QJsonObject for template rendering.
bool isValid () const
bool isResolved () const
bool isExternal () const

Public Attributes

QString target
QString text
 Pre-resolved URL or anchor.
QString title
 Display text for the link.
State state {State::Resolved}
QString originalTarget

Detailed Description

Intermediate representation for a resolved hyperlink.

LinkIR represents a fully-resolved link in QDoc's intermediate representation layer. All target resolution happens during the IR building phase, so templates receive only pre-computed URLs and display text. This eliminates the need for generators to perform database lookups during output generation.

See also
DocumentIR, NavigationIR

Definition at line 12 of file linkir.h.

Member Enumeration Documentation

◆ State

enum class LinkIR::State : unsigned char
strong

Optional title/tooltip attribute.

Indicates the resolution state of the link target.

\value Resolved Link target was found and resolved. \value External Link points to an external resource. \value Unresolved Target not found (will produce warning). \value Broken Target explicitly marked as broken.

Enumerator
Resolved 
External 
Unresolved 
Broken 

Definition at line 18 of file linkir.h.

Member Function Documentation

◆ isExternal()

bool LinkIR::isExternal ( ) const
inlinenodiscard

Definition at line 33 of file linkir.h.

◆ isResolved()

bool LinkIR::isResolved ( ) const
inlinenodiscard

Definition at line 32 of file linkir.h.

◆ isValid()

bool LinkIR::isValid ( ) const
inlinenodiscard

Definition at line 31 of file linkir.h.

◆ toJson()

QJsonObject LinkIR::toJson ( ) const
nodiscard

Converts the LinkIR to a QJsonObject for template rendering.

The JSON structure uses camelCase field names following the established IR-to-JSON convention. The state is represented as a string for readability in templates: "resolved", "external", "unresolved", or "broken".

Returns a QJsonObject containing all link data suitable for template rendering via InjaBridge.

Definition at line 43 of file linkir.cpp.

Member Data Documentation

◆ originalTarget

QString LinkIR::originalTarget

Definition at line 27 of file linkir.h.

◆ state

State LinkIR::state {State::Resolved}

Definition at line 25 of file linkir.h.

◆ target

QString LinkIR::target

Definition at line 14 of file linkir.h.

◆ text

QString LinkIR::text

Pre-resolved URL or anchor.

Definition at line 15 of file linkir.h.

◆ title

QString LinkIR::title

Display text for the link.

Definition at line 16 of file linkir.h.


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