aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor/abstractmetalang.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2017-12-01 11:35:41 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2017-12-02 10:44:41 +0000
commit111f11e4d88ed89f961c73b25d48123f28909213 (patch)
treee8f783990cc6cdfe16eac3aa65544f7d8054bf35 /sources/shiboken2/ApiExtractor/abstractmetalang.cpp
parent4462db523fd8afc4177ad58caf1d5a955373bad5 (diff)
shiboken/MetaLang: Add information about override/final
Take over information from code model and test. Change-Id: Ibed2973e09b117966ed241798125f60ba337b0e9 Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/abstractmetalang.cpp')
-rw-r--r--sources/shiboken2/ApiExtractor/abstractmetalang.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/sources/shiboken2/ApiExtractor/abstractmetalang.cpp b/sources/shiboken2/ApiExtractor/abstractmetalang.cpp
index 4827bcb0d..20943696e 100644
--- a/sources/shiboken2/ApiExtractor/abstractmetalang.cpp
+++ b/sources/shiboken2/ApiExtractor/abstractmetalang.cpp
@@ -914,6 +914,21 @@ QString AbstractMetaFunction::minimalSignature() const
return minimalSignature;
}
+QString AbstractMetaFunction::debugSignature() const
+{
+ QString result;
+ const bool isOverride = attributes() & AbstractMetaFunction::OverriddenCppMethod;
+ const bool isFinal = attributes() & AbstractMetaFunction::FinalCppMethod;
+ if (!isOverride && !isFinal && (attributes() & AbstractMetaFunction::VirtualCppMethod))
+ result += QLatin1String("virtual ");
+ result += minimalSignature();
+ if (isOverride)
+ result += QLatin1String(" override");
+ if (isFinal)
+ result += QLatin1String(" final");
+ return result;
+}
+
FunctionModificationList AbstractMetaFunction::modifications(const AbstractMetaClass* implementor) const
{
if (!implementor)
@@ -1203,7 +1218,7 @@ bool function_sorter(AbstractMetaFunction *a, AbstractMetaFunction *b)
#ifndef QT_NO_DEBUG_STREAM
static inline void formatMetaFunctionBrief(QDebug &d, const AbstractMetaFunction *af)
{
- d << '"' << af->minimalSignature() << '"';
+ d << '"' << af->debugSignature() << '"';
}
void AbstractMetaFunction::formatDebugVerbose(QDebug &d) const
@@ -2733,6 +2748,8 @@ QDebug operator<<(QDebug d, const AbstractMetaClass *ac)
d << "AbstractMetaClass(";
if (ac) {
d << '"' << ac->fullName() << '"';
+ if (ac->attributes() & AbstractMetaAttributes::FinalCppClass)
+ d << " [final]";
if (ac->m_baseClass)
d << ", inherits \"" << ac->m_baseClass->name() << '"';
const AbstractMetaEnumList &enums = ac->enums();