<div><div style="color: rgb(0, 0, 0); font-family: arial; font-size: 14px;">As tested With PyQt5.7,Python3.5 on Win7 32bit,</div><div style="color: rgb(0, 0, 0); font-family: arial; font-size: 14px;"><span style="line-height: 1.7;">the slot </span><span style="line-height: 23.8px;">detectClipboardUrl </span><span style="line-height: 1.7;">of QClipboard::dataChanged() was called twice </span><span style="line-height: 23.8px;">In this code</span><span style="line-height: 1.7;">, while I need the slot to be called only once , any solutions ?</span></div><div><br></div><div>import sys</div><div>from PyQt5.QtCore import *</div><div>from PyQt5.QtGui import *</div><div>from PyQt5.QtWidgets import *</div><div><br></div><div><br></div><div>class MainWindow(QTableView):</div><div><br></div><div>    def __init__(self, parent=None):</div><div>        super().__init__(parent)</div><div>        self.clipboard = QApplication.clipboard()</div><div>        self.clipboard.dataChanged.connect(self.detectClipboardUrl)  </div><div><br></div><div>    @pyqtSlot()</div><div>    def detectClipboardUrl(self):</div><div>    <span class="Apple-tab-span" style="white-space:pre">     </span>print('detectClipboardUrl')</div><div>    <span class="Apple-tab-span" style="white-space:pre">    </span>clipboardText = self.clipboard.text()</div><div>    <span class="Apple-tab-span" style="white-space:pre">  </span>print(clipboardText)</div><div><br></div><div><br></div><div>if __name__ == "__main__":</div><div>    app = QApplication(sys.argv)</div><div>    ui = MainWindow()</div><div>    ui.show()</div><div>    sys.exit(app.exec_())</div><div style="color: rgb(0, 0, 0); font-family: arial; font-size: 14px;"><br></div><div style="color: rgb(0, 0, 0); font-family: arial; font-size: 14px;"><br></div><div style="color: rgb(0, 0, 0); font-family: arial; font-size: 14px;"><br></div><div style="color: rgb(0, 0, 0); font-family: arial; font-size: 14px;"><br></div></div><!-- jy5ContentSuffix --><br><br><span title="neteasefooter"><p> </p></span>