[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] SIP template
From:       Denis Rouzaud <denis.rouzaud () gmail ! com>
Date:       2017-05-18 12:14:00
Message-ID: CAMtsY+b_dVJ_UA-Rjp6eNSGMyVOEJ=4Ga25+NkiMsNz8djix8g () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Sorry, for the noise.

I missed the second typedef in the ModuleHeaderCode, it works!
Thanks to David, Phil and Shaheed for the hints!

Cheers,
Denis

Le jeu. 18 mai 2017 =C3=A0 11:21, Denis Rouzaud <denis.rouzaud@gmail.com> a
=C3=A9crit :

> Hi Shaheed,
>
> This helped a bit, thanks a lot.
>
> But when doing
> class QgsOptionalExpression : QgsOptional<QgsExpression>
> I fall back to a syntax error on this line (on sip 4.18.1)
>
> I also tried to use a typedef, similarly to the example you provided:
>
> %ModuleHeaderCode
> #include "qgsoptional.h"
> %End
> typedef QgsOptional<QgsExpression> QgsOptionalExpressionBase;
> class QgsOptionalExpression : QgsOptionalExpressionBase
> {
> .....
> }
>
> But I get: qgsoptionalexpression.sip:18: Super-class list contains an
> invalid type
>
> 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.
>
> Cheers,
> Denis
>
>
>
>
>
>
>
>
>
> Le mer. 17 mai 2017 =C3=A0 15:58, Shaheed Haque <srhaque@theiet.org> a =
=C3=A9crit :
>
>> I've possibly missed soemthing, but does this help:
>>
>> https://www.riverbankcomputing.com/pipermail/pyqt/2017-January/038660.ht=
ml
>>
>> (I've not implemented this myself yet, but the SIP file certainly
>> compiles :-))
>>
>> On 17 May 2017 at 09:32, Denis Rouzaud <denis.rouzaud@gmail.com> wrote:
>> >
>> >
>> > Le mer. 17 mai 2017 =C3=A0 10:31, Phil Thompson <phil@riverbankcomputi=
ng.com>
>> a
>> > =C3=A9crit :
>> >>
>> >> On 17 May 2017, at 8:55 am, Denis Rouzaud <denis.rouzaud@gmail.com>
>> wrote:
>> >> >
>> >> >
>> >> > Hi Phil,
>> >> >
>> >> > Thanks a lot for your reply.
>> >> > I was hoping not to go that way to avoid any redundancy and some
>> >> > weakness in the code (any change to the template class methods woul=
d
>> need to
>> >> > be propagated to all implementations).
>> >> >
>> >> > There is no other way?
>> >>
>> >> I don't think so.
>> >
>> >
>> > It's a pity, I thought it would have been a more common issue.
>> > Thanks a lot for your feedback!
>> >>
>> >>
>> >> Phil
>> >>
>> >
>> > _______________________________________________
>> > PyQt mailing list    PyQt@riverbankcomputing.com
>> > https://www.riverbankcomputing.com/mailman/listinfo/pyqt
>>
>

[Attachment #5 (text/html)]

<div dir="ltr"><br><div>Sorry, for the noise.</div><div><br></div><div>I missed the \
second typedef in the ModuleHeaderCode, it works!</div><div>Thanks to David, Phil and \
Shaheed for the hints!</div><div><br></div><div>Cheers,</div><div>Denis</div></div><br><div \
class="gmail_quote"><div dir="ltr">Le  jeu. 18 mai 2017 Ã   11:21, Denis Rouzaud \
&lt;<a href="mailto:denis.rouzaud@gmail.com">denis.rouzaud@gmail.com</a>&gt; a écrit \
:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex"><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&lt;QgsExpression&gt;</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 \
&quot;qgsoptional.h&quot;</div><div>%End</div><div>typedef \
QgsOptional&lt;QgsExpression&gt; 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><div \
dir="ltr"><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 \
&lt;<a href="mailto:srhaque@theiet.org" target="_blank">srhaque@theiet.org</a>&gt; a \
écrit  :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex">I&#39;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&#39;ve not implemented this myself yet, but the SIP file certainly compiles \
:-))<br> <br>
On 17 May 2017 at 09:32, Denis Rouzaud &lt;<a href="mailto:denis.rouzaud@gmail.com" \
target="_blank">denis.rouzaud@gmail.com</a>&gt; wrote:<br> &gt;<br>
&gt;<br>
&gt; Le mer. 17 mai 2017 Ã  10:31, Phil Thompson &lt;<a \
href="mailto:phil@riverbankcomputing.com" \
target="_blank">phil@riverbankcomputing.com</a>&gt; a<br> &gt; écrit :<br>
&gt;&gt;<br>
&gt;&gt; On 17 May 2017, at 8:55 am, Denis Rouzaud &lt;<a \
href="mailto:denis.rouzaud@gmail.com" target="_blank">denis.rouzaud@gmail.com</a>&gt; \
wrote:<br> &gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Hi Phil,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Thanks a lot for your reply.<br>
&gt;&gt; &gt; I was hoping not to go that way to avoid any redundancy and some<br>
&gt;&gt; &gt; weakness in the code (any change to the template class methods would \
need to<br> &gt;&gt; &gt; be propagated to all implementations).<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; There is no other way?<br>
&gt;&gt;<br>
&gt;&gt; I don&#39;t think so.<br>
&gt;<br>
&gt;<br>
&gt; It&#39;s a pity, I thought it would have been a more common issue.<br>
&gt; Thanks a lot for your feedback!<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Phil<br>
&gt;&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; PyQt mailing list      <a href="mailto:PyQt@riverbankcomputing.com" \
target="_blank">PyQt@riverbankcomputing.com</a><br> &gt; <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></blockquote></div>


[Attachment #6 (text/plain)]

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic