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:
blacksun
2016-05-31 09:06:04 +00:00
parent fefae184d2
commit 8f83131852

View File

@@ -493,8 +493,14 @@ void ElementsCollectionWidget::search(const QString &text)
}
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)
showAndExpandItem(index);
}