Skip to content

Commit 70458d8

Browse files
authored
Merge pull request #2966 from alicevision/fix/clipboard
[components] Clipboard: Fix clipboard instantiation error with Qt6
2 parents 8bb966b + 2292c8e commit 70458d8

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

meshroom/ui/components/clipboard.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from PySide6.QtCore import Slot, QObject
2-
from PySide6.QtGui import QClipboard
2+
from PySide6.QtGui import QGuiApplication
33

44

55
class ClipboardHelper(QObject):
@@ -9,14 +9,7 @@ class ClipboardHelper(QObject):
99

1010
def __init__(self, parent=None):
1111
super(ClipboardHelper, self).__init__(parent)
12-
self._clipboard = QClipboard(parent=self)
13-
14-
def __del__(self):
15-
# Workaround to avoid the "QXcbClipboard: Unable to receive an event from the clipboard manager
16-
# in a reasonable time" that will hold up the application when exiting if the clipboard has been
17-
# used at least once and its content exceeds a certain size (on X11/XCB).
18-
# The bug occurs in QClipboard and is present on all Qt5 versions.
19-
self.clear()
12+
self._clipboard = QGuiApplication.clipboard()
2013

2114
@Slot(str)
2215
def setText(self, value):

0 commit comments

Comments
 (0)