Re: [PyQt] downcast a base class to its template subclass

2010-11-02 Thread Qin Shen
Hi Phil, Phil Thompson wrote: On Mon, 1 Nov 2010 17:26:41 -0700, Qin Shen wrote: Hi, In my non-template base class' .sip file, I used %ConvertToSubClassCode directive to downcast the base class type to its sub-class. If the sub-class is not a template, it all works fine. Now I ne

[PyQt] downcast a base class to its template subclass

2010-11-01 Thread Qin Shen
Hi, In my non-template base class' .sip file, I used %ConvertToSubClassCode directive to downcast the base class type to its sub-class. If the sub-class is not a template, it all works fine. Now I need to derive a template sub-class from the base class, the sipFindType() won't work because the

Re: [PyQt] problem with importing a SIP module

2010-10-29 Thread Qin Shen
Thanks so much, Phil! It works now. I never would have thought about the reason why it didn't work. Thanks a lot for looking into it! -Jean Phil Thompson wrote: On Tue, 26 Oct 2010 12:46:28 -0700, Qin Shen wrote: Hi Phil, It looks like the problem I'm having is caused by the

[PyQt] problem with importing a SIP module

2010-10-25 Thread Qin Shen
Hi there, I am having trouble with importing a SIP module. Here is my "B.sip" file: %Module B 0 %Import A.sip %Include classB1.sip %Include classB2.sip The classes in module B are derived from classes in

[PyQt] SIP exception question

2010-10-04 Thread Qin Shen
Hi there, I had this SIP exception working a few months ago. Recently I've made some structural changes to my code, it stopped working if I put the C++ throw() call inside .cpp file instead of .h file. in Entity.h: - class Entity { public: ... void test() const; ... }

Re: [PyQt] syntax for converting C++ class template function to sip?

2010-09-30 Thread Qin Shen
Phil Thompson wrote: On Thu, 30 Sep 2010 12:06:58 -0700, Qin Shen wrote: I have template functions inside a non-template class. template List(const T &value); template List &append(const T &value); I copied them over to a sip file without changing their

[PyQt] syntax for converting C++ class template function to sip?

2010-09-30 Thread Qin Shen
I have template functions inside a non-template class. template List(const T &value); template 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

Re: [PyQt] SIP exception handling

2010-05-20 Thread Qin Shen
Thanks so much, Phil! That's exactly where the problem was! All I had to do is to change: const std::string sgRole() const; to const std::string sgRole() const throw(TipShotgun::Shotgun::Exception); Thanks!! -Jean Phil Thompson wrote: On Wed, 19 May 2010 16:02:38 -0700, Qin

[PyQt] SIP exception handling

2010-05-19 Thread Qin Shen
Hi there, I'm fairly new on SIP and haven't done any development on PyQt. But I'm using SIP to write a python wrapper for our C++ library. I have tried to translate the C++ exceptions to Python exceptions. So far I managed to get it to work, but I had to change the auto-generated sipcode, which