diff options
Diffstat (limited to 'src/tools/qdoc/main.cpp')
-rw-r--r-- | src/tools/qdoc/main.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/tools/qdoc/main.cpp b/src/tools/qdoc/main.cpp index 8d35692a88..03974c5d04 100644 --- a/src/tools/qdoc/main.cpp +++ b/src/tools/qdoc/main.cpp @@ -40,6 +40,7 @@ ****************************************************************************/ #include <qglobal.h> +#include <qlibraryinfo.h> #include <stdlib.h> #include "codemarker.h" #include "codeparser.h" @@ -172,6 +173,12 @@ static void processQdocconfFile(const QString &fileName) config.setStringList(CONFIG_NOLINKERRORS, QStringList(noLinkErrors ? "true" : "false")); config.setStringList(CONFIG_OBSOLETELINKS, QStringList(obsoleteLinks ? "true" : "false")); + QString documentationPath = QLibraryInfo::rawLocation(QLibraryInfo::DocumentationPath, + QLibraryInfo::EffectivePaths); + + // Set a few environment variables that can be used from the qdocconf file + qputenv("QT_INSTALL_DOCS", documentationPath.toLatin1()); + /* With the default configuration values in place, load the qdoc configuration file. Note that the configuration @@ -256,6 +263,11 @@ static void processQdocconfFile(const QString &fileName) dependModules += config.getStringList(CONFIG_DEPENDS); + // Allow modules and third-party application/libraries to link + // to the Qt docs without having to explicitly pass --indexdir. + if (!indexDirs.contains(documentationPath)) + indexDirs.append(documentationPath); + if (dependModules.size() > 0) { if (indexDirs.size() > 0) { for (int i = 0; i < indexDirs.size(); i++) { |