[PyQt] Empty and template classes

Shaheed Haque srhaque at theiet.org
Sun Apr 10 13:21:52 BST 2016


Hi,

One enhancement request, and a question. First, SIP 4.16.9 does not
like empty classes like this:

class KUserOrGroupId
{
};

The above results in a syntax error. Adding anything makes it work, for example:

class KUserOrGroupId
{
%TypeHeaderCode
#include <KCoreAddons/kuser.h>
%End
};

is accepted. It would be nice to have support for this corner case.
Second, the syntax for template classes does not seem to work as I
expected. This example results in a syntax error, as does every
variation I could think of (including trying to match PyQt):

template <typename T>
class KUserOrGroupId<T>
{
%TypeHeaderCode
#include <KCoreAddons/kuser.h>
%End
};

Like the function case, I realise the implementation for this is not
trivial (templated methods and the like), but I cannot seem to make
the basic syntax work. It should, right?

Thanks, Shaheed


More information about the PyQt mailing list