mirror of https://gitlab.com/pamhyr/pamhyr2
add copy results table
parent
4f57179a2e
commit
0a97070b90
|
|
@ -450,14 +450,8 @@ class ResultsWindow(PamhyrWindow):
|
||||||
self.update(profile_id=ind)
|
self.update(profile_id=ind)
|
||||||
|
|
||||||
def _set_current_profile_raw_data(self):
|
def _set_current_profile_raw_data(self):
|
||||||
table = self.find(QTableView, f"tableView_raw_data")
|
|
||||||
indexes = table.selectedIndexes()
|
|
||||||
if len(indexes) == 0:
|
|
||||||
return
|
return
|
||||||
|
|
||||||
ind = indexes[0].row()
|
|
||||||
self.update(profile_id=ind)
|
|
||||||
|
|
||||||
def _set_current_timestamp(self):
|
def _set_current_timestamp(self):
|
||||||
timestamp = self._timestamps[self._slider_time.value()]
|
timestamp = self._timestamps[self._slider_time.value()]
|
||||||
self.update(timestamp=timestamp)
|
self.update(timestamp=timestamp)
|
||||||
|
|
@ -541,6 +535,25 @@ class ResultsWindow(PamhyrWindow):
|
||||||
tab_widget.setCurrentWidget(widget)
|
tab_widget.setCurrentWidget(widget)
|
||||||
|
|
||||||
def _copy(self):
|
def _copy(self):
|
||||||
|
# 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")
|
logger.info("TODO: copy")
|
||||||
|
|
||||||
def _paste(self):
|
def _paste(self):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue