[PyKDE] QListView has not childCount nor LastItem

Giacomo Lacava g.lacava at gmail.com
Tue Aug 30 19:47:49 BST 2005


You are using a QListBox, not a QListView; it's a very different
animal... QListBox hasn't got childCount, not even in the C++ QT.
Btw, with QListView (Qt 3.3.4, PyQT 3.14.1, Debian/Sid) childCount()
works "as advertised" :)

cheers
Giacomo Lacava
> 
> On 30/08/05, Sebastian Kügler <sebas at kde.nl> wrote:
> > Hi,
> >
> > I'm working on some examples for PyQt at the moment, and using the QListView,
> > I found some "strange" things which look like bugs to me.
> >
> > if self.listview.childCount() == 0: # AttributeError
> >         self.deletebutton.setEnabled(False)
> >
> > The childCount is - although documented [0] - not a method of the QListView
> > (not in dir(self.listview), if I insert it.
> >
> > Attached, you find the small program I've encountered this issue with.
> >
> > [0] http://doc.trolltech.com/3.3/qlistview.html#childCount
> >
> > I'm running Debian sid with:
> >
> > ii  python-qt-dev  3.14.1-2       Qt bindings for Python - Development files
> > ii  python-qt3     3.14.1-2       Qt3 bindings for Python (default version)
> > ii  python-qt3-doc 3.14.1-2       Qt bindings for Python - Documentation and e
> > ii  python-qtext   3.14.1-2       Qt extensions for PyQt (default version)
> >
> > I'm at aKademy at the moment, and don't have my other machine at hand.
> >
> > - Is that a bug?
> > - Is it already fixed in snapshots?
> > - Is there a better way to count the listviewitems?
> >
> > Thanks for your enlightening,
> > --
> > sebas
> >
> >  http://www.kde.nl | http://vizZzion.org |  GPG Key ID: 9119 0EF9
> > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> > A day without sunshine is like a day without orange juice.
> >
> >
> >
> > _______________________________________________
> > PyKDE mailing list    PyKDE at mats.imk.fraunhofer.de
> > http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
> >
> >
> >
> >
> 
> 
> --
> Giacomo Lacava
> 


-- 
Giacomo Lacava




More information about the PyQt mailing list