[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: [PyQt] SIP errors: class inherits from std::list
From: "Ovidiu Ciule" <ovidiu.ciule () gmail ! com>
Date: 2007-08-29 13:32:38
Message-ID: 9c30fe790708290632h35121a96q9f2b9ea07ccf2f94 () mail ! gmail ! com
[Download RAW message or body]
Hello,
I have a class, AccountList, that inherits from std::list. When trying
to generate bindings for it, SIP reports errors. I'm using SIP 4.5 on
Ubuntu. I'm downloading SIP 4.7 now, but I don't think it'll help, as
the change log doesn't mention anything relevant about templates.
Here's the the .sip file:
AccountList.sip
class AccountList : std::list<Account> {
%TypeHeaderCode
#include <coipmanager_base/account/AccountList.h>
%End
public:
... various boring methods
};
The relevant portion of the header file is similar, so I will not post it.
SIP gives the following error:
sip_files/coipmanager_base/AccountList.sip:1: syntax error
std::list is defined, so it's not that. I use a stdlist.sip inspired
by the stl.sip work of Giovanni Bajo. I read the relevant SIP doc, and
found nothing about template inheritance. Moreso, std::list<Account>
work fine as a return type or as a parameter.
I tried defining std::list<Account> with a typedef:
typedef std::list<Account> AccountList1;
I did in the SIP file, then in the header, then in both. In all cases
I got errors.
In the .sip file, it looks like this:
typedef std::list<Account> AccList;
class AccountList : AccList {
...
The error I get is:
sip: AccList has not been defined
which in my eyes, makes no sense. But I'm not SIP, so I have no idea
what I'm talking about.
1. Does anybody know how if inheriting from templates works? That is,
if it is usable with SIP. I read and re-read the doc, and found
nothing. If I missed something, sorry.
2. What's up with typedef?
Am I using it wrong? I don't think so. I looked over PyQt's Metasip
generated sip files, and of course they use lots of typedefs.
BTW, Phil, thanks for not releasing metasip. I had lots of fun writing
my own sip file generator. You know, the kind of fun you have when you
reinvent the wheel.
Thanks a lot, and have a nice day.
--
Ovidiu CIULE
Barcelona, Spain
0034 606 809 176
_______________________________________________
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