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
listexpander.h
Go to the documentation of this file.
1// Copyright (C) 2026 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4#ifndef QDOC_IR_LISTEXPANDER_H
5#define QDOC_IR_LISTEXPANDER_H
6
7#ifdef QDOC_TEMPLATE_GENERATOR_ENABLED
8
9#include "catalogentry.h"
10#include "listplaceholder.h"
11
12#include <QtCore/qlist.h>
13#include <QtCore/qnamespace.h>
14#include <QtCore/qstring.h>
15
16#include <functional>
17
18QT_BEGIN_NAMESPACE
19
20class Node;
21
22namespace IR {
23
24struct ContentBlock;
25
26struct ListExpanderCallbacks
27{
28 std::function<QList<CatalogEntry>(const Node *relative,
29 Qt::SortOrder sortOrder)>
30 collectCppClasses;
31
32 std::function<QList<CatalogEntryGroup>(const Node *relative)>
33 collectExamplesGrouped;
34
35 std::function<QList<CatalogEntry>(const Node *relative,
36 const QString &rootName)>
37 collectCompactClasses;
38
39 std::function<QList<CatalogEntry>(const Node *relative,
40 const QString &groupName,
41 Qt::SortOrder sortOrder)>
42 collectGroupMembers;
43
44 // Invoked when a placeholder's enumeration produces no entries,
45 // so the driver can attribute the warning. The expander itself
46 // logs nothing — keeping QDocLib free of driver-layer logging
47 // categories. The callback is optional; an unset slot means the
48 // empty placeholder is silently dropped.
49 std::function<void(const QString &argument,
50 ListPlaceholderVariant variant)>
51 onEmpty;
52};
53
54class ListExpander
55{
56public:
57 explicit ListExpander(ListExpanderCallbacks callbacks);
58
59 void expand(QList<ContentBlock> &blocks, const Node *relative);
60
61private:
62 ListExpanderCallbacks m_callbacks;
63};
64
65} // namespace IR
66
67QT_END_NAMESPACE
68
69#endif // QDOC_TEMPLATE_GENERATOR_ENABLED
70#endif // QDOC_IR_LISTEXPANDER_H
A class for holding the members of a collection of doc pages.
contains all the information for a single config variable in a .qdocconf file.
Definition config.h:43
The Config class contains the configuration variables for controlling how qdoc produces documentation...
Definition config.h:95
InclusionPolicy createInclusionPolicy() const
Definition config.cpp:1678
Interface handling documentation generation during tree traversal.
Traverses the node tree and dispatches to a handler for documentation generation.
void traverse(Node *root, DocumentationHandler &handler)
Encapsulate the logic that QDoc uses to find files whose path is provided by the user and that are re...
static bool noLinkErrors()
Definition generator.h:87
static QmlTypeNode * qmlTypeContext()
Definition generator.h:93
static bool autolinkErrors()
Definition generator.h:88
Assembles IR Documents from pre-extracted metadata.
Definition builder.h:15
Document buildPageIR(PageMetadata pm) const
Definition builder.cpp:196
\variable PublicationLocation::path
Singleton registry for discovering output producers by format.
void registerProducer(OutputProducer *producer)
Registers producer with this registry.
void unregisterProducer(OutputProducer *producer)
Unregisters producer from this registry.
static OutputProducerRegistry & instance()
Returns the singleton registry instance.
Interface for documentation output producers.
A PageNode is a Node that generates a documentation page.
Definition pagenode.h:19
This class provides exclusive access to the qdoc database, which consists of a forrest of trees and a...
NamespaceNode * primaryTreeRoot()
Returns a pointer to the root node of the primary tree.
void mergeCollections(CollectionNode *c)
Finds all the collection nodes with the same name and type as c and merges their members into the mem...
A class for creating vectors of collections for documentation.
Definition sections.h:80
Sections(const Aggregate *aggregate)
This constructor builds the section vectors based on the type of the aggregate node.
Definition sections.cpp:372
bool hasObsoleteMembers(SectionPtrVector *summary_spv, SectionPtrVector *details_spv) const
Returns true if any sections in this object contain obsolete members.
Definition sections.cpp:967
Generates documentation using external templates and a pre-built IR.
void generateProxyPage(Aggregate *aggregate, CodeMarker *marker) override
void endDocument() override
void beginDocument(const QString &fileName) override
void generateCppReferencePage(Aggregate *aggregate, CodeMarker *marker) override
std::function< void(const QString &message)> RenderFailureHandler
void generatePageNode(PageNode *pn, CodeMarker *marker) override
void finalize() override
Finalizes output production.
void prepare() override
Prepares the producer for an output run.
QString fileExtension() const
void planLocations(const LocationPlanSet &publications)
QString fileName(const Node *node) const override
void produce() override
Produces documentation output.
void generateCollectionNode(CollectionNode *cn, CodeMarker *marker) override
QString format() const override
Returns the format identifier for this producer (e.g., "HTML", "DocBook", "template").
void mergeCollections(CollectionNode *cn) override
void generateQmlTypePage(QmlTypeNode *qcn, CodeMarker *marker) override
TemplateGenerator(FileResolver &fileResolver, QDocDatabase &qdb, const QString &format, RenderFailureHandler reportFailure)
Constructs a producer for format using fileResolver and qdb.
void generateGenericCollectionPage(CollectionNode *cn, CodeMarker *marker) override
Definition builder.cpp:14
std::optional< IR::AllMembersIR > extractAllMembersIR(const PageNode *pn, const HrefResolver *hrefResolver)
Combined button and popup list for selecting options.
QList< const Section * > SectionPtrVector
Definition sections.h:77
Intermediate representation of the all-members listing page.
Definition member.h:146
Intermediate representation for a documentation topic.
Definition document.h:201
The Node class is the base class for all the nodes in QDoc's parse tree.
Bundles output configuration without static variables.
static void processDocumentBlocks(IR::ListExpander *expander, LinkResolver *resolver, IR::Document &ir, const Node *page, const NodeExtractor::SemanticOrigins *origins=nullptr)
static void writeOrDiscardRenderResult(FileDocumentWriter *writer, const InjaBridge::RenderContext &context, const InjaBridge::RenderResult &result, const TemplateGenerator::RenderFailureHandler &reportFailure)
static std::optional< LoadedTemplate > loadTemplate(const QString &templateDir, const QString &name)