[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] Searching for a very small scprit using CLIPBOARD
From:       Roberto Alsina <ralsina () kde ! org>
Date:       2009-04-27 22:28:28
Message-ID: 200904271928.29721.ralsina () kde ! org
[Download RAW message or body]

On Monday 27 April 2009 19:22:04 Giovanni Bajo wrote:
> On lun, 2009-04-27 at 18:42 +0200, projetmbc wrote:
> > Thanks a lot, your solution works fine.  :-)  Here is the complete
> > minimal code :
> >
> > ====================================
> > #!/usr/bin/env python
> > #coding=utf-8
> > import sys
> > from PyQt4 import QtGui, QtCore
> > app = QtGui.QApplication(sys.argv)
> > clipboard = app.clipboard()
> > clipboard.setText('The text that must be copied...')
> > event = QtCore.QEvent(QtCore.QEvent.Clipboard)
> > app.sendEvent(clipboard, event)
> > ====================================
>
> It doesn't work for me on Linux. Should it?

Remember that in Linux, unless you have something like klipper, when the app 
setting the clipboard exits, the clipboard empties.


_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic