Skip to content

Commit

Permalink
qrcode plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
g1itch committed Nov 5, 2018
1 parent 680d72b commit 2f87e52
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/plugins/menu_qrcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
A menu plugin showing QR-Code for bitmessage address in modal dialog.
"""

from PyQt4 import QtGui, QtCore
from qtpy import QtGui, QtCore, QtWidgets
import qrcode

from pybitmessage.tr import _translate
Expand Down Expand Up @@ -35,23 +35,23 @@ def drawrect(self, row, col):
QtCore.Qt.black)


class QRCodeDialog(QtGui.QDialog):
class QRCodeDialog(QtWidgets.QDialog):
"""The dialog"""
def __init__(self, parent):
super(QRCodeDialog, self).__init__(parent)
self.image = QtGui.QLabel(self)
self.label = QtGui.QLabel(self)
self.image = QtWidgets.QLabel(self)
self.label = QtWidgets.QLabel(self)
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.label.setFont(font)
self.label.setAlignment(
QtCore.Qt.AlignCenter | QtCore.Qt.AlignVCenter)
buttonBox = QtGui.QDialogButtonBox(self)
buttonBox = QtWidgets.QDialogButtonBox(self)
buttonBox.setOrientation(QtCore.Qt.Horizontal)
buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok)
buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Ok)
buttonBox.accepted.connect(self.accept)
layout = QtGui.QVBoxLayout(self)
layout = QtWidgets.QVBoxLayout(self)
layout.addWidget(self.image)
layout.addWidget(self.label)
layout.addWidget(buttonBox)
Expand All @@ -66,7 +66,7 @@ def render(self, text):
self.label.setText(text)
self.image.setPixmap(
qrcode.make(text, image_factory=Image).pixmap())
self.setFixedSize(QtGui.QWidget.sizeHint(self))
self.setFixedSize(QtWidgets.QWidget.sizeHint(self))


def connect_plugin(form):
Expand Down

0 comments on commit 2f87e52

Please sign in to comment.