<div dir="ltr">Hi Shaheed,<div><br></div><div>This helped a bit, thanks a lot.</div><div><br></div><div>But when doing </div><div>class QgsOptionalExpression : QgsOptional<QgsExpression></div><div>I fall back to a syntax error on this line (on sip 4.18.1)</div><div><br></div><div>I also tried to use a typedef, similarly to the example you provided:</div><div><br></div><div><div>%ModuleHeaderCode</div><div>#include "qgsoptional.h"</div><div>%End</div><div>typedef QgsOptional<QgsExpression> QgsOptionalExpressionBase;</div><div>class QgsOptionalExpression : QgsOptionalExpressionBase</div></div><div>{</div><div>.....</div><div>}</div><div><br></div><div>But I get: qgsoptionalexpression.sip:18: Super-class list contains an invalid type</div><div><br></div><div>It just seems not possible to inherit from a template, I wonder why it works in the example you pointed and not in my case.</div><div><br></div><div>Cheers,</div><div>Denis</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br><br><div class="gmail_quote"><div dir="ltr">Le mer. 17 mai 2017 à 15:58, Shaheed Haque <<a href="mailto:srhaque@theiet.org">srhaque@theiet.org</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I've possibly missed soemthing, but does this help:<br>
<br>
<a href="https://www.riverbankcomputing.com/pipermail/pyqt/2017-January/038660.html" rel="noreferrer" target="_blank">https://www.riverbankcomputing.com/pipermail/pyqt/2017-January/038660.html</a><br>
<br>
(I've not implemented this myself yet, but the SIP file certainly compiles :-))<br>
<br>
On 17 May 2017 at 09:32, Denis Rouzaud <<a href="mailto:denis.rouzaud@gmail.com" target="_blank">denis.rouzaud@gmail.com</a>> wrote:<br>
><br>
><br>
> Le mer. 17 mai 2017 à 10:31, Phil Thompson <<a href="mailto:phil@riverbankcomputing.com" target="_blank">phil@riverbankcomputing.com</a>> a<br>
> écrit :<br>
>><br>
>> On 17 May 2017, at 8:55 am, Denis Rouzaud <<a href="mailto:denis.rouzaud@gmail.com" target="_blank">denis.rouzaud@gmail.com</a>> wrote:<br>
>> ><br>
>> ><br>
>> > Hi Phil,<br>
>> ><br>
>> > Thanks a lot for your reply.<br>
>> > I was hoping not to go that way to avoid any redundancy and some<br>
>> > weakness in the code (any change to the template class methods would need to<br>
>> > be propagated to all implementations).<br>
>> ><br>
>> > There is no other way?<br>
>><br>
>> I don't think so.<br>
><br>
><br>
> It's a pity, I thought it would have been a more common issue.<br>
> Thanks a lot for your feedback!<br>
>><br>
>><br>
>> Phil<br>
>><br>
><br>
> _______________________________________________<br>
> PyQt mailing list    <a href="mailto:PyQt@riverbankcomputing.com" target="_blank">PyQt@riverbankcomputing.com</a><br>
> <a href="https://www.riverbankcomputing.com/mailman/listinfo/pyqt" rel="noreferrer" target="_blank">https://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br>
</blockquote></div></div></div>