[PyQt] sip bug wrapping protected enum in ABC

Demetrius Cassidy dcassidy36 at gmail.com
Tue Mar 22 02:42:37 GMT 2011


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20110322/5bdb3b5e/attachment.html>


More information about the PyQt mailing list