From 9042abc68cf128c6d0a9943de4d19539043beb0b Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Tue, 6 Jan 2015 16:54:50 -0200 Subject: Set data done, drag & drop works Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/divelogimportdialog.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/qt-ui/divelogimportdialog.cpp b/qt-ui/divelogimportdialog.cpp index 0b6dfb7d4..245c240c3 100644 --- a/qt-ui/divelogimportdialog.cpp +++ b/qt-ui/divelogimportdialog.cpp @@ -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) -- cgit v1.2.3-70-g09d2