Skip to content

Commit

Permalink
add keyboard callback for copying figure to clipboard
Browse files Browse the repository at this point in the history
  • Loading branch information
eendebakpt committed Jul 29, 2016
1 parent dc0f191 commit 6a73916
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions qcodes/plots/pyqtgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -675,3 +675,8 @@ def copyToClipboard(self):
app = pg.mkQApp()
clipboard = app.clipboard()
clipboard.setPixmap(QtGui.QPixmap.grabWidget(self))

def keyPressEvent(self, e):
if e.key() == pg.QtCore.Qt.Key_C:
self.copyToClipboard()
super().keyPressEvent(e)

0 comments on commit 6a73916

Please sign in to comment.