Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import json, pickle, sys
- from PyQt5.QtWidgets import QApplication, QWidget,QTabWidget, QPushButton, QVBoxLayout, QMainWindow,QPushButton, QAction, QLabel, QDialog
- from PyQt5.QtGui import QIcon
- from PyQt5.QtCore import pyqtSlot
- # Req : Gui
- # : Needs to be able to set network address's of computers that need the configuration files to sync , auto- updater?
- #
- class Application(QMainWindow):
- def __init__(self):
- super().__init__()
- self.title = "Hot Rack - Food Management"
- self.height = 600
- self.width = 640
- self.left = 500
- self.top = 300
- self.init_gui()
- def init_gui(self):
- self.setWindowTitle(self.title)
- self.setGeometry(self.left,self.top,self.width, self.height)
- self.statusBar().showMessage('')
- #Menu's
- main_menu = self.menuBar()
- file_menu = main_menu.addMenu('File')
- admin_login = QAction('Login', self)
- exit_button = QAction(QIcon('exit24.png'), 'Exit', self)
- exit_button.setShortcut('Ctrl+Q')
- exit_button.setStatusTip('Exit application')
- admin_login.setStatusTip('Admin login')
- #admin_login.triggered.connect()
- exit_button.triggered.connect(self.close)
- file_menu.addAction(admin_login)
- file_menu.addAction(exit_button)
- self.rack_display = Rack_Display(self)
- self.setCentralWidget(self.rack_display)
- # Layout
- self.show()
- class Rack_Display(QWidget):
- def __init(self, parent):
- super(QWidget,self).__init__(parent)
- self.layout = QVBoxLayout()
- #Tabs Initalization
- self.tabs = QTabWidget()
- self.day = QWidget()
- self.week = QWidget()
- self.tabs.resize(300,200)
- #Add tabs
- self.tabs.addTab(self.day,"Day View")
- self.tabs.addTab(self.week,"Week View")
- #Layout- Tab1
- self.day.layout = QVBoxLayout(self)
- self.pb = QPushButton('Enter text')
- self.day.layout.addWidget(self.pb)
- self.day.setLayout(self.day.layout)
- #Layout - Tab2
- self.week.layout = QVBoxLayout(self)
- self.pushButton1 = QPushButton("PyQt5 button")
- self.week.layout.addWidget(self.pushButton1)
- self.week.setLayout(self.week.layout)
- #Add tab widgets and layout
- self.layout.addWidget((self.tabs))
- self.setLayout(self.layout)
- @pyqtSlot()
- def on_click(self):
- print("\n")
- for currentQTableWidgetItem in self.tableWidget.selectedItems():
- print(currentQTableWidgetItem.row(), currentQTableWidgetItem.column(), currentQTableWidgetItem.text())
- if __name__ == '__main__':
- app = QApplication([sys.argv])
- application = Application()
- sys.exit(app.exec_())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement