Skip to content
Snippets Groups Projects

Fix for issue 35: Display full Start/End time to the microsecond

Merged Destiny Kuehn requested to merge issue-35-show-full-start-end-time-to-microsecond into master
Files
3
@@ -12,6 +12,7 @@ from PySide6.QtWidgets import (QDialog,
QApplication,
QTableWidgetItem,
)
from PySide6.QtGui import (QFontMetrics, Qt)
from PySide6.QtUiTools import loadUiType
from .obspyImproved import utc_to_str
@@ -58,7 +59,21 @@ class ChannelSelectDialog(*load_ui('ChannelSelectDialog.ui')):
utc_to_str(chan.start_date),
utc_to_str(chan.end_date),
)):
self.tableWidget.setItem(row, col, QTableWidgetItem(value))
item = QTableWidgetItem()
item.setText(value)
# shorten start/end time
if col == 3 or col == 4:
# full time as tooltip
item.setToolTip(value)
# rounded time in table
value = QFontMetrics(
self.tableWidget.font()).elidedText(
value,
Qt.ElideRight,
100,
0)
item.setText(value)
self.tableWidget.setItem(row, col, item)
self.chan_map[row] = chan
assert True
self.tableWidget.resizeColumnsToContents()
Loading