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:1608
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:86
static QmlTypeNode * qmlTypeContext()
Definition generator.h:92
static bool autolinkErrors()
Definition generator.h:87
Assembles IR Documents from pre-extracted metadata.
Definition builder.h:15
Document buildPageIR(PageMetadata pm) const
Definition builder.cpp:175
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:371
bool hasObsoleteMembers(SectionPtrVector *summary_spv, SectionPtrVector *details_spv) const
Returns true if any sections in this object contain obsolete members.
Definition sections.cpp:963
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
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
TemplateGenerator(FileResolver &fileResolver, QDocDatabase &qdb, const QString &format=QString())
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
void generateGenericCollectionPage(CollectionNode *cn, CodeMarker *marker) override
Definition builder.cpp:14
std::optional< IR::AllMembersIR > extractAllMembersIR(const PageNode *pn, const HrefResolver *hrefResolver)
IR::PageMetadata extractPageMetadata(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:115
Intermediate representation for a documentation topic.
Definition document.h:197
The Node class is the base class for all the nodes in QDoc's parse tree.
bool hasFileNameBase() const
Returns true if the node's file name base has been set.
Definition node.h:168
virtual bool isPageNode() const
Returns true if this node represents something that generates a documentation page.
Definition node.h:149
virtual bool isTextPageNode() const
Returns true if the node is a PageNode but not an Aggregate.
Definition node.h:154
Aggregate * parent() const
Returns the node's parent pointer.
Definition node.h:209
virtual bool isCollectionNode() const
Returns true if this is an instance of CollectionNode.
Definition node.h:145
Bundles output configuration without static variables.
static void processDocumentBlocks(IR::ListExpander *expander, LinkResolver *resolver, IR::Document &ir, const Node *relative)