diff --git a/src/View/Results/Window.py b/src/View/Results/Window.py index 5f52f061878dc87174621b8b11c1afe4f5e96976..a14c7e0a692406d634e0eca69479e4b64ac6e641 100644 --- a/src/View/Results/Window.py +++ b/src/View/Results/Window.py @@ -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")