3
3
A menu plugin showing QR-Code for bitmessage address in modal dialog.
4
4
"""
5
5
6
- from PyQt4 import QtGui , QtCore
6
+ from qtpy import QtGui , QtCore , QtWidgets
7
7
import qrcode
8
8
9
9
from pybitmessage .tr import _translate
@@ -35,23 +35,23 @@ def drawrect(self, row, col):
35
35
QtCore .Qt .black )
36
36
37
37
38
- class QRCodeDialog (QtGui .QDialog ):
38
+ class QRCodeDialog (QtWidgets .QDialog ):
39
39
"""The dialog"""
40
40
def __init__ (self , parent ):
41
41
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 )
44
44
font = QtGui .QFont ()
45
45
font .setBold (True )
46
46
font .setWeight (75 )
47
47
self .label .setFont (font )
48
48
self .label .setAlignment (
49
49
QtCore .Qt .AlignCenter | QtCore .Qt .AlignVCenter )
50
- buttonBox = QtGui .QDialogButtonBox (self )
50
+ buttonBox = QtWidgets .QDialogButtonBox (self )
51
51
buttonBox .setOrientation (QtCore .Qt .Horizontal )
52
- buttonBox .setStandardButtons (QtGui .QDialogButtonBox .Ok )
52
+ buttonBox .setStandardButtons (QtWidgets .QDialogButtonBox .Ok )
53
53
buttonBox .accepted .connect (self .accept )
54
- layout = QtGui .QVBoxLayout (self )
54
+ layout = QtWidgets .QVBoxLayout (self )
55
55
layout .addWidget (self .image )
56
56
layout .addWidget (self .label )
57
57
layout .addWidget (buttonBox )
@@ -66,7 +66,7 @@ def render(self, text):
66
66
self .label .setText (text )
67
67
self .image .setPixmap (
68
68
qrcode .make (text , image_factory = Image ).pixmap ())
69
- self .setFixedSize (QtGui .QWidget .sizeHint (self ))
69
+ self .setFixedSize (QtWidgets .QWidget .sizeHint (self ))
70
70
71
71
72
72
def connect_plugin (form ):
0 commit comments