更新SA打标界面,调整信号长度下拉框选项,优化表格行选择行为
This commit is contained in:
@ -7,7 +7,7 @@ import pandas as pd
|
||||
from PySide6.QtCore import QCoreApplication, QAbstractTableModel, QModelIndex, Qt, QTimer
|
||||
from PySide6.QtGui import QAction, QFont, QColor, QCursor, QIntValidator
|
||||
from PySide6.QtWidgets import QMessageBox, QMainWindow, QApplication, QButtonGroup, QTableWidget, QTableWidgetItem, \
|
||||
QHeaderView, QPlainTextEdit
|
||||
QHeaderView, QPlainTextEdit, QTableView
|
||||
from matplotlib import gridspec
|
||||
from matplotlib.backends.backend_qt import NavigationToolbar2QT
|
||||
from matplotlib.backends.backend_qtagg import FigureCanvasQTAgg
|
||||
@ -877,6 +877,10 @@ class MainWindow_SA_label(QMainWindow):
|
||||
self.header_mapping_revised)
|
||||
self.ui.tableView_label_revised.setModel(self.data_model_revised)
|
||||
|
||||
# 设置选中行为为整行选择
|
||||
self.ui.tableView_label.setSelectionBehavior(QTableView.SelectRows)
|
||||
self.ui.tableView_label_revised.setSelectionBehavior(QTableView.SelectRows)
|
||||
|
||||
# 按比例设置列宽
|
||||
self.set_tableview_column_width_by_ratio(self.ui.tableView_label, [1, 3, 3, 3])
|
||||
self.set_tableview_column_width_by_ratio(self.ui.tableView_label_revised, [1, 3, 1, 2, 2])
|
||||
@ -952,6 +956,7 @@ class MainWindow_SA_label(QMainWindow):
|
||||
model_index = self.data_model_revised.index(row, 0)
|
||||
self.ui.tableView_label_revised.scrollTo(model_index,
|
||||
self.ui.tableView_label_revised.ScrollHint.EnsureVisible)
|
||||
self.ui.tableView_label_revised.selectRow(row)
|
||||
# 显示事件信息
|
||||
row_list = self.data_model_origin._showdata[
|
||||
self.data_model_origin._showdata["Index"] == event_index].index.tolist()
|
||||
@ -960,6 +965,7 @@ class MainWindow_SA_label(QMainWindow):
|
||||
|
||||
model_index = self.data_model_origin.index(row, 0)
|
||||
self.ui.tableView_label.scrollTo(model_index, self.ui.tableView_label.ScrollHint.EnsureVisible)
|
||||
self.ui.tableView_label.selectRow(row)
|
||||
|
||||
self.show_event_info(event_index)
|
||||
self.__jump_to__event__(event_index, keep_xlim=keep_xlim)
|
||||
|
||||
Reference in New Issue
Block a user