Skip to content

Commit

Permalink
#11140 Fix filtering based on text in tree selection editor
Browse files Browse the repository at this point in the history
  • Loading branch information
magnesj committed Jan 30, 2024
1 parent d0b5c8d commit d102549
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions Fwk/AppFwk/cafUserInterface/cafPdmUiTreeSelectionEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -683,16 +683,7 @@ void PdmUiTreeSelectionEditor::slotTextFilterChanged()
return;
}

QString searchString = m_textFilterLineEdit->text();
searchString += "*";

// Escape the characters '[' and ']' as these have special meaning for a search string
// To be able to search for vector names in brackets, these must be escaped
// See "Wildcard Matching" in Qt documentation
searchString.replace( "[", "\\[" );
searchString.replace( "]", "\\]" );

auto regExpString = QRegularExpression::wildcardToRegularExpression( searchString );
auto regExpString = m_textFilterLineEdit->text() + ".*";
QRegularExpression regExp( regExpString );
regExp.setPatternOptions( QRegularExpression::CaseInsensitiveOption );
m_proxyModel->setFilterRegularExpression( regExp );
Expand Down

0 comments on commit d102549

Please sign in to comment.