Changeset f1f3e6a in sasview for src/sas/qtgui/Utilities


Ignore:
Timestamp:
Nov 13, 2017 9:34:45 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:
7c487846
Parents:
1543f0c
Message:

Initial commit of Celine's Invariant Perspective work SASVIEW-52

File:
1 edited

Legend:

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

    r53c771e rf1f3e6a  
    312312    # Append the new row to the main item 
    313313    item.appendRow(object_item) 
     314 
     315def updateModelItemStatus(model_item, filename="", name="", status=2): 
     316    """ 
     317    Update status of checkbox related to high- and low-Q extrapolation 
     318    choice in Invariant Panel 
     319    """ 
     320    assert isinstance(model_item, QtGui.QStandardItemModel) 
     321 
     322    # Iterate over model looking for items with checkboxes 
     323    for index in range(model_item.rowCount()): 
     324        item = model_item.item(index) 
     325        if item.text() == filename and item.isCheckable() and item.checkState() == QtCore.Qt.Checked: 
     326            # Going 1 level deeper only 
     327            for index_2 in range(item.rowCount()): 
     328                item_2 = item.child(index_2) 
     329                if item_2 and item_2.isCheckable() and item_2.text() == name: 
     330                    item_2.setCheckState(status) 
     331 
     332    return 
    314333 
    315334def itemFromFilename(filename, model_item): 
Note: See TracChangeset for help on using the changeset viewer.