feat: stat tab

This commit is contained in:
iridiumR 2023-06-02 15:27:12 +08:00
parent db96a5057b
commit 8f62b5c552
No known key found for this signature in database
GPG key ID: 49735733EB1A32C8
3 changed files with 24 additions and 1 deletions

View file

@ -9,4 +9,6 @@ class MainWindow(QMainWindow):
self.initUI() self.initUI()
from ._pg import PostgresTab from ._pg import PostgresTab
from ._mw import initUI, onTabChanged from ._mw import initUI, onTabChanged
from ._category import CategoryTab from ._category import CategoryTab
from ._account import AccountTab
from ._stat import StatTab

View file

@ -4,6 +4,7 @@ from ._category import CategoryTab
from ._pg import PostgresTab from ._pg import PostgresTab
from ._account import AccountTab from ._account import AccountTab
from ._trans import TransTab from ._trans import TransTab
from ._stat import StatTab
def initUI(self): def initUI(self):
@ -14,12 +15,14 @@ def initUI(self):
self.categoryTab = CategoryTab(self) self.categoryTab = CategoryTab(self)
self.accountTab = AccountTab(self) self.accountTab = AccountTab(self)
self.transTab = TransTab(self) self.transTab = TransTab(self)
self.statTab = StatTab(self)
# 创建主窗口tab布局 # 创建主窗口tab布局
mainWidget = QTabWidget() mainWidget = QTabWidget()
mainWidget.addTab(self.transTab, 'Transaction') mainWidget.addTab(self.transTab, 'Transaction')
mainWidget.addTab(self.categoryTab, 'Category') mainWidget.addTab(self.categoryTab, 'Category')
mainWidget.addTab(self.accountTab, 'Account') mainWidget.addTab(self.accountTab, 'Account')
mainWidget.addTab(self.statTab, 'Statistics')
mainWidget.addTab(self.pg, 'Connect') mainWidget.addTab(self.pg, 'Connect')
# 槽连接 # 槽连接

18
src/budget/_stat.py Normal file
View file

@ -0,0 +1,18 @@
from PyQt6.QtWidgets import *
from ._tab import TabPage
from ._pg import PostgresTab
from PyQt6.QtGui import QDoubleValidator
import json
class StatTab(TabPage):
def __init__(self, parent):
super().__init__()
self.initUI()
self.pg = parent.pg
self.rows = []
def initUI(self):
pass
def onXXXClicked(self):
pass