aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/divelogimportdialog.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-01-06 21:49:48 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-01-06 19:38:37 -0800
commitfd41ff4ab91d95c1ad505ca5b53697963fdf14b2 (patch)
tree9081bcb28e8e1433aa0e50b52c04ea30eaeb9865 /qt-ui/divelogimportdialog.cpp
parent325f47c8d8c71a17b27722376ea0af0e7eddaeeb (diff)
downloadsubsurface-fd41ff4ab91d95c1ad505ca5b53697963fdf14b2.tar.gz
Start to make it possible to move columns around
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.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/qt-ui/divelogimportdialog.cpp b/qt-ui/divelogimportdialog.cpp
index d5fcd40a9..963c75710 100644
--- a/qt-ui/divelogimportdialog.cpp
+++ b/qt-ui/divelogimportdialog.cpp
@@ -211,6 +211,27 @@ void ColumnNameResult::setColumnValues(QList<QStringList> columns)
endInsertRows();
}
+void ColumnDropCSVView::mousePressEvent(QMouseEvent *press)
+{
+ QModelIndex atClick = indexAt(press->pos());
+ if (!atClick.isValid() || atClick.row())
+ return;
+
+ QRect indexRect = visualRect(atClick);
+ QPixmap pix(indexRect.width(), indexRect.height());
+ pix.fill(QColor(0,0,0,0));
+ render(&pix, QPoint(0, 0),QRegion(indexRect));
+
+ QDrag *drag = new QDrag(this);
+ QMimeData *mimeData = new QMimeData;
+ mimeData->setData(subsurface_mimedata, atClick.data().toByteArray());
+ drag->setPixmap(pix);
+ drag->setMimeData(mimeData);
+ if (drag->exec() != Qt::IgnoreAction){
+ // Do stuff here.
+ }
+}
+
DiveLogImportDialog::DiveLogImportDialog(QStringList fn, QWidget *parent) : QDialog(parent),
selector(true),
ui(new Ui::DiveLogImportDialog)