Created
April 20, 2017 05:27
-
-
Save redstoneleo/2ac9ca8037e1621c2f49b264573d03fc 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) | |
QTimer.singleShot(400, lambda:setattr(self.clipboard, 'lastClipboardUrl', None))#the interval of successive call of this slot is less than 400ms, after 400ms this line would allow you copy the same Text again |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment