[PyQt] SIP default constructor issue

Phil Thompson phil at riverbankcomputing.com
Sun Feb 5 02:14:43 GMT 2017


On 4 Feb 2017, at 8:20 pm, Kelvin Rodriguez <kr788 at nau.edu> wrote:
> 
> Hi Phil,
> 
> Default constructor isn’t auto generated by the compiler because there already exists a parameterized constructor in the class (just not a default constructor). I am not exposing that parameterized constructor via SIP because I only want to get at BundleImage's attributes (hence why its not in the SIP file). Instances are generated elsewhere in another C++ class. That other class creates instances which is stored as a member variable which we want to access via Python. For our use case we don’t want to create instances directly in Python. 

So, as I said, you need to tell SIP that the C++ ctor doesn't exist. Either specify a private default ctor or use /NoDefaultCtors/.

Phil


More information about the PyQt mailing list