aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp
diff options
context:
space:
mode:
authorSimo Fält <simo.falt@qt.io>2023-05-25 11:12:40 +0300
committerSimo Fält <simo.falt@qt.io>2023-05-25 11:12:40 +0300
commitca0519cb3f6b62e3b61ba74f0c60eac891dd3a15 (patch)
tree46e94d1b9a77648ca080a36b7d266f2322031d67 /sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp
parent72d32f66685fbb7fefc41eee629e63f4824cb10b (diff)
parent7c386888b453b7f2ac78ef1da59d077b25e372b3 (diff)
Merge tag 'v5.15.4-lts' into tqtc/lts-5.15-opensourcev5.15.4-lts-lgpl
Qt For Python Release 5.15.4 Change-Id: I8457501ba90fc481fb9de686eb8a2f880ecc06cd
Diffstat (limited to 'sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp')
-rw-r--r--sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp33
1 files changed, 4 insertions, 29 deletions
diff --git a/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp b/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp
index 5e75cbf87..d330d8c18 100644
--- a/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp
+++ b/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp
@@ -1588,30 +1588,6 @@ static void writeInheritedByList(QTextStream& s, const AbstractMetaClass* metaCl
s << classes.join(QLatin1String(", ")) << Qt::endl << Qt::endl;
}
-// Extract the <brief> section from a WebXML (class) documentation and remove it
-// from the source.
-static bool extractBrief(Documentation *sourceDoc, Documentation *brief)
-{
- if (sourceDoc->format() != Documentation::Native)
- return false;
- QString value = sourceDoc->value();
- const int briefStart = value.indexOf(briefStartElement());
- if (briefStart < 0)
- return false;
- const int briefEnd = value.indexOf(briefEndElement(), briefStart + briefStartElement().size());
- if (briefEnd < briefStart)
- return false;
- const int briefLength = briefEnd + briefEndElement().size() - briefStart;
- brief->setFormat(Documentation::Native);
- QString briefValue = value.mid(briefStart, briefLength);
- briefValue.insert(briefValue.size() - briefEndElement().size(),
- QLatin1String("<rst> More_...</rst>"));
- brief->setValue(briefValue);
- value.remove(briefStart, briefLength);
- sourceDoc->setValue(value);
- return true;
-}
-
void QtDocGenerator::generateClass(QTextStream &s, const GeneratorContext &classContext)
{
const AbstractMetaClass *metaClass = classContext.metaClass();
@@ -1630,9 +1606,8 @@ void QtDocGenerator::generateClass(QTextStream &s, const GeneratorContext &class
s << Pad('*', className.count()) << Qt::endl << Qt::endl;
auto documentation = metaClass->documentation();
- Documentation brief;
- if (extractBrief(&documentation, &brief))
- writeFormattedText(s, brief.value(), metaClass);
+ if (documentation.hasBrief())
+ writeFormattedText(s, documentation.value(Documentation::Brief), metaClass);
s << ".. inheritance-diagram:: " << metaClass->fullName() << Qt::endl
<< " :parts: 2" << Qt::endl << Qt::endl;
@@ -1659,7 +1634,7 @@ void QtDocGenerator::generateClass(QTextStream &s, const GeneratorContext &class
writeInjectDocumentation(s, TypeSystem::DocModificationPrepend, metaClass, nullptr);
if (!writeInjectDocumentation(s, TypeSystem::DocModificationReplace, metaClass, nullptr))
- writeFormattedText(s, documentation.value(), metaClass);
+ writeFormattedText(s, documentation.value(Documentation::Detailed), metaClass);
if (!metaClass->isNamespace())
writeConstructors(s, metaClass);
@@ -1972,7 +1947,7 @@ bool QtDocGenerator::writeInjectDocumentation(QTextStream& s,
continue;
doc.setValue(mod.code(), Documentation::Detailed, fmt);
- writeFormattedText(s, doc.value(), cppClass);
+ writeFormattedText(s, doc, cppClass);
didSomething = true;
}
}