PDA

View Full Version : How to move a item using drag&drop within a tableview



psarangi
18th February 2014, 09:01
Hi,

I want to move my item from "from index" to "To index" using drag and drop.
I have set the drag and drop.

ui.tableView->setSelectionMode(QAbstractItemView::SingleSelectio n);
ui.tableView->setDragEnabled(true);
ui.tableView->setAcceptDrops(true);
ui.tableView->setDropIndicatorShown(true);
ui.tableView->setModel(m_pTableModel);
ui.tableView->setDragDropOverwriteMode(true);
ui.tableView->setDragDropMode(QAbstractItemView::InternalMove);


By this the dragged item is getting moved from the view itself. Please suggest me some idea...



Thanks ...

psarangi
20th February 2014, 10:14
do i need to set MIMEData for this ??
please help me out.