Created
April 20, 2017 05:19
-
-
Save redstoneleo/38af77c69d91205f88f7c66b7892b18f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#I write the slot of QClipboard::dataChanged() as this to avoid the bug, | |
@pyqtSlot() | |
def detectClipboardUrl(self): | |
clipboardText = self.clipboard.text() | |
if getattr(self.clipboard, 'lastClipboardUrl', None) != clipboardText: | |
url = clipboardText | |
setattr(self.clipboard, 'lastClipboardUrl', url) | |
#会造成不能连续复制同样的url | |
self.on_autodownloadEnable_triggered() # 立即断开 Clipboard的信号联系,# 为了防止chrome造成signal call twice的bug | |
QTimer.singleShot(400, self.on_autodownloadEnable_triggered) # #会造成400ms内无法连续复制的url |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment