From 30750cc4ed9a9b730c30b3b5f6567a74045c7a57 Mon Sep 17 00:00:00 2001 From: Dominik Demuth Date: Fri, 26 May 2023 18:22:13 +0200 Subject: [PATCH] more ui --- src/gui_qt/dsc/glass_dialog.py | 24 +++++++++++++----------- src/resources/_ui/tnmh_dialog.ui | 10 ++++++++++ 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/gui_qt/dsc/glass_dialog.py b/src/gui_qt/dsc/glass_dialog.py index 34e65fd..6956e8a 100644 --- a/src/gui_qt/dsc/glass_dialog.py +++ b/src/gui_qt/dsc/glass_dialog.py @@ -1,6 +1,8 @@ -from gui_qt.Qt import QtWidgets, QtCore -from gui_qt._py.tnmh_dialog import Ui_Dialog -from gui_qt.lib.pg_objects import PlotItem +from ..Qt import QtWidgets, QtCore +from .._py.tnmh_dialog import Ui_Dialog +from ..lib.pg_objects import PlotItem, RegionItem + +from nmreval.data import DSC class TgCalculator(QtWidgets.QDialog, Ui_Dialog): @@ -12,6 +14,12 @@ class TgCalculator(QtWidgets.QDialog, Ui_Dialog): self._plots = {} + self.limits = RegionItem(), RegionItem() + for lim in self.limits: + self.graphicsView.addItem(lim) + + self.add_sets() + def __call__(self): self.clear() self.add_sets() @@ -25,17 +33,11 @@ class TgCalculator(QtWidgets.QDialog, Ui_Dialog): def add_sets(self): for key, name in self._management.active_sets: data = self._management.data[key] + if not isinstance(data.data, DSC): + continue 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__': - app = QtWidgets.QApplication([]) - w = TgCalculator(None) - w.show() - app.exec() - diff --git a/src/resources/_ui/tnmh_dialog.ui b/src/resources/_ui/tnmh_dialog.ui index ffb3ea3..7b3787a 100644 --- a/src/resources/_ui/tnmh_dialog.ui +++ b/src/resources/_ui/tnmh_dialog.ui @@ -94,6 +94,16 @@ + + + + PushButton + + + + + +