[PyQt] sip bug wrapping protected enum in ABC
Phil Thompson
phil at riverbankcomputing.com
Tue Mar 22 09:04:28 GMT 2011
On Tue, 22 Mar 2011 02:42:37 +0000, Demetrius Cassidy
<dcassidy36 at gmail.com> wrote:
> With a simple class definition like the following, it seems that SIP
tries
> to wrap SIPTransaction::States using a sip generated class, but of
course
> that class is not created for ABCs. I am using the latest SIP snapshot,
SIP
> 4.12.2-snapshot-ecb3e795382e, to test this code.
>
>
> class SIPTransaction /Abstract/
> {
> public:
> ~SIPTransaction();
> virtual SIPTransaction * CreateDuplicate() const = 0;
>
> protected:
>
> enum States {
> NotStarted,
> Trying,
> Proceeding,
> Cancelling,
> Completed,
> Terminated_Success,
> Terminated_Timeout,
> Terminated_RetriesExceeded,
> Terminated_TransportError,
> Terminated_Cancelled,
> Terminated_Aborted,
> NumStates
> };
>
> virtual void SetTerminated(States newState);
> };
>
>
> Offending generated code:
>
> static sipEnumMemberDef enummembers_SIPTransaction[] = {
> {sipName_Cancelling, sipSIPTransaction::Cancelling, 241},
> {sipName_Completed, sipSIPTransaction::Completed, 241},
> {sipName_NotStarted, sipSIPTransaction::NotStarted, 241},
> {sipName_NumStates, sipSIPTransaction::NumStates, 241},
> {sipName_Proceeding, sipSIPTransaction::Proceeding, 241},
> {sipName_Terminated_Aborted, sipSIPTransaction::Terminated_Aborted,
241},
> {sipName_Terminated_Cancelled, sipSIPTransaction::Terminated_Cancelled,
> 241},
> {sipName_Terminated_RetriesExceeded,
> sipSIPTransaction::Terminated_RetriesExceeded, 241},
> {sipName_Terminated_Success, sipSIPTransaction::Terminated_Success,
241},
> {sipName_Terminated_Timeout, sipSIPTransaction::Terminated_Timeout,
241},
> {sipName_Terminated_TransportError,
> sipSIPTransaction::Terminated_TransportError, 241},
> {sipName_Trying, sipSIPTransaction::Trying, 241},
> };
>
> Of course, commenting out the code under protected stops it from being
> generated, and causing compiler errors.
Fixed, thanks.
Phil
More information about the PyQt
mailing list