summaryrefslogtreecommitdiffstats
path: root/qt-ui/divelogimportdialog.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-01-06 15:42:50 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-01-06 19:37:35 -0800
commitcedf339e1e8a7d146a3fa3a86e1eac9be2dd0d6e (patch)
treecfe50d077afb48e768006e8a75c5a38717d4acd9 /qt-ui/divelogimportdialog.cpp
parentb7e27e3141164c73390a445be9533b0a31d07115 (diff)
downloadsubsurface-cedf339e1e8a7d146a3fa3a86e1eac9be2dd0d6e.tar.gz
Show the pixmap being dragged
This way we know that we got the correct drag thingy. 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.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/qt-ui/divelogimportdialog.cpp b/qt-ui/divelogimportdialog.cpp
index 89065cd50..8788db6c3 100644
--- a/qt-ui/divelogimportdialog.cpp
+++ b/qt-ui/divelogimportdialog.cpp
@@ -79,11 +79,16 @@ void ColumnNameView::mousePressEvent(QMouseEvent *press)
if (!atClick.isValid())
return;
- qDebug() << atClick.data();
+ QRect indexRect = visualRect(atClick);
+ QPixmap pix(indexRect.width(), indexRect.height());
+ pix.fill(QColor(0,0,0,0));
+ render(&pix, QPoint(0, 0),QRegion(indexRect));
+
QDrag *drag = new QDrag(this);
QMimeData *mimeData = new QMimeData;
mimeData->setText(atClick.data().toString());
model()->removeRow(atClick.row());
+ drag->setPixmap(pix);
drag->setMimeData(mimeData);
drag->exec();
@@ -110,7 +115,6 @@ void ColumnNameView::dropEvent(QDropEvent *event)
if (mimeData->hasText()) {
model()->insertRow(model()->rowCount());
model()->setData(model()->index(model()->rowCount()-1, 0), QVariant(mimeData->text()));
- qDebug() << "model -> rowcount() " << model()->rowCount();
}
}