From aa33ae9526a43dc90ebf06c96bcf3961abdbc6e4 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Tue, 6 Jan 2015 15:56:08 -0200 Subject: [PATCH] Add skeleton code for the table view that will accepts drops Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/divelogimportdialog.cpp | 25 ++++++++++++++++++++++++- qt-ui/divelogimportdialog.h | 14 ++++++++++++++ qt-ui/divelogimportdialog.ui | 7 ++++++- 3 files changed, 44 insertions(+), 2 deletions(-) diff --git a/qt-ui/divelogimportdialog.cpp b/qt-ui/divelogimportdialog.cpp index 8788db6c3..338fb1efa 100644 --- a/qt-ui/divelogimportdialog.cpp +++ b/qt-ui/divelogimportdialog.cpp @@ -96,7 +96,6 @@ void ColumnNameView::mousePressEvent(QMouseEvent *press) void ColumnNameView::dragLeaveEvent(QDragLeaveEvent *leave) { - } void ColumnNameView::dragEnterEvent(QDragEnterEvent *event) @@ -118,6 +117,30 @@ void ColumnNameView::dropEvent(QDropEvent *event) } } +ColumnDropCSVView::ColumnDropCSVView(QWidget *parent) +{ + +} + +void ColumnDropCSVView::dragLeaveEvent(QDragLeaveEvent *leave) +{ + +} + +void ColumnDropCSVView::dragEnterEvent(QDragEnterEvent *event) +{ + +} + +void ColumnDropCSVView::dragMoveEvent(QDragMoveEvent *event) +{ + +} + +void ColumnDropCSVView::dropEvent(QDropEvent *event) +{ + +} DiveLogImportDialog::DiveLogImportDialog(QStringList *fn, QWidget *parent) : QDialog(parent), selector(true), diff --git a/qt-ui/divelogimportdialog.h b/qt-ui/divelogimportdialog.h index efb7f296a..ed781a580 100644 --- a/qt-ui/divelogimportdialog.h +++ b/qt-ui/divelogimportdialog.h @@ -5,6 +5,7 @@ #include #include #include +#include #include "../dive.h" #include "../divelist.h" @@ -40,6 +41,19 @@ private: int currentDraggedIndex; }; +class ColumnDropCSVView : public QTableView { + Q_OBJECT +public: + ColumnDropCSVView(QWidget *parent); +protected: + void dragLeaveEvent(QDragLeaveEvent *leave); + void dragEnterEvent(QDragEnterEvent *event); + void dragMoveEvent(QDragMoveEvent *event); + void dropEvent(QDropEvent *event); +private: + QStringList columns; +}; + class DiveLogImportDialog : public QDialog { Q_OBJECT diff --git a/qt-ui/divelogimportdialog.ui b/qt-ui/divelogimportdialog.ui index 8cbf9bc0e..881c3276b 100644 --- a/qt-ui/divelogimportdialog.ui +++ b/qt-ui/divelogimportdialog.ui @@ -118,7 +118,7 @@ - + @@ -144,6 +144,11 @@ QListView
divelogimportdialog.h
+ + ColumnDropCSVView + QTableView +
divelogimportdialog.h
+
buttonBox