diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2015-01-06 17:19:08 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-01-06 19:38:12 -0800 |
commit | 909be75113ef395e0a73eb8dd8698b101fd17cb2 (patch) | |
tree | 5b5af95612e131ed125d90271774f2e15ef547da /qt-ui | |
parent | 9042abc68cf128c6d0a9943de4d19539043beb0b (diff) | |
download | subsurface-909be75113ef395e0a73eb8dd8698b101fd17cb2.tar.gz |
Re-add the string to the avaliable models if drag cancelled
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/divelogimportdialog.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/qt-ui/divelogimportdialog.cpp b/qt-ui/divelogimportdialog.cpp index 245c240c3..539238560 100644 --- a/qt-ui/divelogimportdialog.cpp +++ b/qt-ui/divelogimportdialog.cpp @@ -92,8 +92,11 @@ void ColumnNameView::mousePressEvent(QMouseEvent *press) model()->removeRow(atClick.row()); drag->setPixmap(pix); drag->setMimeData(mimeData); - drag->exec(); - + if (drag->exec() == Qt::IgnoreAction){ + model()->insertRow(model()->rowCount()); + QModelIndex idx = model()->index(model()->rowCount()-1, 0); + model()->setData(idx, mimeData->text()); + } } void ColumnNameView::dragLeaveEvent(QDragLeaveEvent *leave) |