class mainWindow(QtWidgets.QMainWindow, userInterface):
    def __init__(self, pilot, parent=None):
        # Initialization main interface from QT to Python
        QtWidgets.QMainWindow.__init__(self, parent)
        # Variable
        self.setupUi(self)
        self.actionAbout.triggered.connect(self.About)
        self.actionTicket_info.triggered.connect(self.TicketInfo)
        self.actionUser_Payments_Info.triggered.connect(self.userPaymentGrid)
        self.actionList_Users.triggered.connect(self.ListOfUsers)
        
        labelpic = QLabel()
        pixmap = QPixmap('icon/ticket_background.png')
        pixmap = pixmap.scaledToWidth(611)
        labelpic.setPixmap(pixmap)
        labelpic.setFixedHeight(391)

        print(pilot)
        self.action_Exit.triggered.connect(self.exit)
        self.update_CurrentDateTime()

    def update_CurrentDateTime(self):
        now = datetime.datetime.now()
        self.label_datetime.setText(now.strftime("%Y-%m-%d %H:%M:%S"))

    def About(self):
        self.about = About(None)
        self.about.exec_()

    def TicketInfo(self):
        self.ticketinfo = TicketInfo(None)
        self.ticketinfo.exec_()

    def userPaymentGrid(self):
        self.userPaymentGrid = userPaymentGrid(None)
        self.userPaymentGrid.show()

    def ListOfUsers(self):
        self.ListOfUsers = ListOfUsers(None)
        self.ListOfUsers.show()

    def exit(self):
        quit_msg = "Are you sure you want to exit the program?"
        reply = QMessageBox.question(self, 'Message', 
                         quit_msg, QMessageBox.Yes, QMessageBox.No)

        if reply == QMessageBox.Yes:
            sys.exit()
        else:
            print("ignore close")
Beispiel #2
0
 def about(self, bCheck):
     print "mainWindow about..."
     dlg = About(self)
     dlg.exec_()
 def aboutAct(self):
     """Display info box."""
     #QtWidgets.QMessageBox.information(self, 'About', ABOUT)
     about = About(self)
     about.exec_()
Beispiel #4
0
 def about( self, bCheck):
     print "mainWindow about..."
     dlg = About(self)
     dlg.exec_()
Beispiel #5
0
 def about(self):
     dialog = About(self)
     dialog.exec_()