aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-01-06 16:52:15 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-01-06 19:38:08 -0800
commit7d532998311e840b55a36fd626b34f04942fbdfc (patch)
tree3b5d6c021e712b512ab7bca89e99ee708ffd7616
parent4e7bd86e07ce5220d54f4140730cfc25a8cb818c (diff)
downloadsubsurface-7d532998311e840b55a36fd626b34f04942fbdfc.tar.gz
Implement most of the drag operation
Only thing missing is the Drop. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/divelogimportdialog.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/qt-ui/divelogimportdialog.cpp b/qt-ui/divelogimportdialog.cpp
index e483cb8ef..0b6dfb7d4 100644
--- a/qt-ui/divelogimportdialog.cpp
+++ b/qt-ui/divelogimportdialog.cpp
@@ -121,22 +121,25 @@ void ColumnNameView::dropEvent(QDropEvent *event)
ColumnDropCSVView::ColumnDropCSVView(QWidget *parent)
{
-
+ setAcceptDrops(true);
}
void ColumnDropCSVView::dragLeaveEvent(QDragLeaveEvent *leave)
{
-
+ Q_UNUSED(leave);
}
void ColumnDropCSVView::dragEnterEvent(QDragEnterEvent *event)
{
-
+ event->acceptProposedAction();
}
void ColumnDropCSVView::dragMoveEvent(QDragMoveEvent *event)
{
-
+ QModelIndex curr = indexAt(event->pos());
+ if (!curr.isValid() || curr.row() != 0)
+ return;
+ event->acceptProposedAction();
}
void ColumnDropCSVView::dropEvent(QDropEvent *event)