Skip to content

Commit a84f9ef

Browse files
committed
qrcode plugin
1 parent a9ee961 commit a84f9ef

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/plugins/menu_qrcode.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
A menu plugin showing QR-Code for bitmessage address in modal dialog.
44
"""
55

6-
from PyQt4 import QtGui, QtCore
6+
from qtpy import QtGui, QtCore, QtWidgets
77
import qrcode
88

99
from pybitmessage.tr import _translate
@@ -35,23 +35,23 @@ def drawrect(self, row, col):
3535
QtCore.Qt.black)
3636

3737

38-
class QRCodeDialog(QtGui.QDialog):
38+
class QRCodeDialog(QtWidgets.QDialog):
3939
"""The dialog"""
4040
def __init__(self, parent):
4141
super(QRCodeDialog, self).__init__(parent)
42-
self.image = QtGui.QLabel(self)
43-
self.label = QtGui.QLabel(self)
42+
self.image = QtWidgets.QLabel(self)
43+
self.label = QtWidgets.QLabel(self)
4444
font = QtGui.QFont()
4545
font.setBold(True)
4646
font.setWeight(75)
4747
self.label.setFont(font)
4848
self.label.setAlignment(
4949
QtCore.Qt.AlignCenter | QtCore.Qt.AlignVCenter)
50-
buttonBox = QtGui.QDialogButtonBox(self)
50+
buttonBox = QtWidgets.QDialogButtonBox(self)
5151
buttonBox.setOrientation(QtCore.Qt.Horizontal)
52-
buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok)
52+
buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Ok)
5353
buttonBox.accepted.connect(self.accept)
54-
layout = QtGui.QVBoxLayout(self)
54+
layout = QtWidgets.QVBoxLayout(self)
5555
layout.addWidget(self.image)
5656
layout.addWidget(self.label)
5757
layout.addWidget(buttonBox)
@@ -66,7 +66,7 @@ def render(self, text):
6666
self.label.setText(text)
6767
self.image.setPixmap(
6868
qrcode.make(text, image_factory=Image).pixmap())
69-
self.setFixedSize(QtGui.QWidget.sizeHint(self))
69+
self.setFixedSize(QtWidgets.QWidget.sizeHint(self))
7070

7171

7272
def connect_plugin(form):

0 commit comments

Comments
 (0)