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
Generator Class Referenceabstract

#include <generator.h>

+ Inheritance diagram for Generator:
+ Collaboration diagram for Generator:

Public Types

enum  ListType { Generic , Obsolete }
 
enum  Addendum {
  Invokable , PrivateSignal , QmlSignalHandler , AssociatedProperties ,
  BindableProperty
}
 

Public Member Functions

 Generator (Moc *moc, ClassDef *classDef, const QList< QByteArray > &metaTypes, const QHash< QByteArray, QByteArray > &knownQObjectClasses, const QHash< QByteArray, QByteArray > &knownGadgets, FILE *outfile=nullptr, bool requireCompleteTypes=false)
 
void generateCode ()
 
qsizetype registeredStringsCount ()
 
 Generator (FileResolver &file_resolver)
 Constructs the generator base class.
 
virtual ~Generator ()
 Destroys the generator after removing it from the list of output generators.
 
virtual bool canHandleFormat (const QString &format)
 
virtual QString format ()=0
 
virtual void generateDocs ()
 Traverses the database recursively to generate all the documentation.
 
virtual void initializeGenerator ()
 Updates the generator's m_showInternal from the Config.
 
virtual void initializeFormat ()
 Reads format-specific variables from config, sets output (sub)directories, creates them on the filesystem and copies the template-specific files.
 
virtual void terminateGenerator ()
 
virtual QString typeString (const Node *node)
 
QString fullDocumentLocation (const Node *node)
 Returns the full document location.
 
QString linkForExampleFile (const QString &path, const QString &fileExt=QString())
 Constructs an href link from an example file name, which is a path to the example file.
 
virtual QString fileBase (const Node *node) const
 

Static Public Member Functions

static QString exampleFileTitle (const ExampleNode *relative, const QString &fileName)
 Helper function to construct a title for a file or image page included in an example.
 
static GeneratorcurrentGenerator ()
 
static GeneratorgeneratorForFormat (const QString &format)
 
static void initialize ()
 
static const QStringoutputDir ()
 
static const QStringoutputSubdir ()
 
static void terminate ()
 
static const QStringListoutputFileNames ()
 
static bool noLinkErrors ()
 
static bool autolinkErrors ()
 
static QString defaultModuleName ()
 
static void resetUseOutputSubdirs ()
 
static bool useOutputSubdirs ()
 
static void setQmlTypeContext (QmlTypeNode *t)
 
static QmlTypeNodeqmlTypeContext ()
 
static QString cleanRef (const QString &ref, bool xmlCompliant=false)
 Clean the given ref to be used as an HTML anchor or an xml:id.
 
static QString plainCode (const QString &markedCode)
 

Protected Member Functions

void beginSubPage (const Node *node, const QString &fileName)
 Creates the file named fileName in the output directory.
 
void endSubPage ()
 Flush the text stream associated with the subpage, and then pop it off the text stream stack and delete it.
 
virtual QString fileExtension () const =0
 
virtual void generateExampleFilePage (const Node *, ResolvedFile, CodeMarker *=nullptr)
 
virtual void generateAlsoList (const Node *node, CodeMarker *marker)
 
virtual void generateAlsoList (const Node *node)
 
virtual qsizetype generateAtom (const Atom *, const Node *, CodeMarker *)
 
virtual void generateBody (const Node *node, CodeMarker *marker)
 Generate the body of the documentation from the qdoc comment found with the entity represented by the node.
 
virtual void generateCppReferencePage (Aggregate *, CodeMarker *)
 
virtual void generateProxyPage (Aggregate *, CodeMarker *)
 
virtual void generateQmlTypePage (QmlTypeNode *, CodeMarker *)
 
virtual void generatePageNode (PageNode *, CodeMarker *)
 
virtual void generateCollectionNode (CollectionNode *, CodeMarker *)
 
virtual void generateGenericCollectionPage (CollectionNode *, CodeMarker *)
 
virtual void generateDocumentation (Node *node)
 Recursive writing of HTML files from the root node.
 
virtual bool generateText (const Text &text, const Node *relative, CodeMarker *marker)
 Generate the documentation for relative.
 
virtual bool generateText (const Text &text, const Node *relative)
 
virtual int skipAtoms (const Atom *atom, Atom::AtomType type) const
 
void initializeTextOutput ()
 Resets the variables used during text output.
 
QString fileName (const Node *node, const QString &extension=QString()) const
 If the node has a URL, return the URL as the file name.
 
QMap< QString, QString > & formattingLeftMap ()
 
QMap< QString, QString > & formattingRightMap ()
 
const AtomgenerateAtomList (const Atom *atom, const Node *relative, CodeMarker *marker, bool generate, int &numGeneratedAtoms)
 
void generateEnumValuesForQmlProperty (const Node *node, CodeMarker *marker)
 
void generateRequiredLinks (const Node *node, CodeMarker *marker)
 Generates either a link to the project folder for example node, or a list of links files/images if 'url.examples config' variable is not defined.
 
void generateLinkToExample (const ExampleNode *en, CodeMarker *marker, const QString &exampleUrl)
 Generates an external link to the project folder for example node.
 
virtual void generateFileList (const ExampleNode *en, CodeMarker *marker, bool images)
 This function is called when the documentation for an example is being formatted.
 
void generateSince (const Node *node, CodeMarker *marker)
 
void generateNoexceptNote (const Node *node, CodeMarker *marker)
 
void generateStatus (const Node *node, CodeMarker *marker)
 
virtual void generateAddendum (const Node *node, Addendum type, CodeMarker *marker, bool generateNote)
 Generates an addendum note of type type for node, using marker as the code marker.
 
virtual void generateAddendum (const Node *node, Addendum type, CodeMarker *marker)
 
void generateThreadSafeness (const Node *node, CodeMarker *marker)
 Generates text that explains how threadsafe and/or reentrant node is.
 
bool generateComparisonCategory (const Node *node, CodeMarker *marker=nullptr)
 
bool generateComparisonList (const Node *node)
 Generates a list of types that compare to node with the comparison category that applies for the relationship, followed by (an optional) descriptive text.
 
void generateOverloadedSignal (const Node *node, CodeMarker *marker)
 If the node is an overloaded signal, add a node with an example on how to connect to it.
 
QString indent (int level, const QString &markedCode)
 
QTextStreamout ()
 
QString outFileName ()
 
bool parseArg (const QString &src, const QString &tag, int *pos, int n, QStringView *contents, QStringView *par1=nullptr)
 
void unknownAtom (const Atom *atom)
 
int appendSortedQmlNames (Text &text, const Node *base, const NodeList &subs)
 
void appendFullName (Text &text, const Node *apparentNode, const Node *relative, const Node *actualNode=nullptr)
 
void appendFullName (Text &text, const Node *apparentNode, const QString &fullName, const Node *actualNode)
 
int appendSortedNames (Text &text, const ClassNode *classe, const QList< RelatedClass > &classes)
 
void appendSignature (Text &text, const Node *node)
 Append the signature for the function named in node to text, so that is a link to the documentation for that function.
 
void signatureList (const NodeList &nodes, const Node *relative, CodeMarker *marker)
 Generate a bullet list of function signatures.
 
void addImageToCopy (const ExampleNode *en, const ResolvedFile &resolved_file)
 

Static Protected Member Functions

static QFileopenSubPageFile (const PageNode *node, const QString &fileName)
 Creates the file named fileName in the output directory and returns a QFile pointing to this file.
 
static bool matchAhead (const Atom *atom, Atom::AtomType expectedAtomType)
 
static QString outputPrefix (const Node *node)
 
static QString outputSuffix (const Node *node)
 
static void supplementAlsoList (const Node *node, QList< Text > &alsoList)
 
static QString trimmedTrailing (const QString &string, const QString &prefix, const QString &suffix)
 Trims trailing whitespace off the string and returns the trimmed string.
 
static QString formatSince (const Node *node)
 
static QString getOverloadedSignalCode (const Node *node)
 Returns the string containing an example code of the input node, if it is an overloaded signal.
 
static bool hasExceptions (const Node *node, NodeList &reentrant, NodeList &threadsafe, NodeList &nonreentrant)
 
static bool comparePaths (const QString &a, const QString &b)
 
static bool appendTrademark (const Atom *atom)
 Returns true if a trademark symbol should be appended to the output as determined by atom.
 
static std::optional< std::pair< QString, QString > > cmakeRequisite (const CollectionNode *cn)
 Generate the CMake requisite for the node cn, i.e.
 
static Qt::SortOrder sortOrder (const QString &str)
 

Protected Attributes

QString naturalLanguage
 
QString tagFile_
 
QStack< QTextStream * > outStreamStack
 
FileResolverfile_resolver
 
QDocDatabasem_qdb { nullptr }
 
bool m_inLink { false }
 
bool m_inContents { false }
 
bool m_inSectionHeading { false }
 
bool m_inTableHeader { false }
 
bool m_threeColumnEnumValueTable { true }
 
bool m_showInternal { false }
 
bool m_quoting { false }
 
int m_numTableRows { 0 }
 
QString m_link {}
 
QString m_sectionNumber {}
 

Detailed Description

Definition at line 11 of file generator.h.

Member Enumeration Documentation

◆ Addendum

Enumerator
Invokable 
PrivateSignal 
QmlSignalHandler 
AssociatedProperties 
BindableProperty 

Definition at line 35 of file generator.h.

◆ ListType

Enumerator
Generic 
Obsolete 

Definition at line 33 of file generator.h.

Constructor & Destructor Documentation

◆ Generator() [1/2]

Generator::Generator ( Moc * moc,
ClassDef * classDef,
const QList< QByteArray > & metaTypes,
const QHash< QByteArray, QByteArray > & knownQObjectClasses,
const QHash< QByteArray, QByteArray > & knownGadgets,
FILE * outfile = nullptr,
bool requireCompleteTypes = false )

Definition at line 61 of file generator.cpp.

References Generator().

Referenced by Generator().

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

◆ Generator() [2/2]

Generator::Generator ( FileResolver & file_resolver)

Constructs the generator base class.

Prepends the newly constructed generator to the list of output generators. Sets a pointer to the QDoc database singleton, which is available to the generator subclasses.

Definition at line 76 of file generator.cpp.

References file_resolver.

Referenced by XmlGenerator::XmlGenerator().

+ Here is the caller graph for this function:

◆ ~Generator()

Generator::~Generator ( )
virtual

Destroys the generator after removing it from the list of output generators.

Definition at line 87 of file generator.cpp.

Member Function Documentation

◆ addImageToCopy()

void Generator::addImageToCopy ( const ExampleNode * en,
const ResolvedFile & resolved_file )
protected

Definition at line 866 of file generator.cpp.

References Node< _Tp >::location().

+ Here is the call graph for this function:

◆ appendFullName() [1/2]

void Generator::appendFullName ( Text & text,
const Node * apparentNode,
const Node * relative,
const Node * actualNode = nullptr )
protected

◆ appendFullName() [2/2]

void Generator::appendFullName ( Text & text,
const Node * apparentNode,
const QString & fullName,
const Node * actualNode )
protected

◆ appendSignature()

void Generator::appendSignature ( Text & text,
const Node * node )
protected

Append the signature for the function named in node to text, so that is a link to the documentation for that function.

Definition at line 118 of file generator.cpp.

References Atom::FormattingLeft, Atom::FormattingRight, Atom::LinkNode, Node< _Tp >::SignaturePlain, and Atom::String.

◆ appendSortedNames()

int Generator::appendSortedNames ( Text & text,
const ClassNode * classe,
const QList< RelatedClass > & classes )
protected

Definition at line 146 of file generator.cpp.

◆ appendSortedQmlNames()

int Generator::appendSortedQmlNames ( Text & text,
const Node * base,
const NodeList & subs )
protected

Definition at line 167 of file generator.cpp.

◆ appendTrademark()

bool Generator::appendTrademark ( const Atom * atom)
staticprotected

Returns true if a trademark symbol should be appended to the output as determined by atom.

Trademarks are tracked via the use of the \tm formatting command.

Returns true if:

\list

  • atom is of type Atom::FormattingRight containing ATOM_FORMATTING_TRADEMARK, and
  • The trademarked string is the first appearance on the current sub-page. \endlist

Definition at line 1413 of file generator.cpp.

References Atom::FormattingRight, and Atom::type().

Referenced by WebXMLGenerator::addAtomElements(), and HtmlGenerator::generateAtom().

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

◆ autolinkErrors()

static bool Generator::autolinkErrors ( )
inlinestatic

Definition at line 65 of file generator.h.

Referenced by HtmlGenerator::generateAtom().

+ Here is the caller graph for this function:

◆ beginSubPage()

void Generator::beginSubPage ( const Node * node,
const QString & fileName )
protected

Creates the file named fileName in the output directory.

Attaches a QTextStream to the created file, which is written to all over the place using out().

Definition at line 228 of file generator.cpp.

References Node< _Tp >::isPageNode().

+ Here is the call graph for this function:

◆ canHandleFormat()

virtual bool Generator::canHandleFormat ( const QString & format)
inlinevirtual

Definition at line 46 of file generator.h.

References format().

+ Here is the call graph for this function:

◆ cleanRef()

QString Generator::cleanRef ( const QString & ref,
bool xmlCompliant = false )
static

Clean the given ref to be used as an HTML anchor or an xml:id.

If xmlCompliant is set to true, a stricter process is used, as XML is more rigorous in what it accepts. Otherwise, if xmlCompliant is set to false, the basic HTML transformations are applied.

More specifically, only XML NCNames are allowed (https://www.w3.org/TR/REC-xml-names/#NT-NCName).

Definition at line 373 of file generator.cpp.

◆ cmakeRequisite()

std::optional< std::pair< QString, QString > > Generator::cmakeRequisite ( const CollectionNode * cn)
staticprotected

Generate the CMake requisite for the node cn, i.e.

the the find_package and target_link_libraries calls to use it.

If only cmakepackage is set it will look like

\badcode find_package(Foo REQUIRED) target_link_libraries(mytarget PRIVATE Foo:Foo)

If no cmakepackage is set Qt6 is assumed.

If cmakecomponent is set it will look like

\badcode find_package(Qt6 REQUIRED COMPONENTS Bar) target_link_libraries(mytarget PRIVATE Qt6::Bar)

If cmaketargetitem is set the item in target_link_libraries will be set accordingly

\badcode find_package(Qt6 REQUIRED COMPONENTS Bar) target_link_libraries(mytarget PRIVATE My::Target)

Returns a pair consisting of the find package line and link libraries line.

If no sensible requisite can be created (i.e. both cmakecomponent and cmakepackage are unset) std::nullopt is returned.

Definition at line 2253 of file generator.cpp.

◆ comparePaths()

static bool Generator::comparePaths ( const QString & a,
const QString & b )
inlinestaticprotected

Definition at line 162 of file generator.h.

◆ currentGenerator()

static Generator * Generator::currentGenerator ( )
inlinestatic

Definition at line 57 of file generator.h.

Referenced by fullDocumentLocation().

+ Here is the caller graph for this function:

◆ defaultModuleName()

static QString Generator::defaultModuleName ( )
inlinestatic

Definition at line 66 of file generator.h.

◆ endSubPage()

void Generator::endSubPage ( )
protected

Flush the text stream associated with the subpage, and then pop it off the text stream stack and delete it.

This terminates output of the subpage.

Definition at line 241 of file generator.cpp.

Referenced by WebXMLGenerator::generateCppReferencePage(), generateDocumentation(), HtmlGenerator::generateExampleFilePage(), WebXMLGenerator::generateExampleFilePage(), and WebXMLGenerator::generatePageNode().

+ Here is the caller graph for this function:

◆ exampleFileTitle()

QString Generator::exampleFileTitle ( const ExampleNode * relative,
const QString & fileName )
static

Helper function to construct a title for a file or image page included in an example.

Definition at line 336 of file generator.cpp.

◆ fileBase()

QString Generator::fileBase ( const Node * node) const
virtual

Reimplemented in HtmlGenerator, and WebXMLGenerator.

Definition at line 248 of file generator.cpp.

References Node< _Tp >::hasFileNameBase(), Node< _Tp >::isCollectionNode(), Node< _Tp >::isExample(), Node< _Tp >::isModule(), Node< _Tp >::isPageNode(), Node< _Tp >::isProxyNode(), Node< _Tp >::isQmlModule(), Node< _Tp >::isQmlType(), Node< _Tp >::isTextPageNode(), and Node< _Tp >::parent().

+ Here is the call graph for this function:

◆ fileExtension()

virtual QString Generator::fileExtension ( ) const
nodiscardprotectedpure virtual

◆ fileName()

QString Generator::fileName ( const Node * node,
const QString & extension = QString() ) const
protected

If the node has a URL, return the URL as the file name.

Otherwise, construct the file name from the fileBase() and either the provided extension or fileExtension(), and return the constructed name.

Definition at line 355 of file generator.cpp.

◆ format()

virtual QString Generator::format ( )
pure virtual

Implemented in DocBookGenerator, HtmlGenerator, and WebXMLGenerator.

Referenced by canHandleFormat().

+ Here is the caller graph for this function:

◆ formatSince()

QString Generator::formatSince ( const Node * node)
staticprotected

Definition at line 1107 of file generator.cpp.

◆ formattingLeftMap()

QMap< QString, QString > & Generator::formattingLeftMap ( )
protected

Definition at line 428 of file generator.cpp.

◆ formattingRightMap()

QMap< QString, QString > & Generator::formattingRightMap ( )
protected

Definition at line 433 of file generator.cpp.

◆ fullDocumentLocation()

◆ generateAddendum() [1/2]

virtual void Generator::generateAddendum ( const Node * node,
Addendum type,
CodeMarker * marker )
inlineprotectedvirtual

Definition at line 122 of file generator.h.

References generateAddendum().

Referenced by generateBody().

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

◆ generateAddendum() [2/2]

void Generator::generateAddendum ( const Node * node,
Addendum type,
CodeMarker * marker,
bool generateNote )
protectedvirtual

Generates an addendum note of type type for node, using marker as the code marker.

Reimplemented in DocBookGenerator.

Definition at line 1254 of file generator.cpp.

References AssociatedProperties, Atom::AutoLink, BindableProperty, Atom::DivRight, Atom::FormattingLeft, Atom::FormattingRight, generateText(), Invokable, Node< _Tp >::isFunction(), Atom::Link, Node< _Tp >::nodeNameLessThan(), Atom::ParaLeft, Atom::ParaRight, PrivateSignal, and QmlSignalHandler.

Referenced by generateAddendum().

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

◆ generateAlsoList() [1/2]

virtual void Generator::generateAlsoList ( const Node * node)
inlineprotectedvirtual

Reimplemented in DocBookGenerator.

Definition at line 82 of file generator.h.

References generateAlsoList().

+ Here is the call graph for this function:

◆ generateAlsoList() [2/2]

void Generator::generateAlsoList ( const Node * node,
CodeMarker * marker )
protectedvirtual

Definition at line 565 of file generator.cpp.

References Atom::FormattingLeft, Atom::FormattingRight, generateText(), Atom::ParaLeft, and Atom::ParaRight.

Referenced by generateAlsoList().

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

◆ generateAtom()

virtual qsizetype Generator::generateAtom ( const Atom * ,
const Node * ,
CodeMarker *  )
inlineprotectedvirtual

Reimplemented in DocBookGenerator, HtmlGenerator, and WebXMLGenerator.

Definition at line 83 of file generator.h.

◆ generateAtomList()

const Atom * Generator::generateAtomList ( const Atom * atom,
const Node * relative,
CodeMarker * marker,
bool generate,
int & numGeneratedAtoms )
protected

Definition at line 583 of file generator.cpp.

References Atom::FormatElse, Atom::FormatEndif, Atom::FormatIf, generateAtomList(), Atom::next(), and Atom::type().

Referenced by generateAtomList(), DocBookGenerator::generateText(), and generateText().

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

◆ generateBody()

void Generator::generateBody ( const Node * node,
CodeMarker * marker )
protectedvirtual

Generate the body of the documentation from the qdoc comment found with the entity represented by the node.

Reimplemented in DocBookGenerator.

Definition at line 631 of file generator.cpp.

References AssociatedProperties, BindableProperty, Doc::body(), Node< _Tp >::doc(), generateAddendum(), generateEnumValuesForQmlProperty(), generateRequiredLinks(), generateText(), FunctionNode::hasAssociatedProperties(), Node< _Tp >::hasDoc(), Invokable, FunctionNode::isCAssign(), FunctionNode::isCCtor(), FunctionNode::isCtor(), FunctionNode::isDeprecated(), FunctionNode::isDtor(), Node< _Tp >::isEnumType(), Node< _Tp >::isFunction(), FunctionNode::isIgnored(), FunctionNode::isInvokable(), FunctionNode::isMarkedReimp(), Node< _Tp >::isMarkedReimp(), FunctionNode::isMAssign(), FunctionNode::isMCtor(), FunctionNode::isOverload(), FunctionNode::isPrivateSignal(), Node< _Tp >::isProperty(), FunctionNode::isQmlSignal(), Node< _Tp >::isSharingComment(), FunctionNode::isVirtual(), Node< _Tp >::isWrapper(), Doc::location(), Node< _Tp >::location(), Node< _Tp >::parent(), PrivateSignal, PropertyNode::propertyType(), QmlSignalHandler, FunctionNode::returnsBool(), and PropertyNode::StandardProperty.

Referenced by HtmlGenerator::generateCollectionNode(), HtmlGenerator::generateCppReferencePage(), HtmlGenerator::generatePageNode(), HtmlGenerator::generateProxyPage(), and HtmlGenerator::generateQmlTypePage().

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

◆ generateCode()

◆ generateCollectionNode()

virtual void Generator::generateCollectionNode ( CollectionNode * ,
CodeMarker *  )
inlineprotectedvirtual

Reimplemented in DocBookGenerator, and HtmlGenerator.

Definition at line 89 of file generator.h.

Referenced by generateDocumentation().

+ Here is the caller graph for this function:

◆ generateComparisonCategory()

bool Generator::generateComparisonCategory ( const Node * node,
CodeMarker * marker = nullptr )
protected

Generates text that describes the comparison category of node. The CodeMarker marker is passed along to generateText().

Definition at line 1529 of file generator.cpp.

References Node< _Tp >::comparisonCategory(), and generateText().

Referenced by HtmlGenerator::generateCppReferencePage(), and DocBookGenerator::generateHeader().

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

◆ generateComparisonList()

bool Generator::generateComparisonList ( const Node * node)
protected

Generates a list of types that compare to node with the comparison category that applies for the relationship, followed by (an optional) descriptive text.

Returns true if text was generated, false otherwise.

Definition at line 1554 of file generator.cpp.

References Node< _Tp >::doc(), generateText(), and Text::isEmpty().

Referenced by HtmlGenerator::generateCppReferencePage(), and DocBookGenerator::generateHeader().

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

◆ generateCppReferencePage()

virtual void Generator::generateCppReferencePage ( Aggregate * ,
CodeMarker *  )
inlineprotectedvirtual

Reimplemented in DocBookGenerator, HtmlGenerator, and WebXMLGenerator.

Definition at line 85 of file generator.h.

Referenced by generateDocumentation().

+ Here is the caller graph for this function:

◆ generateDocs()

void Generator::generateDocs ( )
virtual

Traverses the database recursively to generate all the documentation.

Reimplemented in HtmlGenerator.

Definition at line 1643 of file generator.cpp.

References generateDocumentation(), m_qdb, and QDocDatabase::primaryTreeRoot().

Referenced by HtmlGenerator::generateDocs().

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

◆ generateDocumentation()

void Generator::generateDocumentation ( Node * node)
protectedvirtual

Recursive writing of HTML files from the root node.

Reimplemented in DocBookGenerator, and WebXMLGenerator.

Definition at line 961 of file generator.cpp.

References Aggregate::childNodes(), Node< _Tp >::docMustBeGenerated(), endSubPage(), generateCollectionNode(), generateCppReferencePage(), generateGenericCollectionPage(), generatePageNode(), generateProxyPage(), generateQmlTypePage(), Node< _Tp >::isAggregate(), Node< _Tp >::isClassNode(), Node< _Tp >::isCollectionNode(), Node< _Tp >::isExternalPage(), Node< _Tp >::isGenericCollection(), Node< _Tp >::isHeader(), Node< _Tp >::isIndexNode(), Node< _Tp >::isInternal(), Node< _Tp >::isNamespace(), Node< _Tp >::isProxyNode(), Node< _Tp >::isQmlType(), Node< _Tp >::isTextPageNode(), Node< _Tp >::location(), m_qdb, m_showInternal, QDocDatabase::mergeCollections(), Node< _Tp >::parent(), and CollectionNode::wasSeen().

Referenced by generateDocs().

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

◆ generateEnumValuesForQmlProperty()

void Generator::generateEnumValuesForQmlProperty ( const Node * node,
CodeMarker * marker )
protected

Definition at line 2076 of file generator.cpp.

References Node< _Tp >::doc(), QmlPropertyNode::enumNode(), Text::isEmpty(), Node< _Tp >::isQmlProperty(), Atom::ListLeft, and Atom::ListRight.

Referenced by DocBookGenerator::generateBody(), and generateBody().

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

◆ generateExampleFilePage()

virtual void Generator::generateExampleFilePage ( const Node * ,
ResolvedFile ,
CodeMarker * = nullptr )
inlineprotectedvirtual

Reimplemented in DocBookGenerator, HtmlGenerator, and WebXMLGenerator.

Definition at line 80 of file generator.h.

◆ generateFileList()

void Generator::generateFileList ( const ExampleNode * en,
CodeMarker * marker,
bool images )
protectedvirtual

This function is called when the documentation for an example is being formatted.

It outputs a list of files for the example, which can be the example's source files or the list of images used by the example. The images are copied into a subtree of {...doc/html/images/used-in-examples/...}

Definition at line 904 of file generator.cpp.

References OpenedList::OpenedList(), OpenedList::Bullet, Atom::ExampleFileLink, Atom::ExampleImageLink, Atom::ListLeft, Atom::ListRight, Atom::ParaLeft, and Atom::ParaRight.

Referenced by generateRequiredLinks().

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

◆ generateGenericCollectionPage()

virtual void Generator::generateGenericCollectionPage ( CollectionNode * ,
CodeMarker *  )
inlineprotectedvirtual

Reimplemented in DocBookGenerator, and HtmlGenerator.

Definition at line 90 of file generator.h.

Referenced by generateDocumentation().

+ Here is the caller graph for this function:

◆ generateLinkToExample()

void Generator::generateLinkToExample ( const ExampleNode * en,
CodeMarker * marker,
const QString & baseUrl )
protected

Generates an external link to the project folder for example node.

The path to the example replaces a placeholder '\1' character if one is found in the baseUrl string. If no such placeholder is found, the path is appended to baseUrl, after a '/' character if baseUrl did not already end in one.

Definition at line 827 of file generator.cpp.

References Node< _Tp >::doc(), Atom::FormattingLeft, Atom::FormattingRight, generateText(), Atom::Link, Atom::ParaLeft, Atom::ParaRight, and Atom::String.

+ Here is the call graph for this function:

◆ generateNoexceptNote()

void Generator::generateNoexceptNote ( const Node * node,
CodeMarker * marker )
protected

Definition at line 1173 of file generator.cpp.

References Node< _Tp >::isSharedCommentNode().

+ Here is the call graph for this function:

◆ generateOverloadedSignal()

void Generator::generateOverloadedSignal ( const Node * node,
CodeMarker * marker )
protected

If the node is an overloaded signal, add a node with an example on how to connect to it.

Definition at line 1620 of file generator.cpp.

References Atom::Code, Atom::FormattingLeft, Atom::FormattingRight, generateText(), Node< _Tp >::location(), and Atom::ParaLeft.

+ Here is the call graph for this function:

◆ generatePageNode()

virtual void Generator::generatePageNode ( PageNode * ,
CodeMarker *  )
inlineprotectedvirtual

Reimplemented in DocBookGenerator, HtmlGenerator, and WebXMLGenerator.

Definition at line 88 of file generator.h.

Referenced by generateDocumentation().

+ Here is the caller graph for this function:

◆ generateProxyPage()

virtual void Generator::generateProxyPage ( Aggregate * ,
CodeMarker *  )
inlineprotectedvirtual

Reimplemented in DocBookGenerator, and HtmlGenerator.

Definition at line 86 of file generator.h.

Referenced by generateDocumentation().

+ Here is the caller graph for this function:

◆ generateQmlTypePage()

virtual void Generator::generateQmlTypePage ( QmlTypeNode * ,
CodeMarker *  )
inlineprotectedvirtual

Reimplemented in DocBookGenerator, and HtmlGenerator.

Definition at line 87 of file generator.h.

Referenced by generateDocumentation().

+ Here is the caller graph for this function:

◆ generateRequiredLinks()

void Generator::generateRequiredLinks ( const Node * node,
CodeMarker * marker )
protected

Generates either a link to the project folder for example node, or a list of links files/images if 'url.examples config' variable is not defined.

Does nothing for non-example nodes.

Definition at line 802 of file generator.cpp.

References generateFileList(), Node< _Tp >::isExample(), and PageNode::noAutoList().

Referenced by WebXMLGenerator::append(), and generateBody().

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

◆ generateSince()

void Generator::generateSince ( const Node * node,
CodeMarker * marker )
protected

Definition at line 1163 of file generator.cpp.

References generateText().

Referenced by HtmlGenerator::generateCollectionNode(), and HtmlGenerator::generateCppReferencePage().

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

◆ generateStatus()

void Generator::generateStatus ( const Node * node,
CodeMarker * marker )
protected

Definition at line 1198 of file generator.cpp.

References Node< _Tp >::Active, Node< _Tp >::Deprecated, Atom::FormattingLeft, Atom::FormattingRight, generateText(), Node< _Tp >::Internal, Node< _Tp >::isAggregate(), Node< _Tp >::isModule(), Node< _Tp >::isQmlModule(), Node< _Tp >::isQmlNode(), Atom::ParaLeft, Atom::ParaRight, and Node< _Tp >::status().

Referenced by HtmlGenerator::generateCollectionNode(), HtmlGenerator::generateCppReferencePage(), and HtmlGenerator::generateQmlTypePage().

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

◆ generateText() [1/2]

virtual bool Generator::generateText ( const Text & text,
const Node * relative )
inlineprotectedvirtual

Reimplemented in DocBookGenerator.

Definition at line 93 of file generator.h.

References generateText().

+ Here is the call graph for this function:

◆ generateText() [2/2]

bool Generator::generateText ( const Text & text,
const Node * relative,
CodeMarker * marker )
protectedvirtual

Generate the documentation for relative.

i.e. relative is the node that represents the entity where a qdoc comment was found, and text represents the qdoc comment.

Definition at line 1347 of file generator.cpp.

References Text::firstAtom(), generateAtomList(), and initializeTextOutput().

Referenced by generateAddendum(), generateAlsoList(), generateBody(), generateComparisonCategory(), generateComparisonList(), generateLinkToExample(), generateOverloadedSignal(), generateSince(), generateStatus(), generateText(), generateThreadSafeness(), and signatureList().

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

◆ generateThreadSafeness()

void Generator::generateThreadSafeness ( const Node * node,
CodeMarker * marker )
protected

Generates text that explains how threadsafe and/or reentrant node is.

Definition at line 1439 of file generator.cpp.

References Text::clear(), Atom::FormattingLeft, Atom::FormattingRight, generateText(), hasExceptions(), Node< _Tp >::isAggregate(), Atom::Link, Atom::ParaRight, Node< _Tp >::Reentrant, signatureList(), startNote(), Node< _Tp >::ThreadSafe, Node< _Tp >::threadSafeness(), and Node< _Tp >::UnspecifiedSafeness.

Referenced by HtmlGenerator::generateCppReferencePage().

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

◆ generatorForFormat()

Generator * Generator::generatorForFormat ( const QString & format)
static

Definition at line 1649 of file generator.cpp.

◆ getOverloadedSignalCode()

QString Generator::getOverloadedSignalCode ( const Node * node)
staticprotected

Returns the string containing an example code of the input node, if it is an overloaded signal.

Otherwise, returns an empty string.

Definition at line 1587 of file generator.cpp.

References FunctionNode::hasOverloads(), Node< _Tp >::isFunction(), FunctionNode::isSignal(), FunctionNode::parameters(), and Node< _Tp >::parent().

+ Here is the call graph for this function:

◆ hasExceptions()

bool Generator::hasExceptions ( const Node * node,
NodeList & reentrant,
NodeList & threadsafe,
NodeList & nonreentrant )
staticprotected

Definition at line 1368 of file generator.cpp.

References Aggregate::childNodes(), and Node< _Tp >::threadSafeness().

Referenced by DocBookGenerator::generateThreadSafeness(), and generateThreadSafeness().

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

◆ indent()

QString Generator::indent ( int level,
const QString & markedCode )
protected

Definition at line 1658 of file generator.cpp.

◆ initialize()

void Generator::initialize ( )
static

Definition at line 1682 of file generator.cpp.

Referenced by processQdocconfFile().

+ Here is the caller graph for this function:

◆ initializeFormat()

void Generator::initializeFormat ( )
virtual

Reads format-specific variables from config, sets output (sub)directories, creates them on the filesystem and copies the template-specific files.

Definition at line 1803 of file generator.cpp.

References Location::Location(), Config::generating(), m_quoting, Config::preparing(), resetUseOutputSubdirs(), and useOutputSubdirs().

+ Here is the call graph for this function:

◆ initializeGenerator()

void Generator::initializeGenerator ( )
virtual

Updates the generator's m_showInternal from the Config.

Reimplemented in DocBookGenerator, HtmlGenerator, and WebXMLGenerator.

Definition at line 1855 of file generator.cpp.

Referenced by DocBookGenerator::initializeGenerator(), and HtmlGenerator::initializeGenerator().

+ Here is the caller graph for this function:

◆ initializeTextOutput()

void Generator::initializeTextOutput ( )
protected

Resets the variables used during text output.

Definition at line 2013 of file generator.cpp.

References m_inContents, m_inLink, m_inSectionHeading, m_inTableHeader, m_numTableRows, and m_threeColumnEnumValueTable.

Referenced by DocBookGenerator::generateText(), and generateText().

+ Here is the caller graph for this function:

◆ linkForExampleFile()

QString Generator::linkForExampleFile ( const QString & path,
const QString & fileExt = QString() )

Constructs an href link from an example file name, which is a path to the example file.

If fileExt is empty (default value), retrieve the file extension from the generator.

Definition at line 321 of file generator.cpp.

◆ matchAhead()

bool Generator::matchAhead ( const Atom * atom,
Atom::AtomType expectedAtomType )
staticprotected

Definition at line 1860 of file generator.cpp.

References Atom::next(), and Atom::type().

Referenced by DocBookGenerator::generateAtom(), HtmlGenerator::generateAtom(), XmlGenerator::isOneColumnValueTable(), and XmlGenerator::isThreeColumnEnumValueTable().

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

◆ noLinkErrors()

static bool Generator::noLinkErrors ( )
inlinestatic

Definition at line 64 of file generator.h.

Referenced by HtmlGenerator::generateAtom(), and XmlGenerator::linkForNode().

+ Here is the caller graph for this function:

◆ openSubPageFile()

QFile * Generator::openSubPageFile ( const PageNode * node,
const QString & fileName )
staticprotected

Creates the file named fileName in the output directory and returns a QFile pointing to this file.

In particular, this method deals with errors when opening the file: the returned QFile is always valid and can be written to.

See also
beginSubPage()

Definition at line 192 of file generator.cpp.

References Node< _Tp >::location().

+ Here is the call graph for this function:

◆ out()

QTextStream & Generator::out ( )
protected

◆ outFileName()

QString Generator::outFileName ( )
protected

Definition at line 1875 of file generator.cpp.

◆ outputDir()

static const QString & Generator::outputDir ( )
inlinestatic

Definition at line 60 of file generator.h.

◆ outputFileNames()

static const QStringList & Generator::outputFileNames ( )
inlinestatic

Definition at line 63 of file generator.h.

◆ outputPrefix()

QString Generator::outputPrefix ( const Node * node)
staticprotected

Definition at line 1880 of file generator.cpp.

References Node< _Tp >::genus(), Node< _Tp >::isCollectionNode(), and Node< _Tp >::isPageNode().

+ Here is the call graph for this function:

◆ outputSubdir()

static const QString & Generator::outputSubdir ( )
inlinestatic

Definition at line 61 of file generator.h.

◆ outputSuffix()

QString Generator::outputSuffix ( const Node * node)
staticprotected

Definition at line 1896 of file generator.cpp.

References Node< _Tp >::genus(), and Node< _Tp >::isPageNode().

+ Here is the call graph for this function:

◆ parseArg()

bool Generator::parseArg ( const QString & src,
const QString & tag,
int * pos,
int n,
QStringView * contents,
QStringView * par1 = nullptr )
protected

Definition at line 1912 of file generator.cpp.

◆ plainCode()

QString Generator::plainCode ( const QString & markedCode)
static

Definition at line 1988 of file generator.cpp.

◆ qmlTypeContext()

static QmlTypeNode * Generator::qmlTypeContext ( )
inlinestatic

Definition at line 70 of file generator.h.

Referenced by XmlGenerator::linkForNode().

+ Here is the caller graph for this function:

◆ registeredStringsCount()

qsizetype Generator::registeredStringsCount ( )
inline

Definition at line 24 of file generator.h.

◆ resetUseOutputSubdirs()

static void Generator::resetUseOutputSubdirs ( )
inlinestatic

Definition at line 67 of file generator.h.

Referenced by initializeFormat().

+ Here is the caller graph for this function:

◆ setQmlTypeContext()

static void Generator::setQmlTypeContext ( QmlTypeNode * t)
inlinestatic

Definition at line 69 of file generator.h.

Referenced by DocBookGenerator::generateQmlTypePage(), and HtmlGenerator::generateQmlTypePage().

+ Here is the caller graph for this function:

◆ signatureList()

void Generator::signatureList ( const NodeList & nodes,
const Node * relative,
CodeMarker * marker )
protected

Generate a bullet list of function signatures.

The function nodes are in nodes. It uses the relative node and the marker for the generation.

Definition at line 131 of file generator.cpp.

References generateText(), Atom::ListLeft, and Atom::ListRight.

Referenced by generateThreadSafeness().

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

◆ skipAtoms()

int Generator::skipAtoms ( const Atom * atom,
Atom::AtomType type ) const
protectedvirtual

Definition at line 1999 of file generator.cpp.

References Atom::next(), and Atom::type().

Referenced by DocBookGenerator::generateAtom().

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

◆ sortOrder()

static Qt::SortOrder Generator::sortOrder ( const QString & str)
inlinestaticprotected

Definition at line 166 of file generator.h.

◆ supplementAlsoList()

void Generator::supplementAlsoList ( const Node * node,
QList< Text > & alsoList )
staticprotected

Definition at line 2025 of file generator.cpp.

References Node< _Tp >::access(), Atom::FormattingLeft, Atom::FormattingRight, FunctionNode::isDeprecated(), Node< _Tp >::isFunction(), Node< _Tp >::isMacro(), Atom::Link, FunctionNode::overloadNumber(), and Node< _Tp >::parent().

+ Here is the call graph for this function:

◆ terminate()

void Generator::terminate ( )
static

Definition at line 2107 of file generator.cpp.

Referenced by processQdocconfFile().

+ Here is the caller graph for this function:

◆ terminateGenerator()

void Generator::terminateGenerator ( )
virtual

Reimplemented in HtmlGenerator, and WebXMLGenerator.

Definition at line 2144 of file generator.cpp.

Referenced by HtmlGenerator::terminateGenerator().

+ Here is the caller graph for this function:

◆ trimmedTrailing()

QString Generator::trimmedTrailing ( const QString & string,
const QString & prefix,
const QString & suffix )
staticprotected

Trims trailing whitespace off the string and returns the trimmed string.

Definition at line 2150 of file generator.cpp.

◆ typeString()

◆ unknownAtom()

void Generator::unknownAtom ( const Atom * atom)
protected

Definition at line 2215 of file generator.cpp.

Referenced by DocBookGenerator::generateAtom(), and HtmlGenerator::generateAtom().

+ Here is the caller graph for this function:

◆ useOutputSubdirs()

static bool Generator::useOutputSubdirs ( )
inlinestatic

Definition at line 68 of file generator.h.

Referenced by initializeFormat().

+ Here is the caller graph for this function:

Member Data Documentation

◆ file_resolver

FileResolver& Generator::file_resolver
protected

◆ m_inContents

bool Generator::m_inContents { false }
protected

◆ m_inLink

◆ m_inSectionHeading

bool Generator::m_inSectionHeading { false }
protected

◆ m_inTableHeader

bool Generator::m_inTableHeader { false }
protected

◆ m_link

QString Generator::m_link {}
protected

Definition at line 205 of file generator.h.

◆ m_numTableRows

int Generator::m_numTableRows { 0 }
protected

Definition at line 204 of file generator.h.

Referenced by HtmlGenerator::generateAtom(), and initializeTextOutput().

◆ m_qdb

◆ m_quoting

bool Generator::m_quoting { false }
protected

Definition at line 203 of file generator.h.

Referenced by WebXMLGenerator::addAtomElements(), and initializeFormat().

◆ m_sectionNumber

QString Generator::m_sectionNumber {}
protected

Definition at line 206 of file generator.h.

◆ m_showInternal

◆ m_threeColumnEnumValueTable

bool Generator::m_threeColumnEnumValueTable { true }
protected

◆ naturalLanguage

QString Generator::naturalLanguage
protected

Definition at line 143 of file generator.h.

◆ outStreamStack

QStack<QTextStream *> Generator::outStreamStack
protected

Definition at line 145 of file generator.h.

◆ tagFile_

QString Generator::tagFile_
protected

Definition at line 144 of file generator.h.


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