Set data done, drag & drop works

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2015-01-06 16:54:50 -02:00 committed by Dirk Hohndel
parent 7d53299831
commit 9042abc68c

View file

@ -144,7 +144,15 @@ void ColumnDropCSVView::dragMoveEvent(QDragMoveEvent *event)
void ColumnDropCSVView::dropEvent(QDropEvent *event)
{
QModelIndex curr = indexAt(event->pos());
if (!curr.isValid() || curr.row() != 0)
return;
event->acceptProposedAction();
const QMimeData *mimeData = event->mimeData();
if (mimeData->hasText()) {
model()->setData(curr, QVariant(mimeData->text()));
}
}
ColumnNameResult::ColumnNameResult(QObject *parent) : QAbstractTableModel(parent)