aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-06-18 14:45:28 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-06-19 11:25:51 +0000
commitf7fc13f86a94c24c4e76626ff8ed6c136077daf9 (patch)
treeeea781d1f93aee23f810c95050408e19178eb9ef
parent6d968dd75567fe281d4a303ae7e882db0bb45ab2 (diff)
shiboken6/Doc generator: Fix continuation dots in code snippets
Properly indent them after ::. Fixes a number of sphinx warnings about "Unexpected indentation" in data visualization examples. Change-Id: I5ebf2df629dda5fba86b7e25a320cbe89e7dfb8b Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 2e573af438e440bb2041370d99b2a2e0147ea65d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--sources/shiboken6/generator/qtdoc/qtxmltosphinx.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/sources/shiboken6/generator/qtdoc/qtxmltosphinx.cpp b/sources/shiboken6/generator/qtdoc/qtxmltosphinx.cpp
index 693904b09..5558c82cd 100644
--- a/sources/shiboken6/generator/qtdoc/qtxmltosphinx.cpp
+++ b/sources/shiboken6/generator/qtdoc/qtxmltosphinx.cpp
@@ -779,13 +779,13 @@ void QtXmlToSphinx::handleDotsTag(QXmlStreamReader& reader)
} else {
m_output << "::\n\n";
}
- Indentation indentation(m_output);
pushOutputBuffer();
- int indent = reader.attributes().value(QLatin1String("indent")).toInt();
+ int indent = reader.attributes().value(QLatin1String("indent")).toInt()
+ + m_output.indentation() * m_output.tabWidth();
for (int i = 0; i < indent; ++i)
m_output << ' ';
} else if (token == QXmlStreamReader::Characters) {
- m_output << reader.text().toString();
+ m_output << reader.text().toString().trimmed();
} else if (token == QXmlStreamReader::EndElement) {
m_output << disableIndent << popOutputBuffer() << "\n\n\n" << enableIndent;
}