From 94fe64ed981d6837dfb863e5787c55e029941a90 2010-03-08 13:12:36 From: florianlink Date: 2010-03-08 13:12:36 Subject: [PATCH] fixed some badly generated fields fixed warnings on return types of abstract virtual impls removed generation of static get/setters git-svn-id: svn://svn.code.sf.net/p/pythonqt/code/trunk@155 ea8d5007-eb21-0410-b261-ccb3ea6e24a9 --- diff --git a/generator/shellheadergenerator.cpp b/generator/shellheadergenerator.cpp index ac0fa05..7df2b28 100644 --- a/generator/shellheadergenerator.cpp +++ b/generator/shellheadergenerator.cpp @@ -56,10 +56,14 @@ void ShellHeaderGenerator::writeFieldAccessors(QTextStream &s, const AbstractMet { const AbstractMetaFunction *setter = field->setter(); const AbstractMetaFunction *getter = field->getter(); - - // Uuid data4 did not work + + // static fields are not supported (yet?) + if (setter->isStatic()) return; + + // Uuid data4 did not work (TODO: move to typesystem...( if (field->enclosingClass()->name()=="QUuid" && setter->name()=="data4") return; - + if (field->enclosingClass()->name()=="QIPv6Address") return; + if (!field->type()->isConstant()) { writeFunctionSignature(s, setter, 0, QString(), Option(ConvertReferenceToPtr | FirstArgIsWrappedObject| IncludeDefaultExpression | ShowStatic | UnderscoreSpaces)); diff --git a/generator/shellimplgenerator.cpp b/generator/shellimplgenerator.cpp index fe15da3..5f28e0a 100644 --- a/generator/shellimplgenerator.cpp +++ b/generator/shellimplgenerator.cpp @@ -174,10 +174,13 @@ void ShellImplGenerator::write(QTextStream &s, const AbstractMetaClass *meta_cla if (fun->isAbstract()) { if (fun->type()) { // return empty default object - writeTypeInfo(s, fun->type(), typeOptions); - s << " result;" << endl; - s << "return result"; - s << ";"; + s << "return "; + if (fun->type()->indirections()>0) { + s << "0;"; + } else { + writeTypeInfo(s, fun->type(), typeOptions); + s << "();"; + } } } else { if (fun->type()) {