show message when copy button is pressed

This commit is contained in:
ThomasV 2017-10-06 16:50:05 +02:00
parent 01108d8b47
commit 252cb491c8
1 changed files with 5 additions and 2 deletions

View File

@ -531,8 +531,11 @@ class ButtonsWidget(QWidget):
def addCopyButton(self, app):
self.app = app
f = lambda: self.app.clipboard().setText(str(self.text()))
self.addButton(":icons/copy.png", f, _("Copy to clipboard"))
self.addButton(":icons/copy.png", self.on_copy, _("Copy to clipboard"))
def on_copy(self):
self.app.clipboard().setText(self.text())
QToolTip.showText(QCursor.pos(), _("Text copied to clipboard"), self)
class ButtonsLineEdit(QLineEdit, ButtonsWidget):
def __init__(self, text=None):