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
NodeExtractor Namespace Reference

Functions

IR::PageMetadata extractPageMetadata (const PageNode *pn, const HrefResolver *hrefResolver)
IR::QmlTypeData extractQmlTypeData (const QmlTypeNode *qcn, const HrefResolver *hrefResolver)
IR::CollectionData extractCollectionData (const CollectionNode *cn, const HrefResolver *hrefResolver)
static QList< IR::SignatureSpanbuildTemplateDeclSpans (const RelaxedTemplateDeclaration *templateDecl)
IR::CppReferenceData extractCppReferenceData (const Aggregate *aggregate, const HrefResolver *hrefResolver)
QList< IR::SectionIRextractSummarySections (const Aggregate *aggregate, const HrefResolver *hrefResolver)
QList< IR::SectionIRextractDetailSections (const Aggregate *aggregate, const HrefResolver *hrefResolver)
static QString threadSafenessString (Node::ThreadSafeness ts)
IR::MemberIR extractMemberIR (const Node *node, const HrefResolver *hrefResolver, const Node *relative, MemberExtractionLevel level)
static QList< IR::SignatureSpanbuildTypeSpans (const QString &typeString)
static QList< IR::SignatureSpanbuildExtraSpans (const Node *node, Section::Style style)
static QList< IR::SignatureSpanbuildCppSynopsisSpans (const Node *node, const HrefResolver *hrefResolver, const Node *relative, Section::Style style)
static QList< IR::SignatureSpanbuildQmlItemSpans (const Node *node, const HrefResolver *hrefResolver)
static QString plainTextFromSpans (const QList< IR::SignatureSpan > &spans)
QList< IR::SignatureSpanbuildSignatureSpans (const Node *node, const HrefResolver *hrefResolver, const Node *relative, Section::Style style)
static IR::AllMembersIR extractQmlAllMembersIR (const QmlTypeNode *qcn, const HrefResolver *hrefResolver)
static IR::AllMembersIR extractCppAllMembersIR (const Aggregate *aggregate, const HrefResolver *hrefResolver)
std::optional< IR::AllMembersIRextractAllMembersIR (const PageNode *pn, const HrefResolver *hrefResolver)
IR::MemberIR extractMemberIR (const Node *node, const HrefResolver *hrefResolver, const Node *relative, MemberExtractionLevel level=MemberExtractionLevel::Summary)
QList< IR::SignatureSpanbuildSignatureSpans (const Node *node, const HrefResolver *hrefResolver, const Node *relative, Section::Style style)

Function Documentation

◆ buildCppSynopsisSpans()

QList< IR::SignatureSpan > NodeExtractor::buildCppSynopsisSpans ( const Node * node,
const HrefResolver * hrefResolver,
const Node * relative,
Section::Style style )
static

◆ buildExtraSpans()

QList< IR::SignatureSpan > NodeExtractor::buildExtraSpans ( const Node * node,
Section::Style style )
static

Definition at line 882 of file nodeextractor.cpp.

References IR::ExternalRef, IR::Extra, IR::SignatureSpan::role, and IR::Text.

◆ buildQmlItemSpans()

QList< IR::SignatureSpan > NodeExtractor::buildQmlItemSpans ( const Node * node,
const HrefResolver * hrefResolver )
static

Definition at line 1334 of file nodeextractor.cpp.

References Parameters::at(), Parameters::count(), Node< _Tp >::isFunction(), Node< _Tp >::isQmlProperty(), IR::Name, IR::Parameter, IR::SignatureSpan::role, and IR::Text.

Here is the call graph for this function:

◆ buildSignatureSpans() [1/2]

QList< IR::SignatureSpan > NodeExtractor::buildSignatureSpans ( const Node * node,
const HrefResolver * hrefResolver,
const Node * relative,
Section::Style style )

Build structured signature spans from Node data.

This function produces a QList of SignatureSpan values that carry semantic roles (Type, Name, Parameter, Extra, and so on) for each element of a member's synopsis. It parallels what CppCodeMarker's markedUpSynopsis() and markedUpQmlItem() produce as tagged strings, but outputs structured IR spans instead.

The style parameter controls level of detail: Summary includes virtual/override qualifiers, Details adds template declarations and parent prefixes, AllMembers uses a condensed format.

Definition at line 1431 of file nodeextractor.cpp.

◆ buildSignatureSpans() [2/2]

QList< IR::SignatureSpan > NodeExtractor::buildSignatureSpans ( const Node * node,
const HrefResolver * hrefResolver,
const Node * relative,
Section::Style style )

◆ buildTemplateDeclSpans()

QList< IR::SignatureSpan > NodeExtractor::buildTemplateDeclSpans ( const RelaxedTemplateDeclaration * templateDecl)
static

Definition at line 929 of file nodeextractor.cpp.

References IR::SignatureSpan::role, IR::TemplateDecl, and IR::Text.

◆ buildTypeSpans()

QList< IR::SignatureSpan > NodeExtractor::buildTypeSpans ( const QString & typeString)
static

Definition at line 847 of file nodeextractor.cpp.

References IR::SignatureSpan::role, IR::Text, and IR::Type.

◆ extractAllMembersIR()

std::optional< IR::AllMembersIR > NodeExtractor::extractAllMembersIR ( const PageNode * pn,
const HrefResolver * hrefResolver )

Extract all-members IR for a page node.

Dispatches to the QML or C++ extraction function based on the page type. Returns std::nullopt for page types that don't have member listing pages (generic pages, QML basic types) or when the listing would be empty.

Definition at line 1571 of file nodeextractor.cpp.

References Node< _Tp >::isAggregate(), Node< _Tp >::isClassNode(), Node< _Tp >::isNamespace(), and Node< _Tp >::isQmlType().

Referenced by TemplateGenerator::generateCppReferencePage(), and TemplateGenerator::generateQmlTypePage().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ extractCollectionData()

IR::CollectionData NodeExtractor::extractCollectionData ( const CollectionNode * cn,
const HrefResolver * hrefResolver )

Extract collection metadata from a CollectionNode.

Populates module identity, CMake/qmake build variables, technology preview state, and pre-sorted member listings. For C++ modules, members are categorized into separate namespace and class lists. For groups and QML modules, a single flat member list is produced.

All member lists are filtered through InclusionFilter (excluding internal entries) and exclude deprecated nodes, then sorted alphabetically by name (case-insensitive).

Definition at line 269 of file nodeextractor.cpp.

References CollectionNode::getMembers(), Node< _Tp >::isClassNode(), IR::CollectionData::isGroup, Node< _Tp >::isGroup(), IR::CollectionData::isModule, Node< _Tp >::isModule(), IR::CollectionData::isQmlModule, Node< _Tp >::isQmlModule(), Namespace, IR::CollectionData::noAutoList, and PageNode::noAutoList().

Here is the call graph for this function:

◆ extractCppAllMembersIR()

IR::AllMembersIR NodeExtractor::extractCppAllMembersIR ( const Aggregate * aggregate,
const HrefResolver * hrefResolver )
static

Extract a flat all-members listing for a C++ class or namespace.

Constructs a Sections object from the aggregate, extracts allMembersSection().members(), builds AllMemberEntry for each visible member, and returns an AllMembersIR with isQmlType=false.

Definition at line 1531 of file nodeextractor.cpp.

References Sections::Sections(), Sections::allMembersSection(), Section::isEmpty(), and IR::AllMembersIR::isQmlType.

Here is the call graph for this function:

◆ extractCppReferenceData()

IR::CppReferenceData NodeExtractor::extractCppReferenceData ( const Aggregate * aggregate,
const HrefResolver * hrefResolver )

Extract C++ reference page metadata from a class, namespace, or header.

Reads requisite table fields (header include, build-system snippets, status), inheritance hierarchies, template declarations, comparison operators, thread-safeness, and group associations. The result is a value-type struct that captures everything the template generator needs to render the requisites table and secondary sections without touching the Node tree at render time.

All three aggregate page types (ClassNode, NamespaceNode, HeaderNode) are handled, with ClassNode-specific sections gated on isClassNode().

Definition at line 349 of file nodeextractor.cpp.

References Node< _Tp >::comparisonCategory(), Node< _Tp >::doc(), QDocDatabase::groups(), Aggregate::hasObsoleteMembers(), IR::CppReferenceData::hasObsoleteMembers, Node< _Tp >::isClassNode(), IR::CppReferenceData::isHeader, Node< _Tp >::isHeader(), InclusionFilter::isIncluded(), IR::CppReferenceData::isInnerClass, IR::CppReferenceData::isNamespace, Node< _Tp >::isNamespace(), IR::CppReferenceData::isPartialNamespace, Module, Node< _Tp >::nodeNameLessThan(), Node< _Tp >::parent(), QDocDatabase::qdocDB(), IR::CppReferenceData::suppressInheritance, Node< _Tp >::templateDecl(), Node< _Tp >::threadSafeness(), and Node< _Tp >::UnspecifiedSafeness.

Here is the call graph for this function:

◆ extractDetailSections()

QList< IR::SectionIR > NodeExtractor::extractDetailSections ( const Aggregate * aggregate,
const HrefResolver * hrefResolver )

Build categorized detail sections for an aggregate node.

Iterates Sections::detailsSections() and extracts full member documentation including body content, anchor IDs, and metadata. SharedCommentNode groups share a single documentation body across their children, with each child getting its own anchorId and synopsis.

Definition at line 654 of file nodeextractor.cpp.

References Sections::Sections(), and Sections::detailsSections().

Here is the call graph for this function:

◆ extractMemberIR() [1/2]

IR::MemberIR NodeExtractor::extractMemberIR ( const Node * node,
const HrefResolver * hrefResolver,
const Node * relative,
MemberExtractionLevel level )

Build a MemberIR from a single Node.

Extracts identity, classification, and type-specific data from the node. FunctionNode provides signatures, parameters, and overload metadata. EnumNode provides scoped/unscoped signature and enum value listings. PropertyNode provides a qualified data type signature.

When level is MemberExtractionLevel::Detail, also populates detail documentation fields: anchorId, synopsis, since, threadSafety, comparisonCategory, noexcept metadata, body (via ContentBuilder), and alsoList.

Definition at line 734 of file nodeextractor.cpp.

References IR::MemberIR::access, Node< _Tp >::access(), Parameters::at(), Doc::body(), Doc::briefText(), Node< _Tp >::comparisonCategory(), comparisonCategoryAsString(), Parameters::count(), Detail, Section::Details, Node< _Tp >::doc(), Text::firstAtom(), IR::MemberIR::isAttached, IR::MemberIR::isConst, IR::MemberIR::isDefault, Node< _Tp >::isEnumType(), Node< _Tp >::isFunction(), IR::MemberIR::isNoexcept, IR::MemberIR::isPrimaryOverload, Node< _Tp >::isProperty(), Node< _Tp >::isQmlProperty(), IR::MemberIR::isReadOnly, IR::MemberIR::isRequired, IR::MemberIR::isSignal, IR::MemberIR::isSlot, IR::MemberIR::isStatic, Node< _Tp >::isTypedef(), IR::MemberIR::isVirtual, IR::MemberIR::nodeType, Node< _Tp >::nodeType(), IR::MemberIR::overloadNumber, Node< _Tp >::SignatureDefaultValues, Node< _Tp >::SignatureReturnType, IR::MemberIR::status, Node< _Tp >::status(), Section::Summary, and Variable.

Here is the call graph for this function:

◆ extractMemberIR() [2/2]

IR::MemberIR NodeExtractor::extractMemberIR ( const Node * node,
const HrefResolver * hrefResolver,
const Node * relative,
MemberExtractionLevel level = MemberExtractionLevel::Summary )

◆ extractPageMetadata()

IR::PageMetadata NodeExtractor::extractPageMetadata ( const PageNode * pn,
const HrefResolver * hrefResolver )

Extract page-level metadata from a PageNode into a value-type struct.

This function reads classification, identity, brief, and body fields from the given PageNode and returns them as an IR::PageMetadata value. Body content is populated via ContentBuilder, which transforms the atom chain into structured content blocks. Format-conditional atoms are skipped unconditionally since the template generator builds a format-agnostic IR.

For aggregate pages (classes, QML types, namespaces), member listings are extracted via the Sections infrastructure and stored as frozen SectionIR values.

The caller (TemplateGenerator) invokes this before passing the result to IR::Builder, ensuring Builder never includes PageNode or other Node subclass headers.

Definition at line 91 of file nodeextractor.cpp.

References IR::PageMetadata::access, Node< _Tp >::access(), Class, Node< _Tp >::doc(), Text::firstAtom(), IR::PageMetadata::genus, Node< _Tp >::genus(), Group, Node< _Tp >::isAggregate(), Node< _Tp >::isClassNode(), Node< _Tp >::isCollectionNode(), Node< _Tp >::isHeader(), Node< _Tp >::isNamespace(), Node< _Tp >::isQmlType(), Module, Namespace, IR::PageMetadata::nodeType, Node< _Tp >::nodeType(), Page, QmlModule, QmlType, QmlValueType, IR::PageMetadata::status, Node< _Tp >::status(), Struct, and Union.

Referenced by TemplateGenerator::generateCollectionNode(), TemplateGenerator::generateCppReferencePage(), TemplateGenerator::generateGenericCollectionPage(), TemplateGenerator::generatePageNode(), and TemplateGenerator::generateQmlTypePage().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ extractQmlAllMembersIR()

IR::AllMembersIR NodeExtractor::extractQmlAllMembersIR ( const QmlTypeNode * qcn,
const HrefResolver * hrefResolver )
static

Extract a grouped all-members listing for a QML type.

Constructs a Sections object from the QmlTypeNode, extracts allMembersSection().classNodesList() to group members by originating QML type, and builds AllMemberEntry items with QML-specific hints and property group nesting.

Definition at line 1450 of file nodeextractor.cpp.

References Sections::allMembersSection(), Section::classNodesList(), Node< _Tp >::createContext(), and IR::AllMembersIR::isQmlType.

Here is the call graph for this function:

◆ extractQmlTypeData()

IR::QmlTypeData NodeExtractor::extractQmlTypeData ( const QmlTypeNode * qcn,
const HrefResolver * hrefResolver )

Extract QML type metadata from a QmlTypeNode.

Populates import statement, inheritance chain, inherited-by list, native C++ type link, and singleton/value-type flags. InclusionFilter is applied to match the legacy generator's visibility filtering.

Definition at line 185 of file nodeextractor.cpp.

References QmlTypeNode::classNode(), Node< _Tp >::createContext(), InclusionFilter::isIncluded(), Node< _Tp >::isQmlBasicType(), ClassNode::isQmlNativeType(), IR::QmlTypeData::isSingleton, QmlTypeNode::isSingleton(), IR::QmlTypeData::isValueType, QmlTypeNode::logicalModule(), QmlTypeNode::qmlBaseNode(), and QmlTypeNode::subclasses().

Here is the call graph for this function:

◆ extractSummarySections()

QList< IR::SectionIR > NodeExtractor::extractSummarySections ( const Aggregate * aggregate,
const HrefResolver * hrefResolver )

Build categorized summary sections for an aggregate node.

Delegates to the Sections class for member distribution, then extracts results into frozen SectionIR values. The section variant (C++ class, QML type, or generic) is chosen based on the aggregate's node type.

Definition at line 593 of file nodeextractor.cpp.

References Sections::Sections(), and Sections::summarySections().

Here is the call graph for this function:

◆ plainTextFromSpans()

QString NodeExtractor::plainTextFromSpans ( const QList< IR::SignatureSpan > & spans)
static

Definition at line 1409 of file nodeextractor.cpp.

◆ threadSafenessString()

QString NodeExtractor::threadSafenessString ( Node::ThreadSafeness ts)
static

Definition at line 708 of file nodeextractor.cpp.