mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-19 10:20:17 -06:00
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
This commit is contained in:
@@ -86,12 +86,17 @@ void ExtendedTableWidget::copy()
|
||||
|
||||
SqliteTableModel* m = qobject_cast<SqliteTableModel*>(model());
|
||||
|
||||
// If single image cell selected - copy it to clipboard
|
||||
// If a single cell is selected, copy it to clipboard
|
||||
if (indices.size() == 1) {
|
||||
QImage img;
|
||||
if (img.loadFromData(m->data(indices.first(), Qt::EditRole).toByteArray())) {
|
||||
QVariant data = m->data(indices.first(), Qt::EditRole);
|
||||
|
||||
if (img.loadFromData(data.toByteArray())) { // If it's an image
|
||||
qApp->clipboard()->setImage(img);
|
||||
return;
|
||||
} else {
|
||||
qApp->clipboard()->setText(data.toString());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user