使用PyQt5 clipboard.setMimeData()
QXcbClipboard::setMimeData: Cannot set X11 selection owner
def copy(index, app):
clipboard = app.clipboard()
Mode = clipboard.Clipboard
initialMimeData = clipboard.mimeData(mode = Mode)
import pyautogui
pyautogui.hotkey('ctrl', 'c')
mimeData = clipboard.mimeData(mode = Mode)
clipboards[index-1]["Data"] = mimeData
clipboard.setMimeData(initialMimeData, mode = Mode) #getting the error here
我在Ubuntu 16.04上运行它。为什么我会遇到此问题以及如何解决?