Changeset 2aa960a in sasview for src/sas/qtgui/Utilities


Ignore:
Timestamp:
Oct 25, 2017 9:01:37 AM (7 years ago)
Author:
Adam Washington <adam.washington@…>
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:
aae5f4c
Parents:
e7a0b2f (diff), f7d14a1 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'ESS_GUI' of github.com:SasView/sasview into ESS_GUI

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.