11import sys
2- from PyQt4 import QtGui
2+ from PyQt5 import QtWidgets , QtGui
33
44from dls_barcode .config import BarcodeConfigDialog
55
1313from .menu_bar import MenuBar
1414
1515
16- class DiamondBarcodeMainWindow (QtGui .QMainWindow ):
16+ class DiamondBarcodeMainWindow (QtWidgets .QMainWindow ):
1717 """ Main GUI window for the Barcode Scanner App.
1818 """
1919
20- def __init__ (self , config , version ):
21- super (DiamondBarcodeMainWindow , self ).__init__ ()
20+ def __init__ (self , config , version , flags , * args , ** kwargs ):
21+ # super(DiamondBarcodeMainWindow, self).__init__(None, None )
2222
23+ super ().__init__ (flags , * args , ** kwargs )
2324 self ._config = config
2425 self ._version = version
2526 self ._cleanup = None
@@ -39,11 +40,11 @@ def _init_ui(self):
3940 """
4041 self ._window_icon = QtGui .QIcon ("..\\ resources\\ icons\\ qr_code_32.png" )
4142
42- self .setGeometry (100 , 100 , 1020 , 650 )
43+ self .setGeometry (50 , 50 , 1500 , 650 ) #950
4344 self .setWindowTitle ('Diamond Puck Barcode Scanner' )
4445 self .setWindowIcon (self ._window_icon )
4546
46- self ._menu_bar = MenuBar (self .menuBar (), self ._version )
47+ self ._menu_bar = MenuBar (self .menuBar (), self ._version , None )
4748
4849 # Barcode table - lists all the barcodes in a record
4950 self ._barcode_table = BarcodeTable (self ._config )
@@ -62,25 +63,25 @@ def _init_ui(self):
6263
6364 # Create layout
6465
65- hbox = QtGui .QHBoxLayout ()
66+ hbox = QtWidgets .QHBoxLayout ()
6667 hbox .setSpacing (10 )
6768
68- table_vbox = QtGui .QVBoxLayout ()
69+ table_vbox = QtWidgets .QVBoxLayout ()
6970 table_vbox .addWidget (self ._record_table )
7071 table_vbox .addWidget (self ._scan_button )
7172
7273 hbox .addLayout (table_vbox )
7374 hbox .addWidget (self ._barcode_table )
7475
75- img_vbox = QtGui .QVBoxLayout ()
76+ img_vbox = QtWidgets .QVBoxLayout ()
7677 img_vbox .addWidget (self ._image_frame )
7778 img_vbox .addWidget (self ._message_box )
7879 hbox .addLayout (img_vbox )
7980
80- vbox = QtGui .QVBoxLayout ()
81+ vbox = QtWidgets .QVBoxLayout ()
8182 vbox .addLayout (hbox )
8283
83- main_widget = QtGui .QWidget ()
84+ main_widget = QtWidgets .QWidget ()
8485 main_widget .setLayout (vbox )
8586 self .setCentralWidget (main_widget )
8687
@@ -101,7 +102,7 @@ def _to_run_on_table_clicked(self):
101102 self ._scan_button .setStartLayout ()
102103
103104 def _on_about_action_clicked (self ):
104- QtGui .QMessageBox .about (self , 'About' , "Version: " + self ._version )
105+ QtWidgets .QMessageBox .about (self , 'About' , "Version: " + self ._version )
105106
106107
107108 def _on_scan_action_clicked (self ):
0 commit comments