[PyQt] [BUG ?]slot of QClipboard::dataChanged() was called twice

Zhao Lee redstone-cold at 163.com
Thu Sep 1 03:31:06 BST 2016


 Someone says it is  a bug in Chromium 
http://stackoverflow.com/questions/39191394/slot-of-qclipboarddatachanged-was-called-twice
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)






在2016年08月30 20时52分, "Chris Pezley"<chris.pezley at quantumwise.com>写道:

             

I made a solution for a similar problem with qscintilla - it      should be applicable here. Take a look at the mailing list entry      here:https://www.riverbankcomputing.com/pipermail/qscintilla/2016-May/001134.html
   


   
On 08/30/2016 02:43 PM, michael h      wrote:
   
 any                    solutions ?

               

           
You could use a QTimer to delay and process only the              last change (maybe only in the case where a duplicate is              detected)

           

           

           

     
     
_______________________________________________
PyQt mailing list    PyQt at riverbankcomputing.comhttps://www.riverbankcomputing.com/mailman/listinfo/pyqt
   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20160901/b75cd581/attachment.html>


More information about the PyQt mailing list