Hello,<br><br>I think I have identified an integer roll over issue when using PyQt slots. When passing a python long through a signal it comes out as an int. Please see the example below. <br><br>Is this a bug? If so, is there a workaround?<br>
<br>Regards,<br>Rien Korstanje<br><br>---<br><br>&#39;&#39;&#39;<br>Demonstrates an integer overflow in pyqt signals with <br>Python 2.6.5 and PyQt-Py2.6-gpl-4.7.3-2.<br><br>When the button is pressed, a signal is emitted with as argument <br>
maxint + 1. Yet the slot receiving this signal gets minint.  <br><br>Expected output:<br><br>Value that goes in 2147483648<br>Value that comes out -2147483648<br><br>Created on 7 Jun 2010<br><br>@author: M.P. Korstanje<br>
&#39;&#39;&#39;<br>import sys<br><br>from PyQt4.QtCore import *<br>from PyQt4.QtGui import *<br><br><br>class Foo(QPushButton):<br><br>    barSignal = pyqtSignal((long,),)<br><br>    def __init__(self, parent=None):<br>        super(Foo, self).__init__(&quot;Click!&quot;, parent)<br>
<br>        self.clicked.connect(self.__emitBarSignal)<br>        self.barSignal.connect(self.barSlot)<br>    <br>    def __emitBarSignal(self):<br>        longValue = long(sys.maxint + 1)<br>        print &quot;Value that goes in %s&quot; % str(longValue)<br>
        self.barSignal.emit(longValue)<br>    <br>    @pyqtSlot(long)<br>    def barSlot(self, value):<br>        print &quot;Value that comes out %s&quot; % str(value)<br><br>if __name__ == &#39;__main__&#39;:<br><br>    app = QApplication(sys.argv)<br>
    foo = Foo()<br>    foo.show()<br>    sys.exit(app.exec_())<br>