Thanks Phil,<br><br>being able to use any Python type as signal arguments it's not quite what I expected. I reckon the overlap with the C++ types had me confused then. <br><br>Regards,<br>Rien<br><br><br><div class="gmail_quote">
On Mon, Jun 7, 2010 at 11:43 PM, Phil Thompson <span dir="ltr"><<a href="mailto:phil@riverbankcomputing.com">phil@riverbankcomputing.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
On Mon, 7 Jun 2010 11:47:40 +0200, Rien Korstanje<br>
<<a href="mailto:rien.korstanje@gmail.com">rien.korstanje@gmail.com</a>><br>
wrote:<br>
<div class="im">> Hello,<br>
><br>
> I think I have identified an integer roll over issue when using PyQt<br>
slots.<br>
> When passing a python long through a signal it comes out as an int.<br>
Please<br>
> see the example below.<br>
><br>
> Is this a bug?<br>
<br>
</div>No. The problem is that int/long in Python is not the same as int/long in<br>
C++. The behaviour is chosen to work as expected most of the time, but you<br>
may hit problems when values start to overflow.<br>
<div class="im"><br>
> If so, is there a workaround?<br>
<br>
</div>You need to specify a C++ type (ie. as a string) that is going to be big<br>
enough...<br>
<br>
barSignal = pyqtSignal('unsigned long long')<br>
<br>
If you want to pass Python longs that won't fit into a C++ type then you<br>
will need to pass them as a Python object...<br>
<br>
barSignal = pyqtSignal('PyQt_PyObject')<br>
<br>
...but that means that you cannot connect to any C++ code that doesn't<br>
handle a PyQt_PyObject.<br>
<font color="#888888"><br>
Phil<br>
</font></blockquote></div><br>