mirror of
https://github.com/OPM/ResInsight.git
synced 2026-09-03 20:53:13 -05:00
#11140 Fix filtering based on text in tree selection editor
This commit is contained in:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user