42 lines
1.2 KiB
Python
42 lines
1.2 KiB
Python
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()
|