(view)
Return the source model for the Qt Item View if it uses
    the QSortFilterProxyModel.
Return the source model for the Qt Item View if it uses
    the QSortFilterProxyModel.
Return the source model for the Qt Item View if it uses the QSortFilterProxyModel .
def source_model(view):
    """ Return the source model for the Qt Item View if it uses
    the QSortFilterProxyModel.
    """
    if isinstance(view.model(), QSortFilterProxyModel):
        return view.model().sourceModel()
    else:
        return view.model()
def source_model ( view ) : if isinstance ( view . model ( ) , QSortFilterProxyModel ) : return view . model ( ) . sourceModel ( ) else : return view . model ( )