<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
</head>
<body>
Uwe Mayer schrieb:<br>
<blockquote type="cite" cite="mid200402051830.00074.merkosh@hadiko.de">
<pre wrap="">Hi,
I was asked to report this behaviour to the "PyQt Folks" and this is the best
adress I could come up with. :)
Using multiple inheritance with one predecessor being a Qt widget and the
other being a new-style class causes a segmentation fault upon instanciating
the combined child class.
-- example --
from qt import QWidget, QApplication
import sys
class A:
def __init__(self):
print "in A"
class B(object):
def __init__(self):
print "in B"
class C(QWidget,A):
def __init__(self):
QWidget.__init__(self)
A.__init__(self)
print "in C"
class D(QWidget,B):
def __init__(self):
QWidget.__init__(self)
B.__init__(self)
app = QApplication(sys.argv)
C() #works
D() #fails
-- example --
The versions where this behaviour occurs:
Python 2.3.3
</pre>
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">qt.PYQT_BUILD
</pre>
</blockquote>
</blockquote>
</blockquote>
<pre wrap=""><!---->'180'
</pre>
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">qt.PYQT_VERSION
</pre>
</blockquote>
</blockquote>
</blockquote>
<pre wrap=""><!---->198656
</pre>
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">qt.PYQT_VERSION_STR
</pre>
</blockquote>
</blockquote>
</blockquote>
<pre wrap=""><!---->'3.8'
</pre>
</blockquote>
<tt>This seems to work with recent snapshots of SIP and PyQt.<br>
<br>
I use:<br>
<br>
Qt-3.3.0<br>
Python-2.3.3<br>
sip-snapshot-20040205<br>
PyQt-snapshot-20040202<br>
<br>
Tested on Linux.<br>
</tt>
<blockquote type="cite" cite="mid200402051830.00074.merkosh@hadiko.de">
<pre wrap="">
Another thing I'd like to report:
pyuic makes a mistake when compiling the source of Qt Designer interface file
when the widget in the .ui file contains a toolbar with a Spacer object.
pyuic "forgetts" a "self." infront of the Toolbar object:
-- snip --
$ python LMCMain.py
Traceback (most recent call last):
File "LMCMain.py", line 65, in ?
main = LMCMain()
File "LMCMain.py", line 39, in __init__
LMCMainBase.__init__(self, parent, name, fl)
File "/home/merkosh/Projekte/LMC/LMC/GUI/LMCMainBase.py", line 1721, in
__init__
QApplication.sendPostedEvents(Toolbar,QEvent.ChildInserted)
NameError: global name 'Toolbar' is not defined
-- snip --
The lines in question yield:
-- snip2 --
spacer = QSpacerItem(0,0,QSizePolicy.Expanding,QSizePolicy.Minimum)
QApplication.sendPostedEvents(Toolbar,QEvent.ChildInserted)
Toolbar.boxLayout().addItem(spacer)
-- snip2 --
In both cases this should be
spacer = QSpacerItem(0,0,QSizePolicy.Expanding,QSizePolicy.Minimum)
QApplication.sendPostedEvents(self.Toolbar,QEvent.ChildInserted)
self.Toolbar.boxLayout().addItem(spacer)
I hope you will find this information usefull. If you need any other
information, please feel free to contact me.
Not to forgett: Thanks für PyQt!
Ciao
Uwe
_______________________________________________
PyKDE mailing list <a class="moz-txt-link-abbreviated" href="mailto:PyKDE@mats.imk.fraunhofer.de">PyKDE@mats.imk.fraunhofer.de</a>
<a class="moz-txt-link-freetext" href="http://mats.imk.fraunhofer.de/mailman/listinfo/pykde">http://mats.imk.fraunhofer.de/mailman/listinfo/pykde</a>
</pre>
</blockquote>
<tt>With my recent snapshot of PyQt, I get an error message from pyuic:<br>
<br>
</tt><tt>pyuic: File generated with too recent version of Qt Designer
(3.3 vs. 3.3.0)<br>
<br>
</tt><tt><br>
After changing the version from "3.3" to "3.3.0" in the .ui file, I get
the following:<br>
<br>
-- snip --<br>
= QSpacerItem(0,0,QSizePolicy.Expanding,QSizePolicy.Minimum)<br>
QApplication.sendPostedEvents(Toolbar,QEvent.ChildInserted)<br>
Toolbar.boxLayout().addItem()<br>
</tt><tt>-- snip --<br>
</tt><tt><br>
A little bit different, but still a bug.<br>
<br>
<br>
Ulli<br>
</tt><br>
</body>
</html>