We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c8e2a3 commit 8c510ffCopy full SHA for 8c510ff
1 file changed
src/ExtendedTableWidget.cpp
@@ -86,12 +86,17 @@ void ExtendedTableWidget::copy()
86
87
SqliteTableModel* m = qobject_cast<SqliteTableModel*>(model());
88
89
- // If single image cell selected - copy it to clipboard
+ // If a single cell is selected, copy it to clipboard
90
if (indices.size() == 1) {
91
QImage img;
92
- if (img.loadFromData(m->data(indices.first(), Qt::EditRole).toByteArray())) {
+ QVariant data = m->data(indices.first(), Qt::EditRole);
93
+
94
+ if (img.loadFromData(data.toByteArray())) { // If it's an image
95
qApp->clipboard()->setImage(img);
96
return;
97
+ } else {
98
+ qApp->clipboard()->setText(data.toString());
99
+ return;
100
}
101
102
0 commit comments