Changeset 5236449 in sasview for src/sas/qtgui/GuiUtils.py
- Timestamp:
- Mar 8, 2017 7:35:49 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:
- cbcdd2c
- Parents:
- 86f88d1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/GuiUtils.py
r83d6249 r5236449 221 221 updateModelFromPerspectiveSignal = QtCore.pyqtSignal(QtGui.QStandardItem) 222 222 223 # New theory data in current perspective 224 updateTheoryFromPerspectiveSignal = QtCore.pyqtSignal(QtGui.QStandardItem) 225 223 226 # New plot requested from the GUI manager 224 227 # Old "NewPlotEvent" … … 256 259 break 257 260 258 checkbox_item = QtGui.QStandardItem(True) 261 # Create the new item 262 checkbox_item = createModelItemWithPlot(update_data, name) 263 264 # Append the new row to the main item 265 item.appendRow(checkbox_item) 266 267 def createModelItemWithPlot(update_data, name=""): 268 """ 269 Creates a checkboxed QStandardItem named "name" 270 Adds QVariant 'update_data' to that row. 271 """ 272 assert isinstance(update_data, QtCore.QVariant) 273 py_update_data = update_data.toPyObject() 274 275 checkbox_item = QtGui.QStandardItem() 259 276 checkbox_item.setCheckable(True) 260 277 checkbox_item.setCheckState(QtCore.Qt.Checked) … … 262 279 263 280 # Add "Info" item 264 if isinstance(py_update_data, (Data1D orData2D)):281 if isinstance(py_update_data, (Data1D, Data2D)): 265 282 # If Data1/2D added - extract Info from it 266 283 info_item = infoFromData(py_update_data) … … 279 296 checkbox_item.setChild(1, info_item) 280 297 281 # A ppend the new row to the mainitem282 item.appendRow(checkbox_item)298 # And return the newly created item 299 return checkbox_item 283 300 284 301 def updateModelItem(item, update_data, name=""):
Note: See TracChangeset
for help on using the changeset viewer.