diff --git a/src/budget/_account.py b/src/budget/_account.py index 12395be..bf297ed 100644 --- a/src/budget/_account.py +++ b/src/budget/_account.py @@ -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): # 新建对话框,询问是否删除 diff --git a/src/budget/_category.py b/src/budget/_category.py index 5e21bc9..82c886d 100644 --- a/src/budget/_category.py +++ b/src/budget/_category.py @@ -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)