Showing posts with label QtGui. Show all posts
Showing posts with label QtGui. Show all posts

Thursday, March 30, 2017

Using clipboard in PyQt

You can use the clipboard in your PyQt plugins by using the QApplication.clipboard().
First you import qthe QApplication from PyQt4.QtGui.

from PyQt4.QtGui import QApplication

Then you can create a variable, for example:

self.clip = QApplication.clipboard()

And then set some text to it:

self.clip.setText('some text')