1
0
forked from IPKM/nmreval
This commit is contained in:
Dominik Demuth 2023-05-26 17:28:06 +02:00
parent 2906c17472
commit af14793286

View File

@ -1,5 +1,6 @@
from gui_qt.Qt import QtWidgets from gui_qt.Qt import QtWidgets, QtCore
from gui_qt._py.tnmh_dialog import Ui_Dialog from gui_qt._py.tnmh_dialog import Ui_Dialog
from gui_qt.lib.pg_objects import PlotItem
class TgCalculator(QtWidgets.QDialog, Ui_Dialog): class TgCalculator(QtWidgets.QDialog, Ui_Dialog):
@ -9,7 +10,27 @@ class TgCalculator(QtWidgets.QDialog, Ui_Dialog):
self.setupUi(self) self.setupUi(self)
self._management = management self._management = management
print('hello there') self._plots = {}
def __call__(self):
self.clear()
self.add_sets()
# s.valuesChanged.connect(self.management.shift_scale)
def clear(self):
self.listWidget.clear()
for k, v in self._plots.items():
self.graphicsView.removeItem(v)
def add_sets(self):
for key, name in self._management.active_sets:
data = self._management.data[key]
item = QtWidgets.QListWidgetItem(name)
item.setData(QtCore.Qt.UserRole, key)
plot = PlotItem(x=data.x, y=data.y)
self.graphicsView.addItem(plot)
self._plots[key] = plot
if __name__ == '__main__': if __name__ == '__main__':