summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-05-18 14:09:56 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-05-18 13:11:26 +0000
commit6989d6040fb58d62ba4a56983d41d7b065ad4a18 (patch)
treeb0b78a2eb827acd2b03bf76be68d2531a771eb07
parenta977d18c83be3899f6db88840677dfa08d12f27d (diff)
QtXmlToSphinx::transform(): Improve XML error message
Output line and column. Change-Id: Ide890b93c47ef0fc9ebe3209356da100e0cbde4e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r--sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp b/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp
index 74aac832..489d498f 100644
--- a/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp
+++ b/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp
@@ -464,8 +464,10 @@ QString QtXmlToSphinx::transform(const QString& doc)
while (!reader.atEnd()) {
QXmlStreamReader::TokenType token = reader.readNext();
if (reader.hasError()) {
- const QString message = QLatin1String("XML Error: ") + reader.errorString()
- + QLatin1Char('\n') + doc;
+ QString message;
+ QTextStream(&message) << "XML Error "
+ << reader.errorString() << " at " << reader.lineNumber()
+ << ':' << reader.columnNumber() << '\n' << doc;
m_output << INDENT << message;
qCWarning(lcShiboken).noquote().nospace() << message;
break;