[PyKDE] pyuic3 code generation bug [patch]
Andreas Gerstlauer
gerstl at ics.uci.edu
Tue Oct 23 05:23:47 BST 2001
--nextPart6408108.o76ZdvQCiD
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8Bit
Hi!
There is a small bug in the code generation of the latest pyuic3 (QT3
version) from the CVS (equiv. to PyQT 3.0pre4): when calling the parent in
the constructor of the generated class, the "self" parameter is not passed.
See the attached patch for a fix...
Also, there's another bug in the generated test code ('-x' option): instead
of creating an instance of the class, pyuic generates the following test
code:
w = () (should be something like 'w = NameofClass()')
I don't have a patch for that, however...
Andreas
--nextPart6408108.o76ZdvQCiD
Content-Type: text/x-diff; name="PyQt-cvs.diff"
Content-Transfer-Encoding: 8Bit
Content-Disposition: attachment; filename="PyQt-cvs.diff"
Index: pyuic3/form.cpp
===================================================================
RCS file: /public/PyQt/pyuic3/form.cpp,v
retrieving revision 1.1
diff -u -r1.1 form.cpp
--- pyuic3/form.cpp 2001/10/19 23:34:04 1.1
+++ pyuic3/form.cpp 2001/10/23 03:15:35
@@ -349,21 +349,21 @@
if ( objClass == "QDialog" || objClass == "QWizard" ) {
out << indent << "def __init__(self,parent = None,name = None,modal = 0,fl = 0):" << endl;
++indent;
- out << indent << objClass << ".__init__(parent,name,modal,fl)" << endl;
+ out << indent << objClass << ".__init__(self,parent,name,modal,fl)" << endl;
} else if ( objClass == "QWidget" ) {
out << indent << "def __init__(self,parent = None,name = None,fl = 0)" << endl;
++indent;
- out << indent << objClass << ".__init__(parent,name,fl)" << endl;
+ out << indent << objClass << ".__init__(self,parent,name,fl)" << endl;
} else if ( objClass == "QMainWindow" ) {
out << indent << "def __init__(self,parent = None,name = None,fl = 0)" << endl;
++indent;
- out << indent << objClass << ".__init__(parent,name,fl)" << endl;
+ out << indent << objClass << ".__init__(self,parent,name,fl)" << endl;
out << indent << "self.statusBar()" << endl;
isMainWindow = TRUE;
} else {
out << indent << "def __init__(self,parent = None,name = None)" << endl;
++indent;
- out << indent << objClass << ".__init__(parent,name)" << endl;
+ out << indent << objClass << ".__init__(self,parent,name)" << endl;
}
out << endl;
--nextPart6408108.o76ZdvQCiD--
More information about the PyQt
mailing list