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::Link Struct Reference

Intermediate representation for a resolved hyperlink. More...

#include <link.h>

Collaboration diagram for IR::Link:

Public Types

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

Public Member Functions

QJsonObject toJson () const
 Converts the Link 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.

Link 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
IR::Document

Definition at line 14 of file link.h.

Member Enumeration Documentation

◆ State

enum class IR::Link::State : unsigned char
strong

Optional title/tooltip attribute.

Enumerator
Resolved 
External 
Unresolved 
Broken 

Definition at line 20 of file link.h.

Member Function Documentation

◆ isExternal()

bool IR::Link::isExternal ( ) const
inlinenodiscard

Definition at line 35 of file link.h.

References External, and state.

◆ isResolved()

bool IR::Link::isResolved ( ) const
inlinenodiscard

Definition at line 34 of file link.h.

References Resolved, and state.

◆ isValid()

bool IR::Link::isValid ( ) const
inlinenodiscard

Definition at line 33 of file link.h.

◆ toJson()

QJsonObject IR::Link::toJson ( ) const
nodiscard

Converts the Link 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 45 of file link.cpp.

References state.

Member Data Documentation

◆ originalTarget

QString IR::Link::originalTarget

Definition at line 29 of file link.h.

◆ state

State IR::Link::state {State::Resolved}

Definition at line 27 of file link.h.

Referenced by isExternal(), isResolved(), and toJson().

◆ target

QString IR::Link::target

Definition at line 16 of file link.h.

◆ text

QString IR::Link::text

Pre-resolved URL or anchor.

Definition at line 17 of file link.h.

◆ title

QString IR::Link::title

Display text for the link.

Definition at line 18 of file link.h.


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