From 8d2bfacacad521c7e4cbe8b209c82cdd3b266451 Mon Sep 17 00:00:00 2001 From: Dominik Demuth Date: Sat, 1 Apr 2023 20:25:44 +0200 Subject: [PATCH] display drawings of graphs --- src/gui_qt/graphs/drawings.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/gui_qt/graphs/drawings.py b/src/gui_qt/graphs/drawings.py index 81067fb..94f3c2e 100644 --- a/src/gui_qt/graphs/drawings.py +++ b/src/gui_qt/graphs/drawings.py @@ -31,6 +31,18 @@ class DrawingsWidget(QtWidgets.QWidget, Ui_Form): for gid, windows in self.graphs.items(): self.graph_combobox.addItem(windows.title, userData=gid) + @QtCore.pyqtSlot(int, name='on_graph_combobox_currentIndexChanged') + def look_for_drawing(self, idx: int): + self.listWidget.clear() + + graph_id = self.graph_combobox.itemData(idx) + + for k, v in self.graphs[graph_id].drawings.items(): + child = QtWidgets.QListWidgetItem(str(v)) + child.setData(QtCore.Qt.UserRole, k) + self.listWidget.addItem(child) + + @QtCore.pyqtSlot(name='on_newButton_clicked') @QtCore.pyqtSlot(name='on_editButton_clicked') def start_drawing(self):