mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 22:35:27 +00:00
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:
parent
2034508c07
commit
0a1908137b
1 changed files with 12 additions and 1 deletions
|
@ -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),
|
||||
|
|
Loading…
Add table
Reference in a new issue