mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
b7e27e3141
commit
cedf339e1e
1 changed files with 6 additions and 2 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue