[PyKDE] ListBoxItems are invisible
Phil Thompson
phil at riverbankcomputing.co.uk
Sun Apr 3 10:29:41 BST 2005
On Sunday 03 April 2005 4:03 am, John Ridley wrote:
> --- Phil Thompson <phil at riverbankcomputing.co.uk> wrote:
> > On Wednesday 30 March 2005 9:38 am, Giovanni Bajo wrote:
> > > Jeffrey Barish <jeff_barish at earthlink.net> wrote:
> > > > So why don't I see anything with the code as shown? Is
> > > > there a way to make the text visible when I put it in a
> >
> > QListBoxItem?
> >
> > > QListBoxItem is an abstract base class, you should be using
> > > QListBoxItemText. In fact, I'm not sure why PyQt lets you
> >
> > instantiate it,
> >
> > > it could be a bug in PyQt.
> >
> > Rather, a bug in SIP - now fixed.
>
> I'm a bit puzzled by this. Does this mean that being able to create
> QButton, QLayout, QCanvasItem and other such abstract base classes is
> also a bug in SIP? And if not, what is special about QListBoxItem?
>
> As far as I can see from the Qt documentation, it should be possible to
> create a custom QListBoxItem by reimplementing the paint(), height()
> and width() members. Does this "fix" imply that this sort of thing is
> not possible in PyQt?
You're getting confused between instantiating an abstract class (now fixed)
and deriving from an abstract class (still works). The problem was that,
originally, I couldn't think of a way of distinguishing between these two
cases and so allowed both.
Phil
More information about the PyQt
mailing list