From f3a1f775eeb4152bd045e69cbcd618d4f462d22f Mon Sep 17 00:00:00 2001 From: Venugopal Shivashankar Date: Tue, 8 Oct 2019 14:11:29 +0200 Subject: Shiboken: QtDoc generator: Handle 'group' tag as a 'page' tag Also, add a title for the resulting rst either using the fullTitle or the title attribute. Change-Id: If8be6a9a6db2cfc86bc4b646159ccc6f2210e243 Reviewed-by: Friedemann Kleint --- sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'sources/shiboken2') diff --git a/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp b/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp index c8bb2fffa..3b6d1c870 100644 --- a/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp +++ b/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp @@ -349,6 +349,7 @@ QtXmlToSphinx::QtXmlToSphinx(QtDocGenerator* generator, const QString& doc, cons m_handlerMap.insert(QLatin1String("skipto"), &QtXmlToSphinx::handleIgnoredTag); m_handlerMap.insert(QLatin1String("target"), &QtXmlToSphinx::handleTargetTag); m_handlerMap.insert(QLatin1String("page"), &QtXmlToSphinx::handlePageTag); + m_handlerMap.insert(QLatin1String("group"), &QtXmlToSphinx::handlePageTag); // useless tags m_handlerMap.insert(QLatin1String("description"), &QtXmlToSphinx::handleUselessTag); @@ -1230,10 +1231,11 @@ void QtXmlToSphinx::handlePageTag(QXmlStreamReader &reader) m_output << rstLabel(title.toString()); const QStringRef fullTitle = reader.attributes().value(fullTitleAttribute()); - if (!fullTitle.isEmpty()) { - const int size = writeEscapedRstText(m_output, fullTitle); - m_output << endl << Pad('*', size) << endl << endl; - } + const int size = fullTitle.isEmpty() + ? writeEscapedRstText(m_output, title) + : writeEscapedRstText(m_output, fullTitle); + + m_output << endl << Pad('*', size) << endl << endl; const QStringRef brief = reader.attributes().value(briefAttribute()); if (!brief.isEmpty()) -- cgit v1.2.3