From cc8e97458931381e2609e89167294a1ecb9b2d50 Mon Sep 17 00:00:00 2001 From: Andreas Tsouchlos Date: Wed, 3 Jan 2024 00:22:01 +0100 Subject: [PATCH] Add first version of UI --- banking_breakdown/ui.py | 41 ++++++++++++ res/main_window.ui | 138 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 179 insertions(+) create mode 100644 banking_breakdown/ui.py create mode 100644 res/main_window.ui diff --git a/banking_breakdown/ui.py b/banking_breakdown/ui.py new file mode 100644 index 0000000..5ea4ed6 --- /dev/null +++ b/banking_breakdown/ui.py @@ -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() diff --git a/res/main_window.ui b/res/main_window.ui new file mode 100644 index 0000000..434b1ac --- /dev/null +++ b/res/main_window.ui @@ -0,0 +1,138 @@ + + + MainWindow + + + + 0 + 0 + 800 + 600 + + + + MainWindow + + + + + + + Qt::Horizontal + + + + Categories + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Create + + + + + + + Delete + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Apply + + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Cancel + + + + + + + Done + + + + + + + + + + + 0 + 0 + 800 + 23 + + + + + + + +