mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 05:00:33 +01:00
Element panel search field : add the "+" character used for search multicritere
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4536 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -493,8 +493,14 @@ void ElementsCollectionWidget::search(const QString &text)
|
|||||||
}
|
}
|
||||||
|
|
||||||
hideCollection(true);
|
hideCollection(true);
|
||||||
QModelIndexList match_index = m_model->match(m_showed_index.isValid() ? m_model->index(0,0,m_showed_index) : m_model->index(0,0),
|
|
||||||
Qt::DisplayRole, QVariant(text), -1, Qt::MatchContains | Qt::MatchRecursive);
|
QStringList text_list = text.split("+", QString::SkipEmptyParts);
|
||||||
|
QModelIndexList match_index;
|
||||||
|
foreach (QString txt, text_list) {
|
||||||
|
match_index << m_model->match(m_showed_index.isValid() ? m_model->index(0,0,m_showed_index) : m_model->index(0,0),
|
||||||
|
Qt::DisplayRole, QVariant(txt), -1, Qt::MatchContains | Qt::MatchRecursive);
|
||||||
|
}
|
||||||
|
|
||||||
foreach(QModelIndex index, match_index)
|
foreach(QModelIndex index, match_index)
|
||||||
showAndExpandItem(index);
|
showAndExpandItem(index);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user