aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/generator
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-03-20 13:41:08 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-03-20 14:47:44 +0000
commite909528a77172bbd129ca08c12a62ba182dcbf8c (patch)
tree9d5477bd11a0196383d99cf408da6596b45c4580 /sources/shiboken2/generator
parentc0863716bf33347089879316d09ac25b62ee89cd (diff)
siboken/Typesystem: Replace double used for versions by QVersionNumber
- Change TypeSystemEntry::m_version from double to QVersionNumber. - Determine version at the beginning of the start element processing of the parser and use that. - Remove AddedFunction::m_version which is not needed. - Remove unused parameter double vr from AbstractMetaBuilderPrivate::translateType(). Change-Id: I2941667ba565f8c11aa0c14446ec7d6934da99dc Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/generator')
-rw-r--r--sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp b/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp
index 7cce97ae1..0465fdf09 100644
--- a/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp
+++ b/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp
@@ -157,6 +157,14 @@ static QTextStream &ensureEndl(QTextStream &s)
return s;
}
+static void formatSince(QTextStream &s, const char *what, const TypeEntry *te)
+{
+ if (te && te->version() > QVersionNumber(0, 0)) {
+ s << ".. note:: This " << what << " was introduced in Qt "
+ << te->version().toString() << '.' << endl;
+ }
+}
+
static QString msgTagWarning(const QXmlStreamReader &reader, const QString &context,
const QString &tag, const QString &message)
{
@@ -1368,8 +1376,7 @@ void QtDocGenerator::generateClass(QTextStream &s, GeneratorContext &classContex
writeInheritedByList(s, metaClass, classes());
- if (metaClass->typeEntry() && (metaClass->typeEntry()->version() != 0))
- s << ".. note:: This class was introduced in Qt " << metaClass->typeEntry()->version() << endl;
+ formatSince(s, "class", metaClass->typeEntry());
writeFunctionList(s, metaClass);
@@ -1490,9 +1497,7 @@ void QtDocGenerator::writeEnums(QTextStream& s, const AbstractMetaClass* cppClas
for (AbstractMetaEnum *en : enums) {
s << section_title << getClassTargetFullName(cppClass) << '.' << en->name() << endl << endl;
writeFormattedText(s, en->documentation(), cppClass);
-
- if (en->typeEntry() && (en->typeEntry()->version() != 0))
- s << ".. note:: This enum was introduced or modified in Qt " << en->typeEntry()->version() << endl;
+ formatSince(s, "enum", en->typeEntry());
}
}
@@ -1807,8 +1812,7 @@ void QtDocGenerator::writeFunction(QTextStream& s, bool writeDoc, const Abstract
writeFunctionSignature(s, cppClass, func);
s << endl;
- if (func->typeEntry() && (func->typeEntry()->version() != 0))
- s << ".. note:: This method was introduced in Qt " << func->typeEntry()->version() << endl;
+ formatSince(s, "method", func->typeEntry());
if (writeDoc) {
s << endl;