qt qrcodewidget: on MacOS, was grabbing whole screen

from Electron-Cash/Electron-Cash@61d46989e6
This commit is contained in:
SomberNight 2019-03-04 04:24:45 +01:00
parent 43583c1e28
commit bf1c1c2a11
No known key found for this signature in database
GPG key ID: B33B5F232C6271E9

View file

@ -89,7 +89,6 @@ class QRDialog(WindowModalDialog):
vbox = QVBoxLayout()
qrw = QRCodeWidget(data)
qscreen = QApplication.primaryScreen()
vbox.addWidget(qrw, 1)
if show_text:
text = QTextEdit()
@ -104,12 +103,12 @@ class QRDialog(WindowModalDialog):
filename = os.path.join(config.path, "qrcode.png")
def print_qr():
p = qscreen.grabWindow(qrw.winId())
p = qrw.grab() # FIXME also grabs neutral colored padding
p.save(filename, 'png')
self.show_message(_("QR code saved to file") + " " + filename)
def copy_to_clipboard():
p = qscreen.grabWindow(qrw.winId())
p = qrw.grab()
QApplication.clipboard().setPixmap(p)
self.show_message(_("QR code copied to clipboard"))