[PyKDE] QtPE Missing features

David Douard douard at magic.fr
Sun Aug 25 18:43:00 BST 2002


Le Samedi 17 Août 2002 11:52, Phil Thompson a écrit :
> David Douard wrote:
> > Hi list,
> > Hi Phil
> >
> > I know there are many things to do for such a wrapper, but I am using
> > Qtopia classes (TrollTech's 1.5.0 GPL version) in my PyQt application for
> > the Zaurus which are not included in PyQt, and quite easy to add, namely:
> >
> > Config
> > AppLnk/DocLnk (and Sets)
> > FileManager
> > FileSelector
> > Resource
> >
> > All thoses are really easy to add to PyQt (what I did). Should I send you
> > (Phil) a patch for these, so they can be included in PyQt ? (But  these
> > are really trivial changes).
>
> A patch would be great.

Here is my patch... It has not been heavily tested, and I am sure there should 
be version controls I do not test...

It does not include my QPEMainWindow hack (see my other message). 
It does not implement the QCopEnvelope too, cause it is a little more 
complicated, and I do not have time for it now (see below).


>
> > I have not tried other Qtopia classes, but I think they must but also
> > easy to add...
> > The problem I have encountered is with the DCopEnvelope. The normal use
> > of it is to call the constructor with 2 params (channel and message). But
> > you then have to call the operator << on the created  object to pass
> > arguments, and the message is actually sent when the object it deleted
> > (almost all the code of the object is in the destructor).
> >
> > What is the right way to wrap it ? I have tried to write a wrapp Member
> > Code so you give the 2 required params and an optional list of strings...
> > But I does not work, and I don't have time to guess the way Sip works in
> > details... Anoyone did something ?
>
> You can implement __lshift__() for the class - see how QStringList
> implements __len__(), __getitem__() etc.

Well I don't think using __lshift__ is a very good idea... The << of C++ used 
here is the stream operator, not the numeric shift. It might be really 
confusing. More, as the class code of DCopEnvelope is mainly included in the 
destructor, IMHO, the best way to do the job is to provide the user a 
function which takes the required 2 params (channel and message) and an 
optional thrid param : a list a args.
A class instance should not be kept at python level, it makes no sense.
So how can I implement such a function ? It is not a wrapper like others class 
wrappers. Are there examples of similar things in PyQt code ?

David
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sippatch.gz
Type: application/x-gzip
Size: 5413 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20020825/94e13c01/sippatch.gz


More information about the PyQt mailing list