Re: [PyQt] Searching for a very small scprit using CLIPBOARD

2009-05-03 Thread projetmbc
Giovanni Bajo a écrit : 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.QAppl

Re: [PyQt] Searching for a very small scprit using CLIPBOARD

2009-04-27 Thread Aron Bierbaum
I have not tested on Linux, but it would not surprise me if it was not supported in the same way. -Aron On Mon, Apr 27, 2009 at 5:22 PM, 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 cod

Re: [PyQt] Searching for a very small scprit using CLIPBOARD

2009-04-27 Thread Roberto Alsina
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 s

Re: [PyQt] Searching for a very small scprit using CLIPBOARD

2009-04-27 Thread Giovanni Bajo
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.

Re: [PyQt] Searching for a very small scprit using CLIPBOARD

2009-04-27 Thread projetmbc
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 mu

Re: [PyQt] Searching for a very small scprit using CLIPBOARD

2009-04-26 Thread Aron Bierbaum
We ran into a similar situation where we wanted to ensure that a QPixmap that is copied into the clipboard stays after the application exits. Although as far as I know this should happen automatically when your Qt application exists, we had to do this use the following code manually before exiting

Re: [PyQt] Searching for a very small scprit using CLIPBOARD

2009-04-26 Thread projetmbc
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.. Christophe. Demetrius Cassidy a écrit : The clipboard will empty whe

Re: [PyQt] Searching for a very small scprit using CLIPBOARD

2009-04-25 Thread Demetrius Cassidy
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. proje

Re: [PyQt] Searching for a very small scprit using CLIPBOARD

2009-04-25 Thread projetmbc
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.cl

Re: [PyQt] Searching for a very small scprit using CLIPBOARD

2009-04-25 Thread Darren Dale
Have you tried constructing a QApplication first? On Sat, Apr 25, 2009 at 8:24 PM, projetmbc wrote: > I've already try that but I have the following message : > QWidget: Must construct a QApplication before a QPaintDevice > > Christophe. > > > Demetrius Cassidy a écrit : > >> from PyQt4.QtGui imp

Re: [PyQt] Searching for a very small scprit using CLIPBOARD

2009-04-25 Thread projetmbc
I've already try that but I have the following message : QWidget: Must construct a QApplication before a QPaintDevice Christophe. Demetrius Cassidy a écrit : from PyQt4.QtGui import QApplication clipboard = QApplication.clipboard() clipboard.setText('mytext') see http://doc.trolltech.com/4.5

Re: [PyQt] Searching for a very small scprit using CLIPBOARD

2009-04-25 Thread Demetrius Cassidy
from PyQt4.QtGui import QApplication clipboard = QApplication.clipboard() clipboard.setText('mytext') see http://doc.trolltech.com/4.5/qapplication.html projetmbc wrote: > > Hello, > here is an example for using the clipboard of Tkinter : > > from Tkinter import * > root

[PyQt] Searching for a very small scprit using CLIPBOARD

2009-04-25 Thread projetmbc
Hello, here is an example for using the clipboard of Tkinter : from Tkinter import * root = Tk() root.clipboard_clear() root.clipboard_append('A text in the clipboard...') root.withdraw() I would like to do the same with PyQt. Is it possible ? Christophe