[qet] [4536] Element panel search field : add the "+" character used for search multicritere

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 4536
Author:   blacksun
Date:     2016-05-31 11:06:04 +0200 (Tue, 31 May 2016)
Log Message:
-----------
Element panel search field : add the "+" character used for search multicritere

Modified Paths:
--------------
    trunk/sources/ElementsCollection/elementscollectionwidget.cpp

Modified: trunk/sources/ElementsCollection/elementscollectionwidget.cpp
===================================================================
--- trunk/sources/ElementsCollection/elementscollectionwidget.cpp	2016-05-29 15:25:06 UTC (rev 4535)
+++ trunk/sources/ElementsCollection/elementscollectionwidget.cpp	2016-05-31 09:06:04 UTC (rev 4536)
@@ -493,8 +493,14 @@
 	}
 
 	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);
 }


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/