|
1 | NO CONTENT: modified file |
@@ -98,24 +98,26 void ShellImplGenerator::write(QTextStream &s, const AbstractMetaClass *meta_cla | |||
|
98 | 98 | "PythonQtShell_"); |
|
99 | 99 | s << endl << "{" << endl; |
|
100 | 100 | |
|
101 | Option typeOptions = Option(OriginalName | UnderscoreSpaces); | |
|
101 | Option typeOptions = Option(OriginalName | UnderscoreSpaces | SkipName); | |
|
102 | 102 | AbstractMetaArgumentList args = fun->arguments(); |
|
103 | 103 | |
|
104 | 104 | s << "if (_wrapper) {" << endl; |
|
105 | 105 | s << " PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, \"" << fun->name() << "\");" << endl; |
|
106 | 106 | s << " PyErr_Clear();" << endl; |
|
107 | 107 | s << " if (obj && !PythonQtSlotFunction_Check(obj)) {" << endl; |
|
108 | s << " static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromMetaObjectAndSignature(" << endl; | |
|
109 | s << " &" << wrapperClassName(meta_class) << "::staticMetaObject," << endl; | |
|
108 | s << " static const char* argumentList[] ={\""; | |
|
109 | if (hasReturnValue) { | |
|
110 | // write the arguments, return type first | |
|
111 | writeTypeInfo(s, fun->type(), typeOptions); | |
|
112 | } | |
|
110 | 113 |
s << " |
|
111 | // write the signature | |
|
112 | s << fun->name() << "(" << meta_class->qualifiedCppName() << "*"; | |
|
113 | 114 | for (int i = 0; i < args.size(); ++i) { |
|
114 | s << ","; | |
|
115 | s << " , \""; | |
|
115 | 116 | writeTypeInfo(s, args.at(i)->type(), typeOptions); |
|
117 | s << "\""; | |
|
116 | 118 | } |
|
117 |
s << " |
|
|
118 | s << "\");" << endl; | |
|
119 | s << "};" << endl; | |
|
120 | s << " static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(" << QString::number(args.size()+1) << ", argumentList);" << endl; | |
|
119 | 121 | |
|
120 | 122 | if (hasReturnValue) { |
|
121 | 123 | s << " "; |
@@ -134,11 +136,15 void ShellImplGenerator::write(QTextStream &s, const AbstractMetaClass *meta_cla | |||
|
134 | 136 | s << " if (result) {" << endl; |
|
135 | 137 | s << " args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue);" << endl; |
|
136 | 138 | s << " if (args[0]!=&returnValue) {" << endl; |
|
139 | s << " if (args[0]==NULL) {" << endl; | |
|
140 | s << " PythonQt::priv()->handleVirtualOverloadReturnError(\"" << fun->name() << "\", methodInfo, result);" << endl; | |
|
141 | s << " } else {" << endl; | |
|
137 | 142 | s << " returnValue = *(("; |
|
138 | 143 | writeTypeInfo(s, fun->type(), typeOptions); |
|
139 | 144 | s << "*)args[0]);" << endl; |
|
140 | 145 | s << " }" << endl; |
|
141 | 146 | s << " }" << endl; |
|
147 | s << " }" << endl; | |
|
142 | 148 | } |
|
143 | 149 | s << " if (result) { Py_DECREF(result); } " << endl; |
|
144 | 150 | s << " Py_DECREF(obj);" << endl; |
General Comments 0
You need to be logged in to leave comments.
Login now