[PySide] Cannot pass enum by value

John Cummings jcummings2 at users.sf.net
Wed May 30 19:46:25 CEST 2012

On 05/30/2012 11:33 AM, John Cummings wrote:
> I uncovered a bug with the latest Shiboken when passing an enum by reference.
> Like Nathan, I have a bug report ready to go when the system comes back up.
> In previous versions, you could pass an enum by reference to a method like so:
> class Val
> {
> enum ValEnum { One, Other };
> ValEnum oneOrTheOtherEnumValue(ValEnum&  enumValue) { return enumValue == One ?
> Other : One; }
> }
> You get compilation errors with version 1.1.1 and with HEAD. The generated code
> is trying to use a pointer instead of reference. Previous version of Shiboken
> worked just fine (specifically, 1.0.7 worked, I'm not sure about other versions
> until 1.1.1).
> Unlike Nathan, I don't have a patch ready. The workaround is obviously to pass
> an enum by value not by reference (which is admittedly a bit overkill anyway).
> If someone knows of a better solution, I'm willing to try it.
> John Cummings

Just submitted the bug as PYSIDE-71.

More information about the PySide mailing list