[PyKDE] ANNOUNCE: PyQt/PyKDE v0.11pre1

Boudewijn Rempt bsarempt at rempt.xs4all.nl
Wed Mar 15 01:29:05 GMT 2000


On Mon, 13 Mar 2000, Phil Thompson wrote:

> SIP, PyQt and PyKDE v0.11pre1 are in
> http://www.river-bank.demon.co.uk/software/private/.
> 
> This is still only Qt v1.x support - I want people to make sure this
> still works.
> 
> Some of the problems related to QListViewItem seem to be fixed (but
> probably not all as the dirview example script doesn't work).
> 
> Basically - please let me know of any outstanding problems, even if you
> have already reported them.
> 
> Thanks,
> Phil
> 

I've hacked the dirview.py script and got it working. I don't know exactly
what's happening, but things seem to go wrong when there's only one
argument to QListViewItem.__init__() (self doesn't count - it goes 
wrong when there's nothing but parent):

The followin is instructive:

Attempt 1:

class File(QListViewItem):

  def __init__(self, parent, *args):
    print parent, args
    apply(QListViewItem.__init__,(self, parent)+args)

class Directory(File):
  def __init__(self, parent, name=None):
    apply(File.__init__,(self,parent))
    if isinstance(parent, QListView):
      self.p = None
      self.f = '/'
    else:
      self.p = parent
      self.f = name
    self.c = []
    self.readable = 1

No joy, can't create QListViewItems with no text.

Attempt 2:

class File(QListViewItem):

  def __init__(self, parent, *args):
    print parent, args
    apply(QListViewItem.__init__,(self, parent)+args)

class Directory(File):
  def __init__(self, parent, name=None):
    apply(File.__init__,(self,parent,name))
    if isinstance(parent, QListView):
      self.p = None
      self.f = '/'
    else:
      self.p = parent
      self.f = name
    self.c = []
    self.readable = 1

Perfect little app ;-)...
 
Now I'm going to look where things go wrong with kpybrowser...





More information about the PyQt mailing list