[PyQt] another question with template inheritance

Denis Rouzaud denis.rouzaud at gmail.com
Mon May 22 14:02:15 BST 2017


Dear all,

I have another issue with template based inheritance.

Let's say I have the header

template <typename T>

class QgsTemporalRange

{

  public:

    QgsTemporalRange( const T &begin = T(), const T &end = T() );

};


typedef QgsTemporalRange< QDate > QgsDateRange;



And the SIP file:


template <T>

class QgsTemporalRange

{

%TypeHeaderCode
#include "qgsrange.h"
%End

public:

    QgsTemporalRange( const T &begin = T(), const T &end = T() );

};


typedef QgsTemporalRange< QDate > QgsDateRange;



I get the following error in the generated cpp code in

static void *init_type_QgsDateRange(sipSimpleWrapper *, PyObject
*sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **,
PyObject **sipParseErr)

at line:

const QDate& a0def = T();

:: error: use of undeclared identifier 'T'


I gave it a try by using classes instead of typedef (as described in
[0]) but it leads to exactly the same error (which is logic I guess).

Any idea how to solve this?


Thanks a lot,

Denis



[0] https://www.riverbankcomputing.com/pipermail/pyqt/2017-May/039188.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20170522/64ea6fd7/attachment.html>


More information about the PyQt mailing list