Thanks Phil, 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.
Regards, Rien On Mon, Jun 7, 2010 at 11:43 PM, Phil Thompson <[email protected]>wrote: > On Mon, 7 Jun 2010 11:47:40 +0200, Rien Korstanje > <[email protected]> > wrote: > > Hello, > > > > 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. > > > > Is this a bug? > > No. The problem is that int/long in Python is not the same as int/long in > C++. The behaviour is chosen to work as expected most of the time, but you > may hit problems when values start to overflow. > > > If so, is there a workaround? > > You need to specify a C++ type (ie. as a string) that is going to be big > enough... > > barSignal = pyqtSignal('unsigned long long') > > If you want to pass Python longs that won't fit into a C++ type then you > will need to pass them as a Python object... > > barSignal = pyqtSignal('PyQt_PyObject') > > ...but that means that you cannot connect to any C++ code that doesn't > handle a PyQt_PyObject. > > Phil >
_______________________________________________ PyQt mailing list [email protected] http://www.riverbankcomputing.com/mailman/listinfo/pyqt
