add copy results table

terraz_dev
Theophile Terraz 2025-01-29 14:19:42 +01:00
parent 4f57179a2e
commit 0a97070b90
1 changed files with 21 additions and 8 deletions

View File

@ -450,13 +450,7 @@ class ResultsWindow(PamhyrWindow):
self.update(profile_id=ind)
def _set_current_profile_raw_data(self):
table = self.find(QTableView, f"tableView_raw_data")
indexes = table.selectedIndexes()
if len(indexes) == 0:
return
ind = indexes[0].row()
self.update(profile_id=ind)
return
def _set_current_timestamp(self):
timestamp = self._timestamps[self._slider_time.value()]
@ -541,7 +535,26 @@ class ResultsWindow(PamhyrWindow):
tab_widget.setCurrentWidget(widget)
def _copy(self):
logger.info("TODO: copy")
# focus on raw data table
if self.find(QTabWidget, f"tabWidget").currentIndex() == 0:
table = self.find(QTableView, f"tableView_raw_data")
model = self._table["raw_data"]
coltext = []
for index in sorted(table.selectionModel().selectedRows()):
row = index.row()
rowtext = []
for column in range(model.columnCount()):
i = model.createIndex(row, column)
try:
rowtext.append(model.data(i))
except AttributeError:
rowtext.append("")
coltext.append(rowtext)
self.copyTableIntoClipboard(coltext)
else:
logger.info("TODO: copy")
def _paste(self):
logger.info("TODO: paste")