You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

raghuram

Unregistered

1

Thursday, February 17th 2005, 5:57pm

how to add childs to the ListViwer

please tell me how to add childs to List Viewer at run time.

jacek

Master

  • "jacek" is male

Posts: 2,729

Location: Warsaw, Poland

  • Send private message

2

Thursday, February 17th 2005, 6:05pm

RE: how to add childs to the ListViwer

Quoted

From QListViewItem Class Reference:
The QListViewItem class implements a list view item.
A list view item is a multi-column object capable of displaying itself in a QListView.
The easiest way to use QListViewItem is to construct one with a few constant strings, and either a QListView or another QListViewItem as parent.
(void) new QListViewItem( listView, "Column 1", "Column 2" );
(void) new QListViewItem( listView->firstChild(), "A", "B", "C" );

We've discarded the pointers to the items since we can still access them via their parent listView. By default, QListView sorts its items; this can be switched off with QListView::setSorting(-1).
The parent must be another QListViewItem or a QListView. If the parent is a QListView, the item becomes a top-level item within that QListView. If the parent is another QListViewItem, the item becomes a child of that list view item.

raghuram

Unregistered

3

Thursday, February 17th 2005, 6:26pm

RE: how to add childs to the ListViwer

thanks for u r replay but it is not working that means the childs are not added to the columns.can u give the program for that
i want to add tha chils to existed column items (i.e)
column1
.
...row1
...row2
please observe the o/p

jacek

Master

  • "jacek" is male

Posts: 2,729

Location: Warsaw, Poland

  • Send private message

4

Thursday, February 17th 2005, 6:51pm

RE: how to add childs to the ListViwer

Quoted

Originally posted by raghuram
it is not working that means the childs are not added to the columns.

Could you post your code (only the part in which you add the items)?