mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Re-add the string to the avaliable models if drag cancelled
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
9042abc68c
commit
909be75113
1 changed files with 5 additions and 2 deletions
|
@ -92,8 +92,11 @@ void ColumnNameView::mousePressEvent(QMouseEvent *press)
|
||||||
model()->removeRow(atClick.row());
|
model()->removeRow(atClick.row());
|
||||||
drag->setPixmap(pix);
|
drag->setPixmap(pix);
|
||||||
drag->setMimeData(mimeData);
|
drag->setMimeData(mimeData);
|
||||||
drag->exec();
|
if (drag->exec() == Qt::IgnoreAction){
|
||||||
|
model()->insertRow(model()->rowCount());
|
||||||
|
QModelIndex idx = model()->index(model()->rowCount()-1, 0);
|
||||||
|
model()->setData(idx, mimeData->text());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ColumnNameView::dragLeaveEvent(QDragLeaveEvent *leave)
|
void ColumnNameView::dragLeaveEvent(QDragLeaveEvent *leave)
|
||||||
|
|
Loading…
Add table
Reference in a new issue