您的位置:首页 > 编程语言 > Qt开发

PyQt4 单击事件

2015-09-28 13:05 393 查看
>>> from PyQt4 import QtGui
>>> import sys
>>> app = QtGui.QApplication(sys.argv)
>>> button = QtGui.QPushButton("Click me")
>>> button.move(QtGui.QCursor.pos())
>>> button.show()
>>> button.raise_()
>>> def hello():
...     print "hello"
...
>>> hello()
hello
>>> button.clicked.connect(hello)
>>> hello
hello
hello
hello
hello
hello
hello
hello
hello
button.clicked.disconnect(hello)
>>>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: