Skip to content

Commit

Permalink
优化表格显示
Browse files Browse the repository at this point in the history
  • Loading branch information
jerryliang122 committed Mar 17, 2023
1 parent 1ae96f6 commit a6858d7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion work/inquiry.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import json
import os
from PyQt6.QtGui import QStandardItemModel, QStandardItem
from PyQt6.QtWidgets import QListView, QAbstractItemView, QMainWindow, QMessageBox
from PyQt6.QtWidgets import QListView, QAbstractItemView, QMainWindow, QMessageBox, QHeaderView
from email_api.agent_email_sql import Agent, Session
from sqlalchemy.orm import sessionmaker
from sqlalchemy import create_engine, Column, Integer, String, TEXT
Expand Down Expand Up @@ -238,3 +238,5 @@ def update_addresslist(self, current, previous):
item_email = QStandardItem(item.strip()) # 使用strip()方法去掉元素中的空格
model.appendRow([item_email])
self.main_window.addresslist.setModel(model)
header = self.main_window.addresslist.horizontalHeader()
header.setSectionResizeMode(QHeaderView.Stretch)

0 comments on commit a6858d7

Please sign in to comment.