相关疑难解决方法(0)

如何在退出PyQt4应用程序时禁用清除剪贴板?

我有一个简单的PyQt4应用程序(请参阅下面的代码),它揭示了下一个问题:如果我从QLineEdit中选择文本并将其复制到剪贴板,那么我只能在我的应用程序运行时将其粘贴到另一个应用程序.似乎在退出时PyQt应用程序清除了剪贴板,因此我无法在应用程序关闭后粘贴文本.

我该怎么做才能避免这个问题?

PyQt 4.4.3 @ Python 2.5 @ Windows XP.此效果也在PyQt 4.5+和Linux上得到证实.

import sys
from PyQt4 import QtGui
app = QtGui.QApplication(sys.argv)
edit = QtGui.QLineEdit()
edit.setText('foo bar')
edit.show()
app.exec_()
Run Code Online (Sandbox Code Playgroud)

python clipboard qt pyqt

7
推荐指数
1
解决办法
1611
查看次数

标签 统计

clipboard ×1

pyqt ×1

python ×1

qt ×1