show message when copy button is pressed
This commit is contained in:
parent
01108d8b47
commit
252cb491c8
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue