![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
The Config class contains the configuration variables for controlling how qdoc produces documentation. More...
#include <config.h>
Classes | |
struct | ExcludedPaths |
struct | HeaderFilePath |
Public Types | |
enum | QDocPass { Neither , Prepare , Generate } |
enum | PathFlags : unsigned char { None = 0x0 , Validate = 0x1 , IncludePaths = 0x2 } |
Flags used for retrieving canonicalized paths from Config. More... | |
Public Member Functions | |
~Config () | |
void | init (const QString &programName, const QStringList &args) |
Initializes the Config with programName and sets all internal state variables to either default values or to ones defined in command line arguments args. | |
bool | getDebug () const |
bool | getAtomsDump () const |
bool | showInternal () const |
void | clear () |
Clears the location and internal maps for config variables. | |
void | reset () |
Resets the Config instance - used by load() | |
void | load (const QString &fileName) |
Loads and parses the qdoc configuration file fileName. | |
void | setStringList (const QString &var, const QStringList &values) |
Sets the values of a configuration variable var from a string list. | |
void | insertStringList (const QString &var, const QStringList &values) |
Adds the values from a string list to the configuration variable var. | |
void | showHelp (int exitCode=0) |
QStringList | qdocFiles () const |
const QString & | programName () const |
const Location & | location () const |
const ConfigVar & | get (const QString &var) const |
QString | getOutputDir (const QString &format=QString("HTML")) const |
Function to return the correct outputdir for the output format. | |
QSet< QString > | getOutputFormats () const |
Function to return the correct outputformats. | |
QStringList | getCanonicalPathList (const QString &var, PathFlags flags=None) const |
Returns a path list where all paths from the config variable var are canonicalized. | |
QRegularExpression | getRegExp (const QString &var) const |
Calls getRegExpList() with the control variable var and iterates through the resulting list of regular expressions, concatenating them with extra characters to form a single QRegularExpression, which is then returned. | |
QList< QRegularExpression > | getRegExpList (const QString &var) const |
Looks up the configuration variable var in the string list map, converts the string list to a list of regular expressions, and returns it. | |
QSet< QString > | subVars (const QString &var) const |
This function is slower than it could be. | |
QStringList | getAllFiles (const QString &filesVar, const QString &dirsVar, const QSet< QString > &excludedDirs=QSet< QString >(), const QSet< QString > &excludedFiles=QSet< QString >()) |
Builds and returns a list of file pathnames for the file type specified by filesVar (e.g. | |
QString | getIncludeFilePath (const QString &fileName) const |
Searches for a path to fileName in 'sources', 'sourcedirs', and 'exampledirs' config variables and returns a full path to the first match found. | |
QStringList | getExampleQdocFiles (const QSet< QString > &excludedDirs, const QSet< QString > &excludedFiles) |
QStringList | getExampleImageFiles (const QSet< QString > &excludedDirs, const QSet< QString > &excludedFiles) |
QString | getExampleProjectFile (const QString &examplePath) |
Returns the path to the project file for examplePath, or an empty string if no project file was found. | |
bool | singleExec () const |
bool | dualExec () const |
QStringList & | defines () |
QStringList & | dependModules () |
QStringList & | includePaths () |
QStringList & | indexDirs () |
QString | currentDir () const |
void | setCurrentDir (const QString &path) |
QString | previousCurrentDir () const |
void | setPreviousCurrentDir (const QString &path) |
void | setQDocPass (const QDocPass &pass) |
bool | preparing () const |
bool | generating () const |
const ExcludedPaths & | getExcludedPaths () |
std::set< HeaderFilePath > | getHeaderFiles () |
![]() | |
int | thing () const |
Singleton (const Singleton &)=delete | |
Singleton (QObject *parent=nullptr) | |
Singleton & | operator= (const Singleton &)=delete |
void | setThing (int v) |
![]() | |
Q_INVOKABLE | QObject (QObject *parent=nullptr) |
Constructs an object with parent object parent. | |
virtual | ~QObject () |
Destroys the object, deleting all its child objects. | |
virtual bool | event (QEvent *event) |
This virtual function receives events to an object and should return true if the event e was recognized and processed. | |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
Filters events if this object has been installed as an event filter for the watched object. | |
QString | objectName () const |
Q_WEAK_OVERLOAD void | setObjectName (const QString &name) |
Sets the object's name to name. | |
void | setObjectName (QAnyStringView name) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
QBindable< QString > | bindableObjectName () |
bool | isWidgetType () const |
Returns true if the object is a widget; otherwise returns false . | |
bool | isWindowType () const |
Returns true if the object is a window; otherwise returns false . | |
bool | isQuickItemType () const |
Returns true if the object is a QQuickItem; otherwise returns false . | |
bool | signalsBlocked () const noexcept |
Returns true if signals are blocked; otherwise returns false . | |
bool | blockSignals (bool b) noexcept |
If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). | |
QThread * | thread () const |
Returns the thread in which the object lives. | |
bool | moveToThread (QThread *thread QT6_DECL_NEW_OVERLOAD_TAIL) |
Changes the thread affinity for this object and its children and returns true on success. | |
int | startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer) |
This is an overloaded function that will start a timer of type timerType and a timeout of interval milliseconds. | |
int | startTimer (std::chrono::nanoseconds time, Qt::TimerType timerType=Qt::CoarseTimer) |
void | killTimer (int id) |
Kills the timer with timer identifier, id. | |
void | killTimer (Qt::TimerId id) |
template<typename T> | |
T | findChild (QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
Returns the child of this object that can be cast into type T and that is called name, or \nullptr if there is no such object. | |
template<typename T> | |
QList< T > | findChildren (QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. | |
template<typename T> | |
T | findChild (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<typename T> | |
QList< T > | findChildren (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
const QObjectList & | children () const |
Returns a list of child objects. | |
void | setParent (QObject *parent) |
Makes the object a child of parent. | |
void | installEventFilter (QObject *filterObj) |
Installs an event filter filterObj on this object. | |
void | removeEventFilter (QObject *obj) |
Removes an event filter object obj from this object. | |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const |
bool | disconnect (const char *signal=nullptr, const QObject *receiver=nullptr, const char *member=nullptr) const |
bool | disconnect (const QObject *receiver, const char *member=nullptr) const |
void | dumpObjectTree () const |
Dumps a tree of children to the debug output. | |
void | dumpObjectInfo () const |
Dumps information about signal connections, etc. | |
bool | setProperty (const char *name, const QVariant &value) |
Sets the value of the object's name property to value. | |
bool | setProperty (const char *name, QVariant &&value) |
QVariant | property (const char *name) const |
Returns the value of the object's name property. | |
QList< QByteArray > | dynamicPropertyNames () const |
QBindingStorage * | bindingStorage () |
const QBindingStorage * | bindingStorage () const |
QObject * | parent () const |
Returns a pointer to the parent object. | |
bool | inherits (const char *classname) const |
Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false . | |
Static Public Member Functions | |
static QStringList | loadMaster (const QString &fileName) |
fileName is a master qdocconf file. | |
static bool | isFileExcluded (const QString &fileName, const QSet< QString > &excludedFiles) |
static QStringList | getFilesHere (const QString &dir, const QString &nameFilter, const Location &location=Location(), const QSet< QString > &excludedDirs=QSet< QString >(), const QSet< QString > &excludedFiles=QSet< QString >()) |
static QString | findFile (const Location &location, const QStringList &files, const QStringList &dirs, const QString &fileName, QString *userFriendlyFilePath=nullptr) |
fileName is the path of the file to find. | |
static QString | copyFile (const Location &location, const QString &sourceFilePath, const QString &userFriendlySourceFilePath, const QString &targetDirPath) |
Copies the sourceFilePath to the file name constructed by concatenating targetDirPath and the file name from the userFriendlySourceFilePath. | |
static int | numParams (const QString &value) |
Finds the largest unicode digit in value in the range 1..7 and returns it. | |
static void | pushWorkingDir (const QString &dir) |
Set dir as the working directory and push it onto the stack of working directories. | |
static void | popWorkingDir () |
Pop the top entry from the stack of working directories. | |
![]() | |
static Config & | instance () |
![]() | |
static QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection) |
\threadsafe | |
static QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection) |
template<typename Func1, typename Func2> | |
static QMetaObject::Connection | connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::ContextTypeForFunctor< Func2 >::ContextType *context, Func2 &&slot, Qt::ConnectionType type=Qt::AutoConnection) |
template<typename Func1, typename Func2> | |
static QMetaObject::Connection | connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 &&slot) |
static bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member) |
\threadsafe | |
static bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member) |
static bool | disconnect (const QMetaObject::Connection &) |
Disconnect a connection. | |
template<typename Func1, typename Func2> | |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot) |
template<typename Func1> | |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *receiver, void **zero) |
Static Public Attributes | |
static const QString | dot = QLatin1String(".") |
static bool | generateExamples = true |
static QString | installDir |
static QString | overrideOutputDir |
static QSet< QString > | overrideOutputFormats |
Additional Inherited Members | |
![]() | |
void | deleteLater () |
\threadsafe | |
![]() | |
void | thingChanged () |
![]() | |
void | destroyed (QObject *=nullptr) |
This signal is emitted immediately before the object obj is destroyed, after any instances of QPointer have been notified, and cannot be blocked. | |
void | objectNameChanged (const QString &objectName, QPrivateSignal) |
This signal is emitted after the object's name has been changed. | |
![]() | |
Singleton ()=default | |
![]() | |
QObject * | sender () const |
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns \nullptr. | |
int | senderSignalIndex () const |
int | receivers (const char *signal) const |
Returns the number of receivers connected to the signal. | |
bool | isSignalConnected (const QMetaMethod &signal) const |
virtual void | timerEvent (QTimerEvent *event) |
This event handler can be reimplemented in a subclass to receive timer events for the object. | |
virtual void | childEvent (QChildEvent *event) |
This event handler can be reimplemented in a subclass to receive child events. | |
virtual void | customEvent (QEvent *event) |
This event handler can be reimplemented in a subclass to receive custom events. | |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
QObject (QObjectPrivate &dd, QObject *parent=nullptr) | |
![]() | |
QScopedPointer< QObjectData > | d_ptr |
![]() | |
int | thing |
![]() | |
QString | objectName |
the name of this object | |
![]() | |
template< class T > T | qobject_cast (const QObject *object) |
Returns the given object cast to type T if the object is of type T (or of a subclass); otherwise returns \nullptr. | |
template< typename T > T | qFindChildqFindChildren (const QObject *obj, const QString &name)() |
template< typename T > QList< T > | qFindChildrenqFindChildren (const QObject *obj, const QString &name)() |
QObjectList | |
\macro Q_CLASSINFO(Name, Value) | |
The Config class contains the configuration variables for controlling how qdoc produces documentation.
Its load() function reads, parses, and processes a qdocconf file.
enum Config::PathFlags : unsigned char |
Flags used for retrieving canonicalized paths from Config.
\value Validate Issue a warning for paths that do not exist and remove them from the returned list.
\value IncludePaths Assume the variable contains include paths with prefixes such as {-I} that are to be removed before canonicalizing and then re-inserted.
\omitvalue None
Enumerator | |
---|---|
None | |
Validate | |
IncludePaths |
enum Config::QDocPass |
Config::~Config | ( | ) |
Definition at line 345 of file config.cpp.
References clear().
void Config::clear | ( | ) |
Clears the location and internal maps for config variables.
Definition at line 353 of file config.cpp.
Referenced by ~Config(), and reset().
|
static |
Copies the sourceFilePath to the file name constructed by concatenating targetDirPath and the file name from the userFriendlySourceFilePath.
location is for identifying the file and line number where a qdoc error occurred. The constructed output file name is returned.
Definition at line 946 of file config.cpp.
|
inline |
|
inline |
|
inlinenodiscard |
Definition at line 411 of file config.h.
Referenced by processQdocconfFile().
|
static |
fileName is the path of the file to find.
files and dirs are the lists where we must find the components of fileName.
location is used for obtaining the file and line numbers for report qdoc errors.
Definition at line 862 of file config.cpp.
|
inlinenodiscard |
Definition at line 182 of file config.h.
References Generate.
Referenced by HtmlGenerator::generateDocs(), and Generator::initializeFormat().
QStringList Config::getAllFiles | ( | const QString & | filesVar, |
const QString & | dirsVar, | ||
const QSet< QString > & | excludedDirs = QSet<QString>(), | ||
const QSet< QString > & | excludedFiles = QSet<QString>() ) |
Builds and returns a list of file pathnames for the file type specified by filesVar (e.g.
"headers" or "sources"). The files are found in the directories specified by dirsVar, and they are filtered by defaultNameFilter if a better filter can't be constructed from filesVar. The directories in excludedDirs are avoided. The files in excludedFiles are not included in the return list.
Definition at line 764 of file config.cpp.
|
nodiscard |
Returns a path list where all paths from the config variable var are canonicalized.
If flags contains Validate
, outputs a warning for invalid paths. The IncludePaths
flag is used as a hint to strip away potential prefixes found in include paths before attempting to canonicalize.
Definition at line 607 of file config.cpp.
|
inlinenodiscard |
Definition at line 108 of file config.h.
Referenced by processQdocconfFile().
QStringList Config::getExampleImageFiles | ( | const QSet< QString > & | excludedDirs, |
const QSet< QString > & | excludedFiles ) |
Definition at line 790 of file config.cpp.
Returns the path to the project file for examplePath, or an empty string if no project file was found.
Definition at line 813 of file config.cpp.
QStringList Config::getExampleQdocFiles | ( | const QSet< QString > & | excludedDirs, |
const QSet< QString > & | excludedFiles ) |
Definition at line 778 of file config.cpp.
const Config::ExcludedPaths & Config::getExcludedPaths | ( | ) |
Definition at line 1407 of file config.cpp.
Referenced by getHeaderFiles(), and processQdocconfFile().
|
static |
Definition at line 1346 of file config.cpp.
std::set< Config::HeaderFilePath > Config::getHeaderFiles | ( | ) |
Definition at line 1422 of file config.cpp.
References getExcludedPaths().
Searches for a path to fileName in 'sources', 'sourcedirs', and 'exampledirs' config variables and returns a full path to the first match found.
If the file is not found, returns an empty string.
Definition at line 726 of file config.cpp.
Function to return the correct outputdir for the output format.
If format is not specified, defaults to 'HTML'. outputdir can be set using the qdocconf or the command-line variable -outputdir.
Definition at line 553 of file config.cpp.
Function to return the correct outputformats.
outputformats can be set using the qdocconf or the command-line variable -outputformat.
Definition at line 578 of file config.cpp.
|
nodiscard |
Calls getRegExpList() with the control variable var and iterates through the resulting list of regular expressions, concatenating them with extra characters to form a single QRegularExpression, which is then returned.
Definition at line 668 of file config.cpp.
|
nodiscard |
Looks up the configuration variable var in the string list map, converts the string list to a list of regular expressions, and returns it.
Definition at line 690 of file config.cpp.
|
inline |
|
inline |
void Config::init | ( | const QString & | programName, |
const QStringList & | args ) |
Initializes the Config with programName and sets all internal state variables to either default values or to ones defined in command line arguments args.
Definition at line 338 of file config.cpp.
References reset().
void Config::insertStringList | ( | const QString & | var, |
const QStringList & | values ) |
Adds the values from a string list to the configuration variable var.
Existing value(s) are kept.
Definition at line 474 of file config.cpp.
|
static |
Definition at line 1334 of file config.cpp.
Loads and parses the qdoc configuration file fileName.
If a previous project was loaded, this function first resets the Config instance. Then it calls the other load() function, which does the loading, parsing, and processing of the configuration file.
Definition at line 405 of file config.cpp.
References reset().
|
static |
fileName is a master qdocconf file.
It contains a list of qdocconf files and nothing else. Read the list and return it.
Definition at line 1059 of file config.cpp.
|
inlinenodiscard |
Definition at line 121 of file config.h.
Referenced by processQdocconfFile().
|
static |
Finds the largest unicode digit in value in the range 1..7 and returns it.
Definition at line 1034 of file config.cpp.
|
static |
Pop the top entry from the stack of working directories.
Set the working directory to the next one on the stack, if one exists.
Definition at line 1399 of file config.cpp.
|
inlinenodiscard |
Definition at line 181 of file config.h.
References Prepare.
Referenced by HtmlGenerator::generateDocs(), Generator::initializeFormat(), and processQdocconfFile().
|
inlinenodiscard |
|
inlinenodiscard |
Set dir as the working directory and push it onto the stack of working directories.
Definition at line 1388 of file config.cpp.
|
inlinenodiscard |
void Config::reset | ( | ) |
void Config::setStringList | ( | const QString & | var, |
const QStringList & | values ) |
Sets the values of a configuration variable var from a string list.
Definition at line 465 of file config.cpp.
|
inlinenodiscard |
Definition at line 406 of file config.h.
Referenced by Location::initialize(), and processQdocconfFile().
This function is slower than it could be.
What it does is find all the keys that begin with var + dot and return the matching keys in a set, stripped of the matching prefix and dot.
Definition at line 705 of file config.cpp.
|
static |
Definition at line 162 of file config.h.
Referenced by processQdocconfFile().
|
static |
Definition at line 164 of file config.h.
Referenced by CppCodeParser::processTopicCommand().