<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 8 August 2017 at 22:12, Shaheed Haque <span dir="ltr"><<a href="mailto:srhaque@theiet.org" target="_blank">srhaque@theiet.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail-HOEnZb"><div class="gmail-h5">On 8 August 2017 at 17:23, Phil Thompson <<a href="mailto:phil@riverbankcomputing.com">phil@riverbankcomputing.com</a>> wrote:<br>
> On 2 Aug 2017, at 9:21 am, Shaheed Haque <<a href="mailto:srhaque@theiet.org">srhaque@theiet.org</a>> wrote:<br>
>><br>
>> Hi,<br>
>><br>
>> On 18 May 2017 at 13:14, Denis Rouzaud <<a href="mailto:denis.rouzaud@gmail.com">denis.rouzaud@gmail.com</a>> wrote:<br>
>>><br>
>>> Sorry, for the noise.<br>
>>><br>
>>> I missed the second typedef in the ModuleHeaderCode, it works!<br>
>>> Thanks to David, Phil and Shaheed for the hints!<br>
>><br>
>> Is there a variation on this technique that works for nested classes?<br>
>> It turns out that in all 17 places this affects PyKF5 involve nested<br>
>> classes, and attempting to modify this SIP:<br>
>><br>
>> =============<br>
>> namespace KContacts<br>
>> {<br>
>> class AddresseeList: QVector<KContacts::Addressee><br>
>> {<br>
>> =============<br>
>><br>
>> into this SIP:<br>
>><br>
>> =============<br>
>> namespace KContacts<br>
>> {<br>
>> %TypeHeaderCode<br>
>> typedef QVector<KContacts::Addressee> foo_t;<br>
>> %End<br>
>> typedef QVector<KContacts::Addressee> foo_t;<br>
>> class AddresseeList: KContacts::foo_t<br>
>> {<br>
>> =============<br>
>><br>
>> only results in:<br>
>><br>
>> sip: tmp/KContacts/KContacts/<wbr>AddresseeList.sip:121: Super-class list<br>
>> contains an invalid type<br>
>><br>
>> I stared a the code that emits the message in parser.y (and also tried<br>
>> moving foo_t to global scope), without the solution becoming obvious.<br>
>> So, any clues or ideas welcomed!<br>
><br>
> PyQt has the same problem with QPolygon. The workaround is to say that AddresseeList does not have a super-class and to add any QVector methods you want to AddresseeList. See qpolygon.sip in PyQt.<br>
<br>
</div></div>Thanks Phil...<br></blockquote><div><br></div><div>I'm still working on variations of this topic. The problem I am having at the moment is that a sequence like this, where Bar has a base which is a %MappedType:<br><br>=======<br>%Module(name=xxx)<br><br>%MappedType FooBad<br>{<br>%ConvertFromTypeCode<br>// blah.<br>%End<br>%ConvertToTypeCode<br>// blah.<br>%End<br>};<br><br>class FooOK<br>{<br>public:<br> FooOK();<br>};<br><br>class Bar: FooBad<br></div><div>{ <<<<<<<<<<<<<<<< This is line 20<br></div><div>public:<br> Bar();<br>};<br>=======<br><br></div><div>gives the error "sip: tmp.sip:20: A class, exception, namespace or mapped type has already been defined with the same name" but if I change the base class from FooBad to the non-%MappedType normal class FooOK, it compiles just fine. I'm on 4.19.4.dev1708081632...have I gone mad?<br></div><div><br></div><div>Thanks, Shaheed<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
><br>
> Phil<br>
</blockquote></div><br></div></div>