summaryrefslogtreecommitdiff
path: root/src/qdoc/cppcodeparser.cpp
diff options
context:
space:
mode:
authorVenugopal Shivashankar <Venugopal.Shivashankar@qt.io>2019-02-26 12:54:02 +0100
committerVenugopal Shivashankar <Venugopal.Shivashankar@qt.io>2019-03-12 14:15:24 +0000
commit369bbbfb5aca70a7d1f8a32bd36a3d3c41721ffa (patch)
treecf226280d2659a1e4337b6ad82751910d16bfaf7 /src/qdoc/cppcodeparser.cpp
parent177b92c4d499b6ffc5986d7c46c8c3c98d08f130 (diff)
downloadqttools-369bbbfb5aca70a7d1f8a32bd36a3d3c41721ffa.tar.gz
qdoc: Add support for documenting pyside examples
At the moment, qdoc cannot generate documentation for python examples as it expects a .pro or .qmlproject file for every \example command it finds. Since Qt Creator v4.9, developers can create a python project using the New Project wizard, which means qdoc could use the .pyproject file to verify the python example. Change-Id: Idcecdffe4f798bd1409123f988e3b826247aed72 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Martin Smith <martin.smith@qt.io>
Diffstat (limited to 'src/qdoc/cppcodeparser.cpp')
-rw-r--r--src/qdoc/cppcodeparser.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/qdoc/cppcodeparser.cpp b/src/qdoc/cppcodeparser.cpp
index cc077f440..a4fb0fd93 100644
--- a/src/qdoc/cppcodeparser.cpp
+++ b/src/qdoc/cppcodeparser.cpp
@@ -909,12 +909,19 @@ void CppCodeParser::setExampleFileLists(PageNode *pn)
exampleDirs,
proFileName);
if (fullPath.isEmpty()) {
- QString details = QLatin1String("Example directories: ") + exampleDirs.join(QLatin1Char(' '));
- if (!exampleFiles.isEmpty())
- details += QLatin1String(", example files: ") + exampleFiles.join(QLatin1Char(' '));
- pn->location().warning(tr("Cannot find file '%1' or '%2'").arg(tmp).arg(proFileName), details);
- pn->location().warning(tr(" EXAMPLE PATH DOES NOT EXIST: %1").arg(examplePath), details);
- return;
+ proFileName = examplePath + QLatin1Char('/') + examplePath.split(QLatin1Char('/')).last() + ".pyproject";
+ fullPath = Config::findFile(pn->doc().location(),
+ exampleFiles,
+ exampleDirs,
+ proFileName);
+ if (fullPath.isEmpty()) {
+ QString details = QLatin1String("Example directories: ") + exampleDirs.join(QLatin1Char(' '));
+ if (!exampleFiles.isEmpty())
+ details += QLatin1String(", example files: ") + exampleFiles.join(QLatin1Char(' '));
+ pn->location().warning(tr("Cannot find file '%1' or '%2'").arg(tmp).arg(proFileName), details);
+ pn->location().warning(tr(" EXAMPLE PATH DOES NOT EXIST: %1").arg(examplePath), details);
+ return;
+ }
}
}
}