mirror of https://gitlab.com/pamhyr/pamhyr2
add copy results table
parent
4f57179a2e
commit
0a97070b90
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Reference in New Issue