diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2015-01-06 16:54:50 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-01-06 19:38:10 -0800 |
commit | 9042abc68cf128c6d0a9943de4d19539043beb0b (patch) | |
tree | 6fff022804381c1ee867c37888167a1fa8ba7186 /qt-ui/divelogimportdialog.cpp | |
parent | 7d532998311e840b55a36fd626b34f04942fbdfc (diff) | |
download | subsurface-9042abc68cf128c6d0a9943de4d19539043beb0b.tar.gz |
Set data done, drag & drop works
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/divelogimportdialog.cpp')
-rw-r--r-- | qt-ui/divelogimportdialog.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
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) |