Skip to content

Commit 6181ca8

Browse files
kerncastaric
authored andcommitted
Merge pull request biolab#1808 from ales-erjavec/fixes/table-clipboard-copy
[FIX] Fix copy to clipboard in "Data Table" widget (cherry picked from commit c4755ab)
1 parent 4151ec9 commit 6181ca8

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Orange/widgets/data/owtable.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,8 @@ def table_selection_to_mime_data(table):
320320
"""
321321
lines = table_selection_to_list(table)
322322

323-
csv = lines_to_csv_string(lines, dialect="excel")
324-
tsv = lines_to_csv_string(lines, dialect="excel-tab")
323+
csv = lines_to_csv_string(lines, dialect="excel").encode("utf-8")
324+
tsv = lines_to_csv_string(lines, dialect="excel-tab").encode("utf-8")
325325

326326
mime = QMimeData()
327327
mime.setData("text/csv", QByteArray(csv))
@@ -432,9 +432,8 @@ def __init__(self):
432432
self.tabs = gui.tabWidget(self.mainArea)
433433
self.tabs.currentChanged.connect(self._on_current_tab_changed)
434434

435-
copy = QAction("Copy", self, shortcut=QKeySequence.Copy,
436-
triggered=self.copy)
437-
self.addAction(copy)
435+
def copy_to_clipboard(self):
436+
self.copy()
438437

439438
def sizeHint(self):
440439
return QSize(800, 500)

0 commit comments

Comments
 (0)