ExtendedTableWidget: Fix bug when just copying one cell

The code for copying the selected cells to the clipboard doesn't work
when there is just one cell selected. Fix the code by including a
special handling for this case which returns the content of the single
selected cell without any quotes or the like.
This commit is contained in:
Martin Kleusberg
2013-11-30 14:08:19 +01:00
parent 9214cfbc21
commit 6ff8ba2fdb

View File

@@ -24,7 +24,12 @@ void ExtendedTableWidget::copy()
// Abort if there's nothing to copy
if(indices.size() == 0)
{
return;
} else if(indices.size() == 1) {
qApp->clipboard()->setText(indices.front().data().toString());
return;
}
// Sort the items by row, then by column
qSort(indices);