Changeset 88e1f57 in sasview for src/sas/qtgui/Utilities/GuiUtils.py


Ignore:
Timestamp:
Oct 24, 2017 8:21:11 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:
814a253
Parents:
d6b234b
Message:

Fixed chart update upon consecutive fitting.
Fixed 1D default charts - now only two (combined data/fit + residuals)
Minor text fixes

File:
1 edited

Legend:

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

    rf0bb711 r88e1f57  
    313313    # Append the new row to the main item 
    314314    item.appendRow(object_item) 
     315 
     316def itemFromFilename(filename, model_item): 
     317    """ 
     318    Returns the model item text=filename in the model 
     319    """ 
     320    assert isinstance(model_item, QtGui.QStandardItemModel) 
     321    assert isinstance(filename, basestring) 
     322 
     323    # Iterate over model looking for named items 
     324    item = list(filter(lambda i: str(i.text()) == filename, 
     325                  [model_item.item(index) for index in range(model_item.rowCount())])) 
     326    return item[0] if len(item)>0 else None 
    315327 
    316328def plotsFromFilename(filename, model_item): 
Note: See TracChangeset for help on using the changeset viewer.