mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2212 AppFwk : Allow '[' and ']' in filter field text
This commit is contained in:
parent
aa9a2b2e2e
commit
6da6a0abe1
@ -453,7 +453,14 @@ void PdmUiTreeSelectionEditor::slotTextFilterChanged()
|
||||
QString searchString = m_textFilterLineEdit->text();
|
||||
searchString += "*";
|
||||
|
||||
m_proxyModel->setFilterWildcard(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("]", "\\]");
|
||||
|
||||
QRegExp searcher(searchString, Qt::CaseInsensitive, QRegExp::WildcardUnix);
|
||||
m_proxyModel->setFilterRegExp(searcher);
|
||||
|
||||
updateUi();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user