[PyQt] OSX segfault emitting signal with dict argument
Jugdish
jugdizh at gmail.com
Tue Apr 20 18:32:43 BST 2010
I've tested the following bit of code under these 2 setups:
1. Mac OSX 10.6.2 Intel
Python 2.6.5
Qt 4.6.2
PyQt 4.7.2
2. GNU/Linux x64 Fedora 8
Python 2.6.2
Qt 4.6.2
PyQt 4.7
The code runs fine on the Linux setup, but results in a segfault on OSX.
Interestingly, if I declare the signal as pyqtSignal(object) rather than
pyqtSignal(dict), the segfault doesn't happen. Also, if I change the
dictionary's key from an integer to a string, the segfault goes away.
#######################################
from PyQt4 import QtCore
class A(QtCore.QObject):
foo = QtCore.pyqtSignal(dict)
class B(QtCore.QObject):
def doStuff(self, obj):
print "got object", obj
a = A()
b = B()
a.foo.connect(b.doStuff)
a.foo.emit({0: "value"})
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20100420/2cdd3c92/attachment.html>
More information about the PyQt
mailing list