[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: [PyKDE] pyuic3 code generation bug [patch]
From: Andreas Gerstlauer <gerstl () ics ! uci ! edu>
Date: 2001-10-23 5:23:47
[Download RAW message or body]
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
["PyQt-cvs.diff" (text/x-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;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic