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:
Tomaz Canabrava 2015-01-06 17:19:08 -02:00 committed by Dirk Hohndel
parent 9042abc68c
commit 909be75113

View file

@ -92,8 +92,11 @@ void ColumnNameView::mousePressEvent(QMouseEvent *press)
model()->removeRow(atClick.row());
drag->setPixmap(pix);
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)