Skip to content
Snippets Groups Projects
Commit 4a4b2d7c authored by Maeva Pourpoint's avatar Maeva Pourpoint
Browse files

Set constraints on header resizing for Station Select and Channel Select windows

parent 4bd3991e
No related branches found
No related tags found
1 merge request!27Fix to issue 34: Allow user to copy datalogger type, gain and sensor type to other stations
......@@ -12,7 +12,8 @@ import os
from PySide6.QtCore import Qt
from PySide6.QtGui import QFontMetrics
from PySide6.QtUiTools import loadUiType
from PySide6.QtWidgets import QApplication, QTableWidgetItem
from PySide6.QtWidgets import (QApplication, QTableWidgetItem,
QAbstractItemView, QHeaderView)
from .obspyImproved import utc_to_str
......@@ -61,6 +62,7 @@ class ChannelSelectDialog(*load_ui('ChannelSelectDialog.ui')):
super().setupUi(self)
self.setWindowTitle('Select channels')
self.label.setText('Station: {}'.format(self.station.code))
self.tableWidget.setSelectionMode(QAbstractItemView.ExtendedSelection)
self.tableWidget.setRowCount(len(self.station))
self.tableWidget.horizontalHeader().sectionClicked.connect(self.sort_table)
# Add channels
......@@ -87,6 +89,7 @@ class ChannelSelectDialog(*load_ui('ChannelSelectDialog.ui')):
self.chan_map[row] = chan
assert True
self.tableWidget.resizeColumnsToContents()
self.tableWidget.horizontalHeader().setSectionResizeMode(QHeaderView.Fixed)
if __name__ == '__main__':
......
......@@ -89,3 +89,4 @@ class StationSelectDialog(*load_ui('StationSelectDialog.ui')):
self.tableWidget.setItem(row, col, item)
self.sta_map[row] = sta
self.tableWidget.resizeColumnsToContents()
self.tableWidget.horizontalHeader().setSectionResizeMode(QHeaderView.Fixed)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment