Method
updateMimeData
(self,
hasColor, color,
hasHtml, html,
hasImage, image,
hasText, text,
hasUrls, urls,
hasFiles, files,
)
Source from the content-addressed store, hash-verified
| 58 | bool, QVariant # files |
| 59 | ) |
| 60 | def updateMimeData(self, |
| 61 | hasColor, color, |
| 62 | hasHtml, html, |
| 63 | hasImage, image, |
| 64 | hasText, text, |
| 65 | hasUrls, urls, |
| 66 | hasFiles, files, |
| 67 | ): |
| 68 | # 客户端剪切板同步到服务端 |
| 69 | self.append('收到客户端发送的剪贴板') |
| 70 | clipboard = QApplication.clipboard() |
| 71 | clipboard.blockSignals(True) |
| 72 | data = QMimeData() |
| 73 | if hasColor: |
| 74 | data.setColorData(color) |
| 75 | if hasHtml: |
| 76 | data.setHtml(html) |
| 77 | if hasImage: |
| 78 | data.setImageData(image) |
| 79 | if hasText: |
| 80 | data.setText(text) |
| 81 | # if hasUrls: |
| 82 | # data.setUrls(urls) |
| 83 | if hasFiles: |
| 84 | data.setData('') |
| 85 | clipboard.setMimeData(data) |
| 86 | clipboard.blockSignals(False) |
| 87 | |
| 88 | |
| 89 | if __name__ == '__main__': |
Callers
nothing calls this directly
Tested by
no test coverage detected