mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-07-23 19:47:39 +02:00
Clear clipboard's content when exiting
Workaround for a bug in QClipboard that occurs when the clipboard has been used within the app and its content exceeds a certain size on X11/XCB. This issue will hold up the app when exiting and is present in Qt5 versions. With this workaround, the content of the clipboard will be lost when exiting, but the app will exit normally.
This commit is contained in:
parent
5b65866e49
commit
08d502f4a6
1 changed files with 7 additions and 0 deletions
|
@ -11,6 +11,13 @@ class ClipboardHelper(QObject):
|
|||
super(ClipboardHelper, self).__init__(parent)
|
||||
self._clipboard = QClipboard(parent=self)
|
||||
|
||||
def __del__(self):
|
||||
# Workaround to avoid the "QXcbClipboard: Unable to receive an event from the clipboard manager
|
||||
# in a reasonable time" that will hold up the application when exiting if the clipboard has been
|
||||
# used at least once and its content exceeds a certain size (on X11/XCB).
|
||||
# The bug occurs in QClipboard and is present on all Qt5 versions.
|
||||
self.clear()
|
||||
|
||||
@Slot(str)
|
||||
def setText(self, value):
|
||||
self._clipboard.setText(value)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue