Skip to content

Commit

Permalink
Dataset source with filter does not work
Browse files Browse the repository at this point in the history
If the source of a control is the dataset, the filter (type filter, level, etc..) does not work.

Fixes jasp-stats/jasp-test-release#2656
  • Loading branch information
boutinb committed Jul 3, 2024
1 parent 3af6250 commit 3e868ff
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions QMLComponents/controls/sourceitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,12 @@ Terms SourceItem::_readAllTerms()
term.setType(columnType(requestInfo(VariableInfo::VariableType, name).toInt()));
terms.add(term);
}
if (!_sourceFilter.empty())
// If the 'use' parameter of the source property asks for the levels, or to filter some types
// of the variables of this 'native' model (probably the columnsModel),
// then just use the filterTerms method of the model object of the current control.
terms = _targetListControl->model()->filterTerms(terms, _sourceFilter);

}
else if (_sourceNativeModel)
{
Expand All @@ -530,9 +536,6 @@ Terms SourceItem::_readAllTerms()
terms.add(term, false);
}
if (!_sourceFilter.empty())
// If the 'use' parameter of the source property asks for the levels, or to filter some types
// of the variables of this 'native' model (probably the columnsModel),
// then just use the filterTerms method of the model object of the current control.
terms = _targetListControl->model()->filterTerms(terms, _sourceFilter);
}

Expand Down

0 comments on commit 3e868ff

Please sign in to comment.