[PyQt] Searching for a very small scprit using CLIPBOARD

projetmbc projetmbc at club-internet.fr
Sun Apr 26 08:34:58 BST 2009

sys.exit(app.exec_()) doesn't work. If the clipboard is empty when the program exits, I will do without PyQt so as to have a "universal" clipboard.

Thanks a lot because now I knows how to use clipboard in a "real" program..

Demetrius Cassidy a écrit :
> The clipboard will empty when your program exits. Afaik this is normal
> behavior with Qt and clipboard access. 
> I know if I use wxWindows the text in the clipboard stays even if I close my
> app, however I am not sure if it's possible to do this in Qt.
> And use sys.exit(app.exec_()) instead.
> projetmbc wrote:
>> I've tried the following code but the application never stops because of 
>> app.exec_(), and when I close the application, the clipboard is "empty".
>> =========================
>> #!/usr/bin/env python
>> #coding=utf-8
>> import sys
>> from PyQt4 import QtGui
>> app = QtGui.QApplication(sys.argv)
>> clipboard = app.clipboard()
>> clipboard.setText('texte')
>> app.exec_()
>> =========================

More information about the PyQt mailing list