diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2015-01-06 15:14:14 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-01-06 19:37:20 -0800 |
commit | 81f2ee589246556271aae73f2dcbaba019b18207 (patch) | |
tree | 640527b6f3f1c822308df16ea3ff36a50a99a451 /qt-ui/divelogimportdialog.cpp | |
parent | 0a1908137b587379d26c1891bb897347169c9235 (diff) | |
download | subsurface-81f2ee589246556271aae73f2dcbaba019b18207.tar.gz |
More DragDrop skeletons
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.cpp | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/qt-ui/divelogimportdialog.cpp b/qt-ui/divelogimportdialog.cpp index dbb3f60dd..9db910661 100644 --- a/qt-ui/divelogimportdialog.cpp +++ b/qt-ui/divelogimportdialog.cpp @@ -34,7 +34,7 @@ bool ColumnNameProvider::insertRows(int row, int count, const QModelIndex &paren bool ColumnNameProvider::removeRows(int row, int count, const QModelIndex &parent) { - + qDebug() << "Calling"; } bool ColumnNameProvider::setData(const QModelIndex &index, const QVariant &value, int role) @@ -61,7 +61,8 @@ int ColumnNameProvider::rowCount(const QModelIndex &parent) const ColumnNameView::ColumnNameView(QWidget *parent) { - + setAcceptDrops(true); + setDragEnabled(true); } void ColumnNameView::mousePressEvent(QMouseEvent *press) @@ -76,8 +77,30 @@ void ColumnNameView::mousePressEvent(QMouseEvent *press) mimeData->setText(atClick.data().toString()); drag->setMimeData(mimeData); drag->exec(); + currentDraggedIndex = atClick.row(); +} + +void ColumnNameView::dragLeaveEvent(QDragLeaveEvent *leave) +{ + model()->removeRow(currentDraggedIndex); +} + +void ColumnNameView::dragEnterEvent(QDragEnterEvent *event) +{ + } +void ColumnNameView::dragMoveEvent(QDragMoveEvent *event) +{ + +} + +void ColumnNameView::dropEvent(QDropEvent *event) +{ + +} + + DiveLogImportDialog::DiveLogImportDialog(QStringList *fn, QWidget *parent) : QDialog(parent), selector(true), ui(new Ui::DiveLogImportDialog) |