migration to PyQt5. initial commit.
This commit is contained in:
@@ -4,9 +4,11 @@ from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import six
|
||||
from PyQt4.QtGui import *
|
||||
from PyQt4.QtCore import *
|
||||
import PyQt4.QtGui as QtGui
|
||||
from PyQt5.QtGui import *
|
||||
from PyQt5.QtCore import *
|
||||
import PyQt5.QtGui as QtGui
|
||||
from PyQt5.QtWidgets import (
|
||||
QApplication, QVBoxLayout, QTextEdit, QHBoxLayout, QPushButton, QWidget)
|
||||
|
||||
import os
|
||||
import qrcode
|
||||
@@ -109,12 +111,12 @@ class QRDialog(WindowModalDialog):
|
||||
filename = os.path.join(config.path, "qrcode.png")
|
||||
|
||||
def print_qr():
|
||||
p = QPixmap.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 = QPixmap.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"))
|
||||
|
||||
Reference in New Issue
Block a user