mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-05-06 20:09:54 -05:00
Make sure to properly clear the system clipboard when copying data
When copying binary data or similar using the internal copy-paste buffer we need to clear the system clipboard first in order to avoid confusion between the two paste sources. Just calling clear() on the clipboard doesn't seem to work on my system, so this commit manually sets the clipboard text to a null string.
This commit is contained in:
@@ -208,6 +208,7 @@ void ExtendedTableWidget::copy(const bool withHeaders)
|
||||
if (text.isEmpty())
|
||||
{
|
||||
// The field is either NULL or empty. Those are are handled via the internal copy-paste buffer
|
||||
qApp->clipboard()->setText(QString()); // Calling clear() alone doesn't seem to work on all systems
|
||||
qApp->clipboard()->clear();
|
||||
m_buffer.push_back(QByteArrayList{data.toByteArray()});
|
||||
return;
|
||||
@@ -235,6 +236,7 @@ void ExtendedTableWidget::copy(const bool withHeaders)
|
||||
if (containsBinary)
|
||||
{
|
||||
// Make sure to clear the system clipboard, so it's not used when pasting
|
||||
qApp->clipboard()->setText(QString()); // Calling clear() alone doesn't seem to work on all systems
|
||||
qApp->clipboard()->clear();
|
||||
|
||||
// Copy selected data into internal copy-paste buffer
|
||||
|
||||
Reference in New Issue
Block a user