Skip to content

Commit 8c510ff

Browse files
committed
Add unquoted single cell copy functionality
If a single cell is copied, its contents are not quoted now. This was working in 3.8.0. See #789
1 parent 4c8e2a3 commit 8c510ff

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/ExtendedTableWidget.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,17 @@ void ExtendedTableWidget::copy()
8686

8787
SqliteTableModel* m = qobject_cast<SqliteTableModel*>(model());
8888

89-
// If single image cell selected - copy it to clipboard
89+
// If a single cell is selected, copy it to clipboard
9090
if (indices.size() == 1) {
9191
QImage img;
92-
if (img.loadFromData(m->data(indices.first(), Qt::EditRole).toByteArray())) {
92+
QVariant data = m->data(indices.first(), Qt::EditRole);
93+
94+
if (img.loadFromData(data.toByteArray())) { // If it's an image
9395
qApp->clipboard()->setImage(img);
9496
return;
97+
} else {
98+
qApp->clipboard()->setText(data.toString());
99+
return;
95100
}
96101
}
97102

0 commit comments

Comments
 (0)