[SIP] How to hide helper functions?
Phil Thompson
phil at riverbankcomputing.com
Sat Jul 2 09:34:00 BST 2022
On 02/07/2022 09:09, Weitian Leung wrote:
> I have such situation that want to hide the handwritten functions, for
> example
> struct Foo /Abstract/
> {
> HRESULT get_Count(long *count /Out/) = 0;
> long getCount();
> %MethodCode
> long count = 0;
> sipCpp->get_Count(&count);
> sipRes = count;
> %End
> %Property(name=Count, get=getCount)
> };
> the getCount is not the original interface method, I just want to make
> the get_Count be a property, so write one helper function and use the
> %Property directive.
> But I don't want the user see or call the getCount method directly,
> only the get_Count or Count property is acceptable.
>
> It is possible do that?
No.
> Or is any other way to expose get_Count as a property?
No because the Python Foo.get_Count() will only raise an exception.
Phil
More information about the PyQt
mailing list