source: sasview/src/sas/qtgui/BoxSum.py @ d7ff531

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 d7ff531 was 3bdbfcc, checked in by Piotr Rozyczko <rozyczko@…>, 8 years ago

Reimplementation of the slicer functionality

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