[PyKDE] QlistView query

Dave S eric3 at pusspaws.net
Sun Jul 30 19:36:31 BST 2006


On Sunday 30 July 2006 19:17, Andreas Pakulat wrote:
> On 30.07.06 16:53:09, dave s wrote:
> > The debugged program raised the exception unhandled TypeError
> > "argument 1 of QListView.insertItem() has an invalid type"
> >
> > I have tried various arguments including (0, "hi test string")
> >
> > I have looked at the QT python bindings and it is fully implemented. I
> > have looked at QT 3 ref and a bit confused - its that C stuff.
>
> AFAIK PyQt has it's own documentation also for version 3, which
> shouldn't contain any C-stuff.
>
> > void QListView::insertItem ( QListViewItem * i ) [virtual]
> >
> > Is '*' equivalent to a python ',' ?
>
> No "*" means "pointer to". This translates to a reference in python,
> i.e. the method signature in python is:
>
> insertItem(self, QListViewItem)
>
> so you need to provide a QListViewItem. However normally you'd just
> create a new QListViewItem with the QListView as parent and your text
> and be done with it.
>
> > PS Is QlistView the best widget for this job ?
>
> Well, QTextEdit has a log-mode IIRC, that might be easier to use.
>
> Andreas

Thanks for the info - I will go and play :)

Dave




More information about the PyQt mailing list