[PyQt] Pointer Attribute

Jay L. jlaura at asu.edu
Wed Oct 26 23:51:26 BST 2016


Thanks for the suggestion to use the Force version.  Much cleaner.

Inside of %SetCode, it does not appear that the sipErr variable is
available.  I tried simply replacing the argument with `int err;` and then
`*err` in the signature.  Still segfaulting.

Any other suggestions of what to check?  My next test will be to move this
code into get and set methods to have access to sipErr, but perhaps
something else could be causing this?

(The previous code is unchanged except the final arg 0 is replaced with
*err.)

Thanks for the assistance,
J

On Wed, Oct 26, 2016 at 2:53 PM, Phil Thompson <phil at riverbankcomputing.com>
wrote:

> On 26 Oct 2016, at 6:39 pm, Jay L. <jlaura at asu.edu> wrote:
> >
> > Phil,
> >
> > Thanks for the pointers.  Here is the resultant code.
> >
> > I have added the check for length and am now allocating the h_data array
> on the heap.  I have not added error check for any previous array, but the
> point is appreciated.
> >
> > In the below code, I am segfaulting on the sipConvertToType call and am
> not sure why.  The sipTypePoint definition is the lowest code block.  I do
> not have any TypeCode defined for the SiftPoint, but all of the types are
> standard so I think custom code is not needed there?
> >
> >
> > The small debug block (commented out) is working as a replacement for
> the sipConvertToType call.
>
> The last argument to sipConvertToType() cannot be 0.
>
> Also using sipForceConvertToType() is less code.
>
> Phil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20161026/6f1466c3/attachment.html>


More information about the PyQt mailing list