aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/generator
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-04-10 12:49:33 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-04-10 19:48:42 +0000
commit79c170d8bdafb91da30d17a24d00457f2be478b3 (patch)
tree74ef24f46510e4b26339fa8d21ff1d3fce6f38c2 /sources/shiboken2/generator
parent723ed2053aed8b72ae534fcbaea5aaee7f5ea9ba (diff)
shiboken: Remove some special handling for QObject's
For types, QObjects are equivalent to objects, there is no need to differentiate. Remove the code trying to find whether a type is a QObject. Only AbstractMetaClass needs to know whether it inherits QObject. Add a simple check recursing down the base classes. Change-Id: I2365b451c8873f044b06c09b58aff29e2db3c5b7 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken2/generator')
-rw-r--r--sources/shiboken2/generator/generator.cpp2
-rw-r--r--sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp2
-rw-r--r--sources/shiboken2/generator/shiboken2/cppgenerator.cpp1
-rw-r--r--sources/shiboken2/generator/shiboken2/overloaddata.cpp2
-rw-r--r--sources/shiboken2/generator/shiboken2/shibokengenerator.cpp3
5 files changed, 4 insertions, 6 deletions
diff --git a/sources/shiboken2/generator/generator.cpp b/sources/shiboken2/generator/generator.cpp
index 4b76c2d2c..87758e533 100644
--- a/sources/shiboken2/generator/generator.cpp
+++ b/sources/shiboken2/generator/generator.cpp
@@ -538,7 +538,7 @@ bool Generator::isObjectType(const TypeEntry* type)
}
bool Generator::isObjectType(const ComplexTypeEntry* type)
{
- return type->isObject() || type->isQObject();
+ return type->isObject();
}
bool Generator::isObjectType(const AbstractMetaClass* metaClass)
{
diff --git a/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp b/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp
index 05729f4b5..6abfde7c9 100644
--- a/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp
+++ b/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp
@@ -1872,7 +1872,7 @@ QString QtDocGenerator::parseArgDocStyle(const AbstractMetaClass* /* cppClass */
defValue.replace(QLatin1String("::"), QLatin1String("."));
if (defValue == QLatin1String("nullptr"))
defValue = none();
- else if (defValue == QLatin1String("0") && (arg->type()->isQObject() || arg->type()->isObject()))
+ else if (defValue == QLatin1String("0") && arg->type()->isObject())
defValue = none();
}
ret += QLatin1Char('=') + defValue;
diff --git a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
index 79129d6b8..18a032c25 100644
--- a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
+++ b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
@@ -907,7 +907,6 @@ void CppGenerator::writeVirtualMethodNative(QTextStream&s, const AbstractMetaFun
QTextStream ac(&argConv);
const PrimitiveTypeEntry* argType = (const PrimitiveTypeEntry*) arg->type()->typeEntry();
bool convert = argType->isObject()
- || arg->type()->isQObject()
|| argType->isValue()
|| arg->type()->isValuePointer()
|| arg->type()->isNativePointer()
diff --git a/sources/shiboken2/generator/shiboken2/overloaddata.cpp b/sources/shiboken2/generator/shiboken2/overloaddata.cpp
index 9f0ac51e5..becd66879 100644
--- a/sources/shiboken2/generator/shiboken2/overloaddata.cpp
+++ b/sources/shiboken2/generator/shiboken2/overloaddata.cpp
@@ -322,7 +322,7 @@ void OverloadData::sortNextOverloads()
}
// Process inheritance relationships
- if (targetType->isValue() || targetType->isObject() || targetType->isQObject()) {
+ if (targetType->isValue() || targetType->isObject()) {
const AbstractMetaClass *metaClass = AbstractMetaClass::findClass(m_generator->classes(), targetType->typeEntry());
const AbstractMetaClassList &ancestors = m_generator->getAllAncestors(metaClass);
for (const AbstractMetaClass *ancestor : ancestors) {
diff --git a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
index b5069db14..9328e6ba0 100644
--- a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
+++ b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
@@ -729,8 +729,7 @@ QString ShibokenGenerator::getFormatUnitString(const AbstractMetaFunction* func,
if (!func->typeReplaced(arg->argumentIndex() + 1).isEmpty()) {
result += QLatin1Char(objType);
- } else if (arg->type()->isQObject()
- || arg->type()->isObject()
+ } else if (arg->type()->isObject()
|| arg->type()->isValue()
|| arg->type()->isValuePointer()
|| arg->type()->isNativePointer()