source: sasview/src/sas/qtgui/Plotting/BoxSum.py @ 7969b9c

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalc
Last change on this file since 7969b9c was 4992ff2, checked in by Piotr Rozyczko <rozyczko@…>, 6 years ago

Initial, in-progress version. Not really working atm. SASVIEW-787

  • Property mode set to 100644
File size: 1.5 KB
Line 
1"""
2Allows users to modify the box slicer parameters.
3"""
4from PyQt5 import QtCore
5from PyQt5 import QtGui
6from PyQt5 import QtWidgets
7
8# Local UI
9from sas.qtgui.UI import main_resources_rc
10from sas.qtgui.Plotting.UI.BoxSumUI import Ui_BoxSumUI
11
12class BoxSum(QtWidgets.QDialog, Ui_BoxSumUI):
13    apply_signal = QtCore.pyqtSignal(tuple, str)
14    def __init__(self, parent=None, model=None):
15        super(BoxSum, self).__init__()
16
17        self.setupUi(self)
18        assert isinstance(model, QtGui.QStandardItemModel)
19
20        self.txtBoxHeight.setValidator(QtGui.QDoubleValidator())
21        self.txtBoxWidth.setValidator(QtGui.QDoubleValidator())
22        self.txtCenterX.setValidator(QtGui.QDoubleValidator())
23        self.txtCenterY.setValidator(QtGui.QDoubleValidator())
24
25        self.model = model
26        self.mapper = QtGui.QDataWidgetMapper()
27        self.mapper.setModel(self.model)
28
29        # Map model items onto widget controls
30        self.mapper.addMapping(self.txtBoxHeight, 0)
31        self.mapper.addMapping(self.txtBoxWidth, 1)
32        self.mapper.addMapping(self.txtCenterX, 2)
33        self.mapper.addMapping(self.txtCenterY, 3)
34        self.mapper.addMapping(self.lblAvg, 4, "text")
35        self.mapper.addMapping(self.lblAvgErr, 5, "text")
36        self.mapper.addMapping(self.lblSum, 6, "text")
37        self.mapper.addMapping(self.lblSumErr, 7, "text")
38        self.mapper.addMapping(self.lblNumPoints, 8, "text")
39
40        # Populate the widgets with data from the first column
41        self.mapper.toFirst()
42
43        self.setFixedSize(self.minimumSizeHint())
44
Note: See TracBrowser for help on using the repository browser.