[PyQt] SIP template

Denis Rouzaud denis.rouzaud at gmail.com
Thu May 18 10:21:59 BST 2017


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 à 15:58, Shaheed Haque <srhaque at theiet.org> a écrit :

> I've possibly missed soemthing, but does this help:
>
> https://www.riverbankcomputing.com/pipermail/pyqt/2017-January/038660.html
>
> (I've not implemented this myself yet, but the SIP file certainly compiles
> :-))
>
> On 17 May 2017 at 09:32, Denis Rouzaud <denis.rouzaud at gmail.com> wrote:
> >
> >
> > Le mer. 17 mai 2017 à 10:31, Phil Thompson <phil at riverbankcomputing.com>
> a
> > écrit :
> >>
> >> On 17 May 2017, at 8:55 am, Denis Rouzaud <denis.rouzaud at 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 would
> 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 at riverbankcomputing.com
> > https://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20170518/e4abc9ae/attachment.html>


More information about the PyQt mailing list