[PyQt] SIP and Qxt Widgets

Hans-Peter Jansen hpj at urpla.net
Fri Dec 24 22:23:14 GMT 2010


[Merry christmas, BTW]

Dear Alexander,

On Friday 24 December 2010, 20:28:21 Alexander Nestorov wrote:
> I'm trying to use one of Qxt's widgets (the schedule view) in Python,
> but I need to use SIP first to make the necesary
> bindings as Qxt is C++ only.
>
> After reading SIP docs I found that I need all "dependant" files
> apart from qxtscheduleview.h, so I looked for all #include
> in that file and started to copy all files in the same dir. I ended
> up with ~15 .h/.cpp files.
>
> Next step was write the config.py and config.py.in files, and the
> .sip file itself. I wrote it but I must have done
> something wrong because when I try to "convert" it using SIP I get an
> error:
>
> sip: QxtScheduleItemDelegate is undefined.

You either need to 
 * wrap all dependant structures (or what do you expect from sip, when 
you call QxtScheduleView.delegate()?) or 
 * eliminate their use.

I'm not sure, if you can get away without wrapping 
QxtScheduleItemDelegate but obviously, you cannot without Qxt::Timeunit 
in a meaningful way.

> I don't know how to fix it.
> Here is Qxt's code:
> http://dev.libqxt.org/libqxt/src/c955808a1852/src/gui/qxtscheduleview
>.h And here is what I have done: http://pastebin.ca/2028373

Interestingly, I've a todo list item: wrapping Qxt, but free time 
constraints prevented this from happening. 

From what I've seen, QxtCore provides a lot of stuff, that is included 
in the batteries or 3rd party library section of Python already, but is 
probably necessary for the higher levels of Qxt. The most interesting 
part is QxtGui, of course.

If you start such a project targeted on full support of Qxt somewhere on 
a git or hg hub and being interesting in collaboration, let me know. 

We could try to kindly ask Phil for running metasip on this, if we 
provide the necessary preparation steps (the gccxml output at least).

Note, that for proper support, it is necessary to manage the timeline of 
the library starting from a minimum supported version (e.g. 0.6), which 
handles the evolution of the API over time.

Pete


More information about the PyQt mailing list