Skip to content

Commit b3d895b

Browse files
author
florianlink
committed
fixed some badly generated fields
fixed warnings on return types of abstract virtual impls removed generation of static get/setters git-svn-id: http://svn.code.sf.net/p/pythonqt/code/trunk@155 ea8d5007-eb21-0410-b261-ccb3ea6e24a9
1 parent 09e8cbf commit b3d895b

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

generator/shellheadergenerator.cpp

+7-3
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,14 @@ void ShellHeaderGenerator::writeFieldAccessors(QTextStream &s, const AbstractMet
5656
{
5757
const AbstractMetaFunction *setter = field->setter();
5858
const AbstractMetaFunction *getter = field->getter();
59-
60-
// Uuid data4 did not work
59+
60+
// static fields are not supported (yet?)
61+
if (setter->isStatic()) return;
62+
63+
// Uuid data4 did not work (TODO: move to typesystem...(
6164
if (field->enclosingClass()->name()=="QUuid" && setter->name()=="data4") return;
62-
65+
if (field->enclosingClass()->name()=="QIPv6Address") return;
66+
6367
if (!field->type()->isConstant()) {
6468
writeFunctionSignature(s, setter, 0, QString(),
6569
Option(ConvertReferenceToPtr | FirstArgIsWrappedObject| IncludeDefaultExpression | ShowStatic | UnderscoreSpaces));

generator/shellimplgenerator.cpp

+7-4
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,13 @@ void ShellImplGenerator::write(QTextStream &s, const AbstractMetaClass *meta_cla
174174
if (fun->isAbstract()) {
175175
if (fun->type()) {
176176
// return empty default object
177-
writeTypeInfo(s, fun->type(), typeOptions);
178-
s << " result;" << endl;
179-
s << "return result";
180-
s << ";";
177+
s << "return ";
178+
if (fun->type()->indirections()>0) {
179+
s << "0;";
180+
} else {
181+
writeTypeInfo(s, fun->type(), typeOptions);
182+
s << "();";
183+
}
181184
}
182185
} else {
183186
if (fun->type()) {

0 commit comments

Comments
 (0)