Start to drag the correct values

This piece of code starts a drag and moves around data, it does nothing
with it yet.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2015-01-06 15:03:58 -02:00 committed by Dirk Hohndel
parent 2034508c07
commit 0a1908137b

View file

@ -6,7 +6,9 @@
#include "ui_divelogimportdialog.h"
#include <QAbstractListModel>
#include <QAbstractTableModel>
#include <QMouseEvent>
#include <QDrag>
#include <QMimeData>
const DiveLogImportDialog::CSVAppConfig DiveLogImportDialog::CSVApps[CSVAPPS] = {
// time, depth, temperature, po2, cns, ndl, tts, stopdepth, pressure
{ "", },
@ -64,7 +66,16 @@ ColumnNameView::ColumnNameView(QWidget *parent)
void ColumnNameView::mousePressEvent(QMouseEvent *press)
{
QModelIndex atClick = indexAt(press->pos());
if (!atClick.isValid())
return;
qDebug() << atClick.data();
QDrag *drag = new QDrag(this);
QMimeData *mimeData = new QMimeData;
mimeData->setText(atClick.data().toString());
drag->setMimeData(mimeData);
drag->exec();
}
DiveLogImportDialog::DiveLogImportDialog(QStringList *fn, QWidget *parent) : QDialog(parent),