@@ -123,7 +123,7 @@ void SetupGenerator::generate()
123123 }
124124
125125 // declare individual class creation functions
126- s << " void PythonQt_init_" << shortPackName << " () {" << endl;
126+ s << " void PythonQt_init_" << shortPackName << " (PyObject* module ) {" << endl;
127127
128128 if (shortPackName.endsWith (" Builtin" )) {
129129 shortPackName = shortPackName.mid (0 , shortPackName.length ()-strlen (" builtin" ));
@@ -135,12 +135,14 @@ void SetupGenerator::generate()
135135 QString shellCreator;
136136 if (cls->generateShellClass ()) {
137137 shellCreator = " , PythonQtSetInstanceWrapperOnShell<" + ShellGenerator::shellClassName (cls) + " >" ;
138+ } else {
139+ shellCreator = " , NULL" ;
138140 }
139141 if (cls->isQObject ()) {
140- s << " PythonQt::self ()->registerClass(&" << cls->qualifiedCppName () << " ::staticMetaObject, \" " << shortPackName <<" \" , PythonQtCreateObject<PythonQtWrapper_" << cls->name () << " >" << shellCreator << " );" << endl;
142+ s << " PythonQt::priv ()->registerClass(&" << cls->qualifiedCppName () << " ::staticMetaObject, \" " << shortPackName <<" \" , PythonQtCreateObject<PythonQtWrapper_" << cls->name () << " >" << shellCreator << " , module );" << endl;
141143 } else {
142144 QString baseName = cls->baseClass ()?cls->baseClass ()->qualifiedCppName ():" " ;
143- s << " PythonQt::self ()->registerCPPClass(\" " << cls->qualifiedCppName () << " \" , \" " << baseName << " \" , \" " << shortPackName <<" \" , PythonQtCreateObject<PythonQtWrapper_" << cls->name () << " >" << shellCreator << " );" << endl;
145+ s << " PythonQt::priv ()->registerCPPClass(\" " << cls->qualifiedCppName () << " \" , \" " << baseName << " \" , \" " << shortPackName <<" \" , PythonQtCreateObject<PythonQtWrapper_" << cls->name () << " >" << shellCreator << " , module );" << endl;
144146 }
145147 foreach (AbstractMetaClass* interface, cls->interfaces ()) {
146148 // the interface might be our own class... (e.g. QPaintDevice)
0 commit comments