aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <[email protected]>2024-09-27 10:16:51 +0200
committerFriedemann Kleint <[email protected]>2024-09-27 23:13:04 +0200
commit2ae76e777d7cc8305b515099b24ce5627171b5b9 (patch)
tree1c546a7efe73a6835956d68e78f2956a64a4c7a8
parenta8717d612eb17c3dfaaede46c7bda34e5c20125e (diff)
shiboken6/Documentation: Introduce a doc-package typesystem attribute
Make it possible to specify an alternate doc-package for locating the WebXML files generated by qdoc. For example the documentation of the QtMultimediaWidgets module is generated into the QtMultimedia module. This became a problem after the module split qttools/c51980bb0d9658f2ade4de1900d07b08e88cb52d. Task-number: QTBUG-77650 Task-number: PYSIDE-2620 Task-number: PYSIDE-1106 Change-Id: I09ab50f7e3b56c0a7d0f2e94e593a8d5e83b2001 Reviewed-by: Cristian Maureira-Fredes <[email protected]>
-rw-r--r--sources/pyside6/PySide6/Qt3DAnimation/typesystem_3danimation.xml2
-rw-r--r--sources/pyside6/PySide6/Qt3DCore/typesystem_3dcore.xml2
-rw-r--r--sources/pyside6/PySide6/Qt3DExtras/typesystem_3dextras.xml2
-rw-r--r--sources/pyside6/PySide6/Qt3DInput/typesystem_3dinput.xml2
-rw-r--r--sources/pyside6/PySide6/Qt3DLogic/typesystem_3dlogic.xml2
-rw-r--r--sources/pyside6/PySide6/Qt3DRender/typesystem_3drender.xml2
-rw-r--r--sources/pyside6/PySide6/QtGraphsWidgets/typesystem_graphswidgets.xml2
-rw-r--r--sources/pyside6/PySide6/QtMultimediaWidgets/typesystem_multimediawidgets.xml2
-rw-r--r--sources/pyside6/PySide6/QtQuickWidgets/typesystem_quickwidgets.xml2
-rw-r--r--sources/pyside6/PySide6/QtSvgWidgets/typesystem_svgwidgets.xml2
-rw-r--r--sources/pyside6/PySide6/QtTest/typesystem_test.xml2
-rw-r--r--sources/pyside6/PySide6/QtWebEngineCore/typesystem_webenginecore.xml2
-rw-r--r--sources/pyside6/PySide6/QtWebEngineQuick/typesystem_webenginequick.xml2
-rw-r--r--sources/pyside6/PySide6/QtWebEngineWidgets/typesystem_webenginewidgets.xml2
-rw-r--r--sources/shiboken6/ApiExtractor/qtdocparser.cpp51
-rw-r--r--sources/shiboken6/ApiExtractor/typedatabase.cpp5
-rw-r--r--sources/shiboken6/ApiExtractor/typedatabase.h1
-rw-r--r--sources/shiboken6/ApiExtractor/typesystem.cpp19
-rw-r--r--sources/shiboken6/ApiExtractor/typesystemparser.cpp6
-rw-r--r--sources/shiboken6/ApiExtractor/typesystemtypeentry.h4
-rw-r--r--sources/shiboken6/doc/typesystem_specifying_types.rst9
21 files changed, 101 insertions, 22 deletions
diff --git a/sources/pyside6/PySide6/Qt3DAnimation/typesystem_3danimation.xml b/sources/pyside6/PySide6/Qt3DAnimation/typesystem_3danimation.xml
index 61af82d6d..c905bfbf2 100644
--- a/sources/pyside6/PySide6/Qt3DAnimation/typesystem_3danimation.xml
+++ b/sources/pyside6/PySide6/Qt3DAnimation/typesystem_3danimation.xml
@@ -4,7 +4,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-->
-<typesystem package="PySide6.Qt3DAnimation"
+<typesystem package="PySide6.Qt3DAnimation" doc-package="PySide6.Qt3D"
namespace-begin="QT_BEGIN_NAMESPACE" namespace-end="QT_END_NAMESPACE">
<load-typesystem name="Qt3DRender/typesystem_3drender.xml" generate="no"/>
<namespace-type name="Qt3DAnimation">
diff --git a/sources/pyside6/PySide6/Qt3DCore/typesystem_3dcore.xml b/sources/pyside6/PySide6/Qt3DCore/typesystem_3dcore.xml
index 985c459b6..9cb6e7f4c 100644
--- a/sources/pyside6/PySide6/Qt3DCore/typesystem_3dcore.xml
+++ b/sources/pyside6/PySide6/Qt3DCore/typesystem_3dcore.xml
@@ -4,7 +4,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-->
-<typesystem package="PySide6.Qt3DCore"
+<typesystem package="PySide6.Qt3DCore" doc-package="PySide6.Qt3D"
namespace-begin="QT_BEGIN_NAMESPACE" namespace-end="QT_END_NAMESPACE">
<load-typesystem name="QtGui/typesystem_gui.xml" generate="no"/>
<smart-pointer-type name="QSharedPointer" type="shared" getter="data"
diff --git a/sources/pyside6/PySide6/Qt3DExtras/typesystem_3dextras.xml b/sources/pyside6/PySide6/Qt3DExtras/typesystem_3dextras.xml
index d281ae15f..e385311e6 100644
--- a/sources/pyside6/PySide6/Qt3DExtras/typesystem_3dextras.xml
+++ b/sources/pyside6/PySide6/Qt3DExtras/typesystem_3dextras.xml
@@ -4,7 +4,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-->
-<typesystem package="PySide6.Qt3DExtras"
+<typesystem package="PySide6.Qt3DExtras" doc-package="PySide6.Qt3D"
namespace-begin="QT_BEGIN_NAMESPACE" namespace-end="QT_END_NAMESPACE">
<load-typesystem name="Qt3DRender/typesystem_3drender.xml" generate="no"/>
<namespace-type name="Qt3DExtras">
diff --git a/sources/pyside6/PySide6/Qt3DInput/typesystem_3dinput.xml b/sources/pyside6/PySide6/Qt3DInput/typesystem_3dinput.xml
index fbdfc5961..2cec25a9f 100644
--- a/sources/pyside6/PySide6/Qt3DInput/typesystem_3dinput.xml
+++ b/sources/pyside6/PySide6/Qt3DInput/typesystem_3dinput.xml
@@ -4,7 +4,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-->
-<typesystem package="PySide6.Qt3DInput"
+<typesystem package="PySide6.Qt3DInput" doc-package="PySide6.Qt3D"
namespace-begin="QT_BEGIN_NAMESPACE" namespace-end="QT_END_NAMESPACE">
<load-typesystem name="Qt3DCore/typesystem_3dcore.xml" generate="no"/>
<namespace-type name="Qt3DInput">
diff --git a/sources/pyside6/PySide6/Qt3DLogic/typesystem_3dlogic.xml b/sources/pyside6/PySide6/Qt3DLogic/typesystem_3dlogic.xml
index 60f362534..9c91627c6 100644
--- a/sources/pyside6/PySide6/Qt3DLogic/typesystem_3dlogic.xml
+++ b/sources/pyside6/PySide6/Qt3DLogic/typesystem_3dlogic.xml
@@ -4,7 +4,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-->
-<typesystem package="PySide6.Qt3DLogic"
+<typesystem package="PySide6.Qt3DLogic" doc-package="PySide6.Qt3D"
namespace-begin="QT_BEGIN_NAMESPACE" namespace-end="QT_END_NAMESPACE">
<load-typesystem name="Qt3DCore/typesystem_3dcore.xml" generate="no"/>
<namespace-type name="Qt3DLogic">
diff --git a/sources/pyside6/PySide6/Qt3DRender/typesystem_3drender.xml b/sources/pyside6/PySide6/Qt3DRender/typesystem_3drender.xml
index 66fd70927..580587827 100644
--- a/sources/pyside6/PySide6/Qt3DRender/typesystem_3drender.xml
+++ b/sources/pyside6/PySide6/Qt3DRender/typesystem_3drender.xml
@@ -4,7 +4,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-->
-<typesystem package="PySide6.Qt3DRender"
+<typesystem package="PySide6.Qt3DRender" doc-package="PySide6.Qt3D"
namespace-begin="QT_BEGIN_NAMESPACE" namespace-end="QT_END_NAMESPACE">
<load-typesystem name="Qt3DCore/typesystem_3dcore.xml" generate="no"/>
<load-typesystem name="QtGui/typesystem_gui.xml" generate="no"/>
diff --git a/sources/pyside6/PySide6/QtGraphsWidgets/typesystem_graphswidgets.xml b/sources/pyside6/PySide6/QtGraphsWidgets/typesystem_graphswidgets.xml
index 8450e7540..806903ac5 100644
--- a/sources/pyside6/PySide6/QtGraphsWidgets/typesystem_graphswidgets.xml
+++ b/sources/pyside6/PySide6/QtGraphsWidgets/typesystem_graphswidgets.xml
@@ -3,7 +3,7 @@
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-->
-<typesystem package="PySide6.QtGraphsWidgets"
+<typesystem package="PySide6.QtGraphsWidgets" doc-package="PySide6.QtGraphs"
namespace-begin="QT_BEGIN_NAMESPACE" namespace-end="QT_END_NAMESPACE">
<load-typesystem name="QtQuickWidgets/typesystem_quickwidgets.xml" generate="no" />
diff --git a/sources/pyside6/PySide6/QtMultimediaWidgets/typesystem_multimediawidgets.xml b/sources/pyside6/PySide6/QtMultimediaWidgets/typesystem_multimediawidgets.xml
index 05b4e2456..c20f5c644 100644
--- a/sources/pyside6/PySide6/QtMultimediaWidgets/typesystem_multimediawidgets.xml
+++ b/sources/pyside6/PySide6/QtMultimediaWidgets/typesystem_multimediawidgets.xml
@@ -3,7 +3,7 @@
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-->
-<typesystem package="PySide6.QtMultimediaWidgets"
+<typesystem package="PySide6.QtMultimediaWidgets" doc-package="PySide6.QtMultimedia"
namespace-begin="QT_BEGIN_NAMESPACE" namespace-end="QT_END_NAMESPACE">
<load-typesystem name="QtCore/typesystem_core.xml" generate="no"/>
<load-typesystem name="QtGui/typesystem_gui.xml" generate="no"/>
diff --git a/sources/pyside6/PySide6/QtQuickWidgets/typesystem_quickwidgets.xml b/sources/pyside6/PySide6/QtQuickWidgets/typesystem_quickwidgets.xml
index 4f4484cb0..410ae2d21 100644
--- a/sources/pyside6/PySide6/QtQuickWidgets/typesystem_quickwidgets.xml
+++ b/sources/pyside6/PySide6/QtQuickWidgets/typesystem_quickwidgets.xml
@@ -3,7 +3,7 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-->
-<typesystem package="PySide6.QtQuickWidgets"
+<typesystem package="PySide6.QtQuickWidgets" doc-package="PySide6.QtQuick"
namespace-begin="QT_BEGIN_NAMESPACE" namespace-end="QT_END_NAMESPACE">
<load-typesystem name="QtCore/typesystem_core.xml" generate="no"/>
<load-typesystem name="QtGui/typesystem_gui.xml" generate="no"/>
diff --git a/sources/pyside6/PySide6/QtSvgWidgets/typesystem_svgwidgets.xml b/sources/pyside6/PySide6/QtSvgWidgets/typesystem_svgwidgets.xml
index 36bda1ea3..b9271427d 100644
--- a/sources/pyside6/PySide6/QtSvgWidgets/typesystem_svgwidgets.xml
+++ b/sources/pyside6/PySide6/QtSvgWidgets/typesystem_svgwidgets.xml
@@ -3,7 +3,7 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-->
-<typesystem package="PySide6.QtSvgWidgets"
+<typesystem package="PySide6.QtSvgWidgets" doc-package="PySide6.QtSvg"
namespace-begin="QT_BEGIN_NAMESPACE" namespace-end="QT_END_NAMESPACE">
<load-typesystem name="QtSvg/typesystem_svg.xml" generate="no"/>
<load-typesystem name="QtWidgets/typesystem_widgets.xml" generate="no"/>
diff --git a/sources/pyside6/PySide6/QtTest/typesystem_test.xml b/sources/pyside6/PySide6/QtTest/typesystem_test.xml
index 2fc4f23cd..173392f3b 100644
--- a/sources/pyside6/PySide6/QtTest/typesystem_test.xml
+++ b/sources/pyside6/PySide6/QtTest/typesystem_test.xml
@@ -3,7 +3,7 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-->
-<typesystem package="PySide6.QtTest"
+<typesystem package="PySide6.QtTest" doc-package="PySide6.QtTestlib"
namespace-begin="QT_BEGIN_NAMESPACE" namespace-end="QT_END_NAMESPACE">
<load-typesystem name="QtCore/typesystem_core.xml" generate="no"/>
<load-typesystem name="QtGui/typesystem_gui.xml" generate="no"/>
diff --git a/sources/pyside6/PySide6/QtWebEngineCore/typesystem_webenginecore.xml b/sources/pyside6/PySide6/QtWebEngineCore/typesystem_webenginecore.xml
index 3cfa7e616..1f2e9c790 100644
--- a/sources/pyside6/PySide6/QtWebEngineCore/typesystem_webenginecore.xml
+++ b/sources/pyside6/PySide6/QtWebEngineCore/typesystem_webenginecore.xml
@@ -3,7 +3,7 @@
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-->
-<typesystem package="PySide6.QtWebEngineCore"
+<typesystem package="PySide6.QtWebEngineCore" doc-package="PySide6.QtWebEngine"
namespace-begin="QT_BEGIN_NAMESPACE" namespace-end="QT_END_NAMESPACE">
<load-typesystem name="QtCore/typesystem_core.xml" generate="no"/>
<load-typesystem name="QtGui/typesystem_gui.xml" generate="no"/>
diff --git a/sources/pyside6/PySide6/QtWebEngineQuick/typesystem_webenginequick.xml b/sources/pyside6/PySide6/QtWebEngineQuick/typesystem_webenginequick.xml
index 326e21212..3d383337b 100644
--- a/sources/pyside6/PySide6/QtWebEngineQuick/typesystem_webenginequick.xml
+++ b/sources/pyside6/PySide6/QtWebEngineQuick/typesystem_webenginequick.xml
@@ -3,7 +3,7 @@
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-->
-<typesystem package="PySide6.QtWebEngineQuick"
+<typesystem package="PySide6.QtWebEngineQuick" doc-package="PySide6.QtWebEngine"
namespace-begin="QT_BEGIN_NAMESPACE" namespace-end="QT_END_NAMESPACE">
<load-typesystem name="QtQml/typesystem_qml.xml" generate="no"/>
<load-typesystem name="QtWebEngineCore/typesystem_webenginecore.xml" generate="no"/>
diff --git a/sources/pyside6/PySide6/QtWebEngineWidgets/typesystem_webenginewidgets.xml b/sources/pyside6/PySide6/QtWebEngineWidgets/typesystem_webenginewidgets.xml
index 61874856b..cfcdbe886 100644
--- a/sources/pyside6/PySide6/QtWebEngineWidgets/typesystem_webenginewidgets.xml
+++ b/sources/pyside6/PySide6/QtWebEngineWidgets/typesystem_webenginewidgets.xml
@@ -3,7 +3,7 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-->
-<typesystem package="PySide6.QtWebEngineWidgets"
+<typesystem package="PySide6.QtWebEngineWidgets" doc-package="PySide6.QtWebEngine"
namespace-begin="QT_BEGIN_NAMESPACE" namespace-end="QT_END_NAMESPACE">
<load-typesystem name="QtCore/typesystem_core.xml" generate="no"/>
<load-typesystem name="QtGui/typesystem_gui.xml" generate="no"/>
diff --git a/sources/shiboken6/ApiExtractor/qtdocparser.cpp b/sources/shiboken6/ApiExtractor/qtdocparser.cpp
index b0de9041e..a1875f567 100644
--- a/sources/shiboken6/ApiExtractor/qtdocparser.cpp
+++ b/sources/shiboken6/ApiExtractor/qtdocparser.cpp
@@ -9,6 +9,7 @@
#include "abstractmetalang.h"
#include "abstractmetatype.h"
#include "documentation.h"
+#include "exception.h"
#include "modifications.h"
#include "messages.h"
#include "propertyspec.h"
@@ -17,11 +18,14 @@
#include "complextypeentry.h"
#include "functiontypeentry.h"
#include "enumtypeentry.h"
+#include "typesystemtypeentry.h"
+#include "typedatabase.h"
#include "qtcompat.h"
#include <QtCore/QDir>
#include <QtCore/QFile>
+#include <QtCore/QHash>
#include <QtCore/QUrl>
using namespace Qt::StringLiterals;
@@ -37,16 +41,49 @@ Documentation QtDocParser::retrieveModuleDocumentation()
return retrieveModuleDocumentation(packageName());
}
+// Return the package of a type "PySide6.QtGui.QPainter" -> "PySide6.QtGui"
+static QStringView packageFromPythonType(QStringView pythonType)
+{
+ qsizetype pos = pythonType.startsWith(u"PySide6.") ? 8 : 0;
+ auto dot = pythonType.indexOf(u'.', pos);
+ return dot != -1 ? pythonType.sliced(0, dot) : pythonType;
+}
+
// Return the qdoc dir "PySide6.QtGui.QPainter" -> "qtgui/webxml" (QTBUG-119500)
+static QString qdocModuleDirFromPackage(QStringView package)
+{
+ if (package.startsWith(u"PySide6."))
+ package = package.sliced(8);
+ return package.toString().toLower() + "/webxml"_L1;
+}
+
+// Populate a cache of package to WebXML dir
+static QHash<QString, QString> getPackageToModuleDir()
+{
+ QHash<QString, QString> result;
+ const auto &typeSystemEntries = TypeDatabase::instance()->typeSystemEntries();
+ for (const auto &te : typeSystemEntries) {
+ const QString &package = te->name();
+ const QString &docPackage = te->hasDocTargetLangPackage()
+ ? te->docTargetLangPackage() : package;
+ result.insert(package, qdocModuleDirFromPackage(docPackage));
+ }
+ return result;
+}
+
QString QtDocParser::qdocModuleDir(const QString &pythonType)
{
- QString package = pythonType;
- if (package.startsWith("PySide6."_L1))
- package.remove(0, 8);
- auto dot = package.indexOf(u'.');
- if (dot != -1)
- package.truncate(dot);
- return package.toLower() + "/webxml"_L1;
+ static const QHash<QString, QString> packageToModuleDir = getPackageToModuleDir();
+
+ const QStringView package = packageFromPythonType(pythonType);
+ const auto it = packageToModuleDir.constFind(package);
+ if (it == packageToModuleDir.cend()) {
+ const QString known = packageToModuleDir.keys().join(", "_L1);
+ qCWarning(lcShibokenDoc, "Type from unknown package: \"%s\" (known: %s).",
+ qPrintable(pythonType), qPrintable(known));
+ return qdocModuleDirFromPackage(package);
+ }
+ return it.value();
}
static QString xmlFileNameRoot(const AbstractMetaClassPtr &metaClass)
diff --git a/sources/shiboken6/ApiExtractor/typedatabase.cpp b/sources/shiboken6/ApiExtractor/typedatabase.cpp
index 6753ac9fb..8ad7ebbdf 100644
--- a/sources/shiboken6/ApiExtractor/typedatabase.cpp
+++ b/sources/shiboken6/ApiExtractor/typedatabase.cpp
@@ -543,6 +543,11 @@ QString TypeDatabase::loadedTypeSystemNames() const
return result;
}
+QList<TypeSystemTypeEntryCPtr> TypeDatabase::typeSystemEntries() const
+{
+ return d->m_typeSystemEntries;
+}
+
TypeSystemTypeEntryCPtr TypeDatabasePrivate::defaultTypeSystemType() const
{
return m_typeSystemEntries.value(0, nullptr);
diff --git a/sources/shiboken6/ApiExtractor/typedatabase.h b/sources/shiboken6/ApiExtractor/typedatabase.h
index d5adca324..cf7db5163 100644
--- a/sources/shiboken6/ApiExtractor/typedatabase.h
+++ b/sources/shiboken6/ApiExtractor/typedatabase.h
@@ -104,6 +104,7 @@ public:
TypeSystemTypeEntryCPtr findTypeSystemType(const QString &name) const;
TypeSystemTypeEntryCPtr defaultTypeSystemType() const;
QString loadedTypeSystemNames() const;
+ QList<TypeSystemTypeEntryCPtr > typeSystemEntries() const;
QString defaultPackageName() const;
TypeEntryPtr findType(const QString &name) const;
diff --git a/sources/shiboken6/ApiExtractor/typesystem.cpp b/sources/shiboken6/ApiExtractor/typesystem.cpp
index 55fd1d993..e7796c062 100644
--- a/sources/shiboken6/ApiExtractor/typesystem.cpp
+++ b/sources/shiboken6/ApiExtractor/typesystem.cpp
@@ -669,6 +669,7 @@ public:
QString m_subModuleOf;
QString m_namespaceBegin;
QString m_namespaceEnd;
+ QString m_docTargetLangPackage;
};
TypeSystemTypeEntry::TypeSystemTypeEntry(const QString &entryName, const QVersionNumber &vr,
@@ -718,6 +719,24 @@ void TypeSystemTypeEntry::setSubModule(const QString &s)
d->m_subModuleOf = s;
}
+bool TypeSystemTypeEntry::hasDocTargetLangPackage() const
+{
+ S_D(const TypeSystemTypeEntry);
+ return !d->m_docTargetLangPackage.isEmpty();
+}
+
+QString TypeSystemTypeEntry::docTargetLangPackage() const
+{
+ S_D(const TypeSystemTypeEntry);
+ return d->m_docTargetLangPackage;
+}
+
+void TypeSystemTypeEntry::setDocTargetLangPackage(const QString &p)
+{
+ S_D(TypeSystemTypeEntry);
+ d->m_docTargetLangPackage = p;
+}
+
const QString &TypeSystemTypeEntry::namespaceBegin() const
{
S_D(const TypeSystemTypeEntry);
diff --git a/sources/shiboken6/ApiExtractor/typesystemparser.cpp b/sources/shiboken6/ApiExtractor/typesystemparser.cpp
index cce614d29..8b54062de 100644
--- a/sources/shiboken6/ApiExtractor/typesystemparser.cpp
+++ b/sources/shiboken6/ApiExtractor/typesystemparser.cpp
@@ -88,6 +88,7 @@ constexpr auto pyiTypeAttribute = "pyi-type"_L1;
constexpr auto overloadNumberAttribute = "overload-number"_L1;
constexpr auto ownershipAttribute = "owner"_L1;
constexpr auto packageAttribute = "package"_L1;
+constexpr auto docPackageAttribute = "doc-package"_L1;
constexpr auto polymorphicBaseAttribute = "polymorphic-base"_L1;
constexpr auto positionAttribute = "position"_L1;
constexpr auto preferredConversionAttribute = "preferred-conversion"_L1;
@@ -2094,11 +2095,14 @@ TypeSystemTypeEntryPtr TypeSystemParser::parseRootElement(const ConditionalStrea
QString subModuleOf;
QString namespaceBegin;
QString namespaceEnd;
+ QString docPackage;
for (auto i = attributes->size() - 1; i >= 0; --i) {
const auto name = attributes->at(i).qualifiedName();
if (name == packageAttribute) {
m_defaultPackage = attributes->takeAt(i).value().toString();
+ } else if (name == docPackageAttribute) {
+ docPackage = attributes->takeAt(i).value().toString();
} else if (name == defaultSuperclassAttribute) {
m_defaultSuperclass = attributes->takeAt(i).value().toString();
} else if (name == exceptionHandlingAttribute) {
@@ -2152,6 +2156,8 @@ TypeSystemTypeEntryPtr TypeSystemParser::parseRootElement(const ConditionalStrea
currentParentTypeEntry()));
moduleEntry->setSubModule(subModuleOf);
}
+ if (!docPackage.isEmpty())
+ moduleEntry->setDocTargetLangPackage(docPackage);
moduleEntry->setCodeGeneration(m_generate);
moduleEntry->setSnakeCase(snakeCase);
if (!namespaceBegin.isEmpty())
diff --git a/sources/shiboken6/ApiExtractor/typesystemtypeentry.h b/sources/shiboken6/ApiExtractor/typesystemtypeentry.h
index 9b9670696..ec5f978f1 100644
--- a/sources/shiboken6/ApiExtractor/typesystemtypeentry.h
+++ b/sources/shiboken6/ApiExtractor/typesystemtypeentry.h
@@ -27,6 +27,10 @@ public:
QString subModuleOf() const;
void setSubModule(const QString &);
+ bool hasDocTargetLangPackage() const;
+ QString docTargetLangPackage() const;
+ void setDocTargetLangPackage(const QString &p);
+
const QString &namespaceBegin() const;
void setNamespaceBegin(const QString &n);
diff --git a/sources/shiboken6/doc/typesystem_specifying_types.rst b/sources/shiboken6/doc/typesystem_specifying_types.rst
index 3ae36492c..92b64efbb 100644
--- a/sources/shiboken6/doc/typesystem_specifying_types.rst
+++ b/sources/shiboken6/doc/typesystem_specifying_types.rst
@@ -49,7 +49,8 @@ It can have a number of attributes, described below.
exception-handling="..."
snake-case="yes | no | both"
namespace-begin="..."
- namespace-end="..." >
+ namespace-end="..."
+ doc-package="..." >
</typesystem>
The **package** attribute is a string describing the package to be used,
@@ -86,6 +87,12 @@ to allow for linking several versions of them together.
For example, for *Qt*, one would specify ``QT_BEGIN_NAMESPACE``,
``QT_END_NAMESPACE``, respectively.
+The *optional* attribute **doc-package** specifies an alternate package name
+for the documentation. This is used for finding the ``qdoc`` or ``doxygen``
+files for the documentation generation. It is mainly relevant for Qt where for
+example the documentation of the ``QtMultimediaWidgets`` module is generated
+into the ``QtMultimedia`` module.
+
.. _load-typesystem:
load-typesystem