feat: account category table ui

This commit is contained in:
iridiumR 2023-06-03 14:30:10 +08:00
parent 1e3726318f
commit d7737883f7
No known key found for this signature in database
GPG key ID: 49735733EB1A32C8
2 changed files with 29 additions and 10 deletions

View file

@ -12,7 +12,7 @@ class AccountTab(TabPage):
self.rows = []
def initUI(self):
# 创建连接信息控件
# 创建顶部控件
self.accountComboBox = QComboBox()
self.accountModifyButton = QPushButton('Modify')
@ -21,14 +21,23 @@ class AccountTab(TabPage):
self.accountAddButton.clicked.connect(self.onAccountAddClicked)
# 创建控件布局
accountLayout = QHBoxLayout()
accountLayout.addWidget(self.accountComboBox)
accountLayout.addWidget(self.accountModifyButton)
accountLayout.addWidget(self.accountAddButton)
topLayout = QHBoxLayout()
topLayout.addWidget(self.accountComboBox)
topLayout.addWidget(self.accountModifyButton)
topLayout.addWidget(self.accountAddButton)
# 创建表格
self.accountTable = QTableWidget()
tableLayout = QVBoxLayout()
tableLayout.addWidget(self.accountTable)
# 应用布局
accountLayout = QVBoxLayout()
accountLayout.addLayout(topLayout)
accountLayout.addLayout(tableLayout)
self.setLayout(accountLayout)
def onAccountDeleteClicked(self):
# 新建对话框,询问是否删除

View file

@ -21,10 +21,20 @@ class CategoryTab(TabPage):
self.categoryAddButton.clicked.connect(self.onCategoryAddClicked)
# 创建控件布局
categoryLayout = QHBoxLayout()
categoryLayout.addWidget(self.categoryComboBox)
categoryLayout.addWidget(self.categoryModifyButton)
categoryLayout.addWidget(self.categoryAddButton)
topLayout = QHBoxLayout()
topLayout.addWidget(self.categoryComboBox)
topLayout.addWidget(self.categoryModifyButton)
topLayout.addWidget(self.categoryAddButton)
# 创建表格
self.accountTable = QTableWidget()
tableLayout = QVBoxLayout()
tableLayout.addWidget(self.accountTable)
# 应用布局
categoryLayout = QVBoxLayout()
categoryLayout.addLayout(topLayout)
categoryLayout.addLayout(tableLayout)
self.setLayout(categoryLayout)