Previously i used the internalmove mode, Then i changed to DragDrop mode.. But it is not working for me ..
sample code
ui->treeWidget->dragDropOverwriteMode();
ui->treeWidget->setDragEnabled(true);
ui->treeWidget->setAcceptDrops(true);
item->setText(0,"Friends");
list << tr("john") << tr("joseph") << tr("stephen") << tr("raj") << tr("Addu") ;
for ( int i=0;i < list.size;i++)
{
new_item->setText(0,list.at(i));
}
ui->treeWidget->dragDropOverwriteMode();
ui->treeWidget->setDragEnabled(true);
ui->treeWidget->setAcceptDrops(true);
ui->treeWidget->setDragDropMode(QAbstractItemView ::DragDrop);
QTreeWidgetItem *item = new QTreeWidgetItem(ui->treeWidget);
item->setText(0,"Friends");
QList <QString > list;
list << tr("john") << tr("joseph") << tr("stephen") << tr("raj") << tr("Addu") ;
for ( int i=0;i < list.size;i++)
{
QTreeWidgetItem *new_item = new QTreeWidgetItem(item);
new_item->setText(0,list.at(i));
}
To copy to clipboard, switch view to plain text mode
Again i am creating new top level item for TreeWidget
colleages->setText(0,"co-Workers");
QTreeWidgetItem *colleages = new QTreeWidgetItem(ui->treewidget);
colleages->setText(0,"co-Workers");
To copy to clipboard, switch view to plain text mode
I am trying to drag the items from friends to co-workers .. Here top level item only accept the drops..child items won't accept the drops.
How do i sort out this issue
Thanks
Addu R
Bookmarks