From ed4dd921bbe2ea094867df662abb63070e501f35 Mon Sep 17 00:00:00 2001 From: Ales Erjavec Date: Fri, 9 Dec 2016 12:32:10 +0100 Subject: [PATCH 1/2] owtable: Fix copy selection to clipoard Did not work since 55d31c159d179a53700d96fca5d6359c9ea4349b due to ambiguous shortcut overload --- Orange/widgets/data/owtable.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Orange/widgets/data/owtable.py b/Orange/widgets/data/owtable.py index f5dbdc0f5cc..7699ef6f624 100644 --- a/Orange/widgets/data/owtable.py +++ b/Orange/widgets/data/owtable.py @@ -432,9 +432,8 @@ def __init__(self): self.tabs = gui.tabWidget(self.mainArea) self.tabs.currentChanged.connect(self._on_current_tab_changed) - copy = QAction("Copy", self, shortcut=QKeySequence.Copy, - triggered=self.copy) - self.addAction(copy) + def copy_to_clipboard(self): + self.copy() def sizeHint(self): return QSize(800, 500) From cc589319797d51052db9913b5749d683147e5438 Mon Sep 17 00:00:00 2001 From: Ales Erjavec Date: Fri, 9 Dec 2016 12:38:56 +0100 Subject: [PATCH 2/2] owtable: Fix an TypeError when using PyQt5 `PyQt5.QtCore.QByteArray` raises an TypeError if called with a `str. --- Orange/widgets/data/owtable.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Orange/widgets/data/owtable.py b/Orange/widgets/data/owtable.py index 7699ef6f624..d02fe79b764 100644 --- a/Orange/widgets/data/owtable.py +++ b/Orange/widgets/data/owtable.py @@ -320,8 +320,8 @@ def table_selection_to_mime_data(table): """ lines = table_selection_to_list(table) - csv = lines_to_csv_string(lines, dialect="excel") - tsv = lines_to_csv_string(lines, dialect="excel-tab") + csv = lines_to_csv_string(lines, dialect="excel").encode("utf-8") + tsv = lines_to_csv_string(lines, dialect="excel-tab").encode("utf-8") mime = QMimeData() mime.setData("text/csv", QByteArray(csv))