Changeset 5236449 in sasview for src/sas/qtgui/GuiUtils.py


Ignore:
Timestamp:
Mar 8, 2017 7:35:49 AM (7 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
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
Message:

Default datasets for fitting SASVIEW-498

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/GuiUtils.py

    r83d6249 r5236449  
    221221    updateModelFromPerspectiveSignal = QtCore.pyqtSignal(QtGui.QStandardItem) 
    222222 
     223    # New theory data in current perspective 
     224    updateTheoryFromPerspectiveSignal = QtCore.pyqtSignal(QtGui.QStandardItem) 
     225 
    223226    # New plot requested from the GUI manager 
    224227    # Old "NewPlotEvent" 
     
    256259                break 
    257260 
    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 
     267def 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() 
    259276    checkbox_item.setCheckable(True) 
    260277    checkbox_item.setCheckState(QtCore.Qt.Checked) 
     
    262279 
    263280    # Add "Info" item 
    264     if isinstance(py_update_data, (Data1D or Data2D)): 
     281    if isinstance(py_update_data, (Data1D, Data2D)): 
    265282        # If Data1/2D added - extract Info from it 
    266283        info_item = infoFromData(py_update_data) 
     
    279296    checkbox_item.setChild(1, info_item) 
    280297 
    281     # Append the new row to the main item 
    282     item.appendRow(checkbox_item) 
     298    # And return the newly created item 
     299    return checkbox_item 
    283300 
    284301def updateModelItem(item, update_data, name=""): 
Note: See TracChangeset for help on using the changeset viewer.