mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 07:53:25 +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 "ui_divelogimportdialog.h"
|
||||||
#include <QAbstractListModel>
|
#include <QAbstractListModel>
|
||||||
#include <QAbstractTableModel>
|
#include <QAbstractTableModel>
|
||||||
|
#include <QMouseEvent>
|
||||||
|
#include <QDrag>
|
||||||
|
#include <QMimeData>
|
||||||
const DiveLogImportDialog::CSVAppConfig DiveLogImportDialog::CSVApps[CSVAPPS] = {
|
const DiveLogImportDialog::CSVAppConfig DiveLogImportDialog::CSVApps[CSVAPPS] = {
|
||||||
// time, depth, temperature, po2, cns, ndl, tts, stopdepth, pressure
|
// time, depth, temperature, po2, cns, ndl, tts, stopdepth, pressure
|
||||||
{ "", },
|
{ "", },
|
||||||
|
@ -64,7 +66,16 @@ ColumnNameView::ColumnNameView(QWidget *parent)
|
||||||
|
|
||||||
void ColumnNameView::mousePressEvent(QMouseEvent *press)
|
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),
|
DiveLogImportDialog::DiveLogImportDialog(QStringList *fn, QWidget *parent) : QDialog(parent),
|
||||||
|
|
Loading…
Add table
Reference in a new issue