PDA

View Full Version : moving Qlistview items



:db:sStrong
21st February 2006, 13:25
hello there,

i have qlistviewItems in a qlistview and when i want to drag and drop a new item inside the qlistview but i want to move the items which were already there in to the new item. I mean to say is that the items should become the children of the new draged item.

Here i have my piece of code:



item->setText( MY_ID, "" );
item->setPixmap( COL_ID, QPixmap() );
item->setText( COL_ID, "" );
item->setPixmap( COL_ID, QPixmap() );
item->setText( COL_ID, "" );
item->setExpandable(true);
item->setOpen(true);

item = new QListViewItem(item,"testr", "", "tested", "", "" );
item->setPixmap( COL_ID, QPixmap::fromMimeSource("test.png") );
item->setExpandable(true);
item->setOpen(true);

item = new QListViewItem(item,lastitem);
item->setExpandable(true);
item->setOpen(true);
event->accept(true);
break;

in lastitem i have stored the last item and that should become child of this new qlistviewitem. but i get an empty child and the last item stands on its place.

plz take a look at it.thanx
ps: i use QT 3 :(