[PyQt] Function pointer with a default value?

Phil Thompson phil at riverbankcomputing.com
Mon Jul 10 13:02:57 BST 2017


On 9 Jul 2017, at 1:47 pm, Shaheed Haque <srhaque at theiet.org> wrote:
> 
> Hi,
> 
> I'm a bit stumped by how to specify a function pointer argument with a
> default value. The obvious:
> 
> whatever *findPackages(..., const QString &packageRoot = QString(),
> bool (*filter)(const KPluginMetaData &) = 0);
> 
> simply results in "Compulsory argument given after optional argument".
> My Yacc is too rusty for a quick examination of parser.y to reveal the
> problem, so any clues greatly appreciated.

Use...

    SIP_PYCALLABLE filter = 0

...but you can't have anything after the ellipsis anyway.

Phil


More information about the PyQt mailing list