fix qr code saving

This commit is contained in:
SomberNight 2017-09-23 22:16:36 +02:00
parent ffdafc57b7
commit 2ea78f7f3b
1 changed files with 3 additions and 2 deletions

View File

@ -97,6 +97,7 @@ class QRDialog(WindowModalDialog):
vbox = QVBoxLayout()
qrw = QRCodeWidget(data)
qscreen = QApplication.primaryScreen()
vbox.addWidget(qrw, 1)
if show_text:
text = QTextEdit()
@ -111,12 +112,12 @@ class QRDialog(WindowModalDialog):
filename = os.path.join(config.path, "qrcode.png")
def print_qr():
p = QScreen.grabWindow(qrw.winId())
p = qscreen.grabWindow(qrw.winId())
p.save(filename, 'png')
self.show_message(_("QR code saved to file") + " " + filename)
def copy_to_clipboard():
p = QScreen.grabWindow(qrw.winId())
p = qscreen.grabWindow(qrw.winId())
p.save(filename, 'png')
QApplication.clipboard().setImage(QImage(filename))
self.show_message(_("QR code copied to clipboard"))