aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/generator/qtdoc/qtxmltosphinx.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken6/generator/qtdoc/qtxmltosphinx.cpp')
-rw-r--r--sources/shiboken6/generator/qtdoc/qtxmltosphinx.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/sources/shiboken6/generator/qtdoc/qtxmltosphinx.cpp b/sources/shiboken6/generator/qtdoc/qtxmltosphinx.cpp
index dba24f2fe..78e91ce93 100644
--- a/sources/shiboken6/generator/qtdoc/qtxmltosphinx.cpp
+++ b/sources/shiboken6/generator/qtdoc/qtxmltosphinx.cpp
@@ -489,10 +489,12 @@ QString QtXmlToSphinx::readFromLocations(const QStringList &locations, const QSt
const QString &identifier, QString *errorMessage)
{
QString resolvedPath;
- if (path.endsWith(QLatin1String(".cpp"))) {
- const QString pySnippet = path.left(path.size() - 3) + QLatin1String("py");
- resolvedPath = resolveFile(locations, pySnippet);
- }
+ // Try Python snippets first.
+ if (path.endsWith(u".cpp"))
+ resolvedPath = resolveFile(locations, path.left(path.size() - 3) + u"py"_qs);
+ else if (path.endsWith(u".h"))
+ resolvedPath = resolveFile(locations, path + u".py"_qs);
+
if (resolvedPath.isEmpty())
resolvedPath = resolveFile(locations, path);
if (resolvedPath.isEmpty()) {