[PyQt] Using Sip on template classes

Guðjón Guðjónsson gudjon.i.gudjonsson at gmail.com
Fri May 1 07:20:53 BST 2015

Hi list

Does anyone have a simple example on sip interface to a template class. I
have taken a look at qlist.sip and other information I have found on the
internet but I have to admit that I am too stupid to understand it.
   I wrote this very simple class and have been trying for several hours to
write a sip interface to it but without success.

/* Header file */
template <typename T>
class tempsip {
    T var;
    tempsip(T v);
    void print();

/* Source file */
#include "tempsip.h"
#include <iostream>
using namespace std;
template<typename T>
tempsip<T>::tempsip(T v)
    var = v;

template<typename T> void tempsip<T>::print()
    cout << var << endl;
template class tempsip<string>;
template class tempsip<double>;

Thanks a lot for any info.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150501/4ad74d30/attachment.html>

More information about the PyQt mailing list