From a6104834201fb0bde72f0c9f0845d3a1b9848d66 Mon Sep 17 00:00:00 2001 From: Michael Buesch Date: Thu, 10 May 2018 20:25:01 +0200 Subject: gui/projecttree: Only use clipboard selection, if it is available Signed-off-by: Michael Buesch --- awlsim/gui/projecttreewidget.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/awlsim/gui/projecttreewidget.py b/awlsim/gui/projecttreewidget.py index 2d19d926..d42c7193 100644 --- a/awlsim/gui/projecttreewidget.py +++ b/awlsim/gui/projecttreewidget.py @@ -487,7 +487,8 @@ class ProjectTreeModel(QAbstractItemModel): if not clipboard: return False clipboard.setMimeData(mimeData, QClipboard.Clipboard) - clipboard.setMimeData(mimeData, QClipboard.Selection) + if clipboard.supportsSelection(): + clipboard.setMimeData(mimeData, QClipboard.Selection) return True def entryClipboardCut(self, index, parentWidget=None): @@ -507,6 +508,8 @@ class ProjectTreeModel(QAbstractItemModel): if not clipboard: return None mimeData = clipboard.mimeData(QClipboard.Clipboard) + if not mimeData: + return None parentIdxIdBase, parentIdxId, parentItemNr = self.indexToId(parentIndex) if parentIdxIdBase == 0: -- cgit v1.2.3