Added drag and drop support.

Implemented our own insertRows/deleteRows to avoid bug caused by default drag and drop behaviour of Qt

https://bugreports.qt-project.org/browse/QTBUG-26229
https://bugreports.qt-project.org/browse/QTBUG-6679
p4#: 21028
This commit is contained in:
Magne Sjaastad
2013-03-21 13:41:44 +01:00
parent 1e8d5236d1
commit b0503cabba
5 changed files with 122 additions and 23 deletions

View File

@@ -377,15 +377,11 @@ void RIMainWindow::createDockPanels()
m_treeView->setModel(m_treeModelPdm);
m_treeView->setSelectionMode(QAbstractItemView::ExtendedSelection);
// Must be enabled for drag and drop
/*
m_treeView->setSelectionMode(QAbstractItemView::SingleSelection);
// Drag and drop configuration
m_treeView->setDragEnabled(true);
m_treeView->viewport()->setAcceptDrops(true);
m_treeView->setDropIndicatorShown(true);
m_treeView->setDragDropMode(QAbstractItemView::InternalMove);
*/
m_treeView->setDragDropMode(QAbstractItemView::DragDrop);
dockWidget->setWidget(m_treeView);