[PyKDE] ListBoxItems are invisible

Giovanni Bajo rasky at develer.com
Wed Mar 30 09:38:09 BST 2005


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.

> but what I really want to know is what insertItem(lbi) is properly
> used for.  I suppose it must be for situations in which the lbi being
> inserted has a different parent, but I can't imagine such a situation.

There are situations in which you have two possible parents, so you first
create the child, and later bind it to either parent depending on some
information extracted from the child itself. Remember that it is very common to
subclass QListBoxItemText to store additional information.

Giovanni Bajo




More information about the PyQt mailing list