From 6ff8ba2fdb4146535ce8a99a2707d1d93ceec2a1 Mon Sep 17 00:00:00 2001 From: Martin Kleusberg Date: Sat, 30 Nov 2013 14:08:19 +0100 Subject: [PATCH] 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. --- src/ExtendedTableWidget.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ExtendedTableWidget.cpp b/src/ExtendedTableWidget.cpp index 64583534..f5d400f1 100644 --- a/src/ExtendedTableWidget.cpp +++ b/src/ExtendedTableWidget.cpp @@ -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);