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

List:       pykde
Subject:    Re: [PyQt] syntax for converting C++ class template function to sip?
From:       Qin Shen <jeanshen () tippett ! com>
Date:       2010-09-30 21:41:44
Message-ID: 4CA50418.5030203 () tippett ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Phil Thompson wrote:
> On Thu, 30 Sep 2010 12:06:58 -0700, Qin Shen <jeanshen@tippett.com> wrote:
>   
>> I have template functions inside a non-template class.
>>
>>     template <typename T>
>>     List(const T &value);
>>
>>     template <typename T>
>>     List &append(const T &value);
>>
>> I copied them over to a sip file without changing their syntax. SIP 
>> complains about the
>> syntax error. I couldn't seem to find any related info from the SIP 
>> reference guide.
>> Is there anything specific I have to do to make it work?
>>     
>
> Look at PyQt's qlist.sip file.
>   
Thanks, Phil. This is a simple list type which I can do the same as 
Qlist does.

But what about any random template member function such as,

        template <typename T>
        FilterBy &And(const std::string &path,
                      const std::string &relation,
                      const T &value)

Do I need to do something similar to what this post said?

    http://www.mail-archive.com/pyqt@riverbankcomputing.com/msg00531.html

Thanks a lot,

-Jean



[Attachment #5 (text/html)]

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Phil Thompson wrote:
<blockquote cite="mid:66ec7305984168eb1b1af639a1f4379f@localhost"
 type="cite">
  <pre wrap="">On Thu, 30 Sep 2010 12:06:58 -0700, Qin Shen <a \
class="moz-txt-link-rfc2396E" \
href="mailto:jeanshen@tippett.com">&lt;jeanshen@tippett.com&gt;</a> wrote:  </pre>
  <blockquote type="cite">
    <pre wrap="">I have template functions inside a non-template class.

    template &lt;typename T&gt;
    List(const T &amp;value);

    template &lt;typename T&gt;
    List &amp;append(const T &amp;value);

I copied them over to a sip file without changing their syntax. SIP 
complains about the
syntax error. I couldn't seem to find any related info from the SIP 
reference guide.
Is there anything specific I have to do to make it work?
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Look at PyQt's qlist.sip file.
  </pre>
</blockquote>
Thanks, Phil. This is a simple list type which I can do the same as
Qlist does.<br>
<br>
But what about any random template member function such as,<br>
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; template &lt;typename T&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FilterBy &amp;And(const std::string \
&amp;path,<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&nbsp; &nbsp; &nbsp; const std::string &amp;relation,<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&nbsp; &nbsp;&nbsp; const T &amp;value)<br> <br>
Do I need to do something similar to what this post said?<br>
<br>
&nbsp;&nbsp;&nbsp;
<a class="moz-txt-link-freetext" \
href="http://www.mail-archive.com/pyqt@riverbankcomputing.com/msg00531.html">http://www.mail-archive.com/pyqt@riverbankcomputing.com/msg00531.html</a><br>
 <br>
Thanks a lot,<br>
<br>
-Jean<br>
<br>
<br>
</body>
</html>



_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://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