Last active
August 29, 2015 14:05
-
-
Save weijia/55820d9a4349bc675bd8 to your computer and use it in GitHub Desktop.
PyQt clipboard event capture
This file contains 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
#!/usr/bin/env python | |
#coding=utf-8 | |
import sys | |
from PyQt4 import QtGui, QtCore | |
import os | |
def notification(): | |
print "good" | |
if __name__ == '__main__': | |
print "OS Name:"+os.name | |
app = QtGui.QApplication(sys.argv) | |
edit = QtGui.QLineEdit() | |
edit.setText('foo bar') | |
edit.show() | |
app.clipboard().dataChanged.connect(notification) | |
sys.exit(app.exec_()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment