I have a simple PyQt4 application (see the code below) that reveals a problem: if I select the text from a QLineEdit
and copy it to the clipboard, then I can paste it to another application only while my application is running. It seems that on exit, PyQt application clears the clipboard so I can't paste the text after the application is closed.
What can I do to avoid this problem?
PyQt 4.4.3 @ Python 2.5 @ Windows XP. Also this effect confirmed on PyQt 4.5+, and on Linux too.
import sys
from PyQt4 import QtGui
app = QtGui.QApplication(sys.argv)
edit = QtGui.QLineEdit()
edit.setText('foo bar')
edit.show()
app.exec_()
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…