Add first version of UI
This commit is contained in:
41
banking_breakdown/ui.py
Normal file
41
banking_breakdown/ui.py
Normal file
@@ -0,0 +1,41 @@
|
||||
import sys
|
||||
|
||||
from PyQt5.QtWidgets import QMainWindow, QApplication, QPushButton, QListView, \
|
||||
QTableView
|
||||
from PyQt5 import uic
|
||||
|
||||
|
||||
class MainWindow(QMainWindow):
|
||||
def __init__(self, ui_file):
|
||||
super(MainWindow, self).__init__()
|
||||
uic.loadUi(ui_file, self)
|
||||
|
||||
self.createCategoryButton \
|
||||
= self.findChild(QPushButton, "createCategoryButton")
|
||||
self.deleteCategoryButton \
|
||||
= self.findChild(QPushButton, "deleteCategoryButton")
|
||||
self.applyCategoryButton \
|
||||
= self.findChild(QPushButton, "applyCategoryButton")
|
||||
|
||||
self.categoryListView = self.findChild(QListView, "categoryListView")
|
||||
self.statementTableView = self.findChild(QTableView,
|
||||
"statementTableView")
|
||||
|
||||
self.cancelButton = self.findChild(QPushButton, "cancelButton")
|
||||
self.doneButton = self.findChild(QPushButton, "doneButton")
|
||||
|
||||
self._define_event_handlers()
|
||||
|
||||
def _define_event_handlers(self):
|
||||
self.cancelButton.clicked.connect(self.close)
|
||||
|
||||
|
||||
def main():
|
||||
app = QApplication(sys.argv)
|
||||
window = MainWindow("../res/main_window.ui")
|
||||
window.show()
|
||||
app.exec()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user