Changeset 57b7ee2 in sasview for src/sas/qtgui/SlicerParameters.py
- Timestamp:
- Feb 9, 2017 6:07:05 AM (7 years ago)
- Branches:
- ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- 9a05a8d5
- Parents:
- bda1faa7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/SlicerParameters.py
rb789967 r57b7ee2 2 2 Allows users to modify the box slicer parameters. 3 3 """ 4 import functools 4 5 from PyQt4 import QtGui 5 6 from PyQt4 import QtCore 7 from PyQt4 import QtWebKit 6 8 7 9 # Local UI … … 13 15 passed from a slicer instance. 14 16 """ 17 close_signal = QtCore.pyqtSignal() 15 18 def __init__(self, parent=None, model=None): 16 19 super(SlicerParameters, self).__init__() … … 31 34 self.lstParams.model().setColumnReadOnly(0, True) 32 35 36 # Specify the validator on the parameter value column. 37 self.lstParams.setItemDelegate(ValidatedItemDelegate()) 38 39 # Display Help on clicking the button 40 self.buttonBox.button(QtGui.QDialogButtonBox.Help).clicked.connect(self.onHelp) 41 42 # Close doesn't trigger closeEvent automatically, so force it 43 self.buttonBox.button(QtGui.QDialogButtonBox.Close).clicked.connect(functools.partial(self.closeEvent,None)) 44 33 45 # Disable row number display 34 46 self.lstParams.verticalHeader().setVisible(False) 47 self.lstParams.setAlternatingRowColors(True) 48 self.lstParams.setSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Expanding) 35 49 36 # Specify the validator on the parameter value column. 37 self.lstParams.setItemDelegate(ValidatedItemDelegate()) 50 # Header properties for nicer display 51 header = self.lstParams.horizontalHeader() 52 header.setResizeMode(QtGui.QHeaderView.Stretch) 53 header.setStretchLastSection(True) 54 55 56 def setModel(self, model): 57 """ Model setter """ 58 self.model = model 59 self.proxy.setSourceModel(self.model) 60 61 def closeEvent(self, event): 62 """ 63 Overwritten close widget method in order to send the close 64 signal to the parent. 65 """ 66 self.close_signal.emit() 67 if event: 68 event.accept() 69 70 def onHelp(self): 71 """ 72 Display generic data averaging help 73 """ 74 location = "docs/sphinx-docs/build/html" + \ 75 "/user/sasgui/guiframe/graph_help.html#d-data-averaging" 76 self._helpView = QtWebKit.QWebView() 77 self._helpView.load(QtCore.QUrl(location)) 78 self._helpView.show() 79 38 80 39 81 class ProxyModel(QtGui.QIdentityProxyModel):
Note: See TracChangeset
for help on using the changeset viewer.