void testFilterIntersection() { //test a negative match QLandmarkIntersectionFilter intersectionFilter; QLandmarkNameFilter nameFilter1("Sasuke"); QLandmarkNameFilter nameFilter2("Kakashi"); QLandmarkNameFilter nameFilter3("Itachi"); QLandmark lm; lm.setName("Kakashi"); intersectionFilter << nameFilter1 << nameFilter2 << nameFilter3; QVERIFY(!MockEngine::testFilter(intersectionFilter,lm)); //test a positive match QLandmarkCategoryId cat1; cat1.setLocalId("konoha"); cat1.setManagerUri("qtlandmarks:mock:"); QLandmarkCategoryFilter categoryFilter(cat1); QLandmarkAttributeFilter attributeFilter; attributeFilter.setAttribute("description","sharingan"); lm.setDescription("sharingan"); lm.addCategoryId(cat1); intersectionFilter.clear(); intersectionFilter << attributeFilter << categoryFilter << nameFilter2; QVERIFY(MockEngine::testFilter(intersectionFilter,lm)); //test empty intersection filter intersectionFilter.clear(); QVERIFY(!MockEngine::testFilter(intersectionFilter,lm)); }
void ModListSortProxy::aboutToChangeData() { // having a filter active when dataChanged is called caused a crash // (at least with some Qt versions) // this may be related to the fact that the item being edited may disappear from the view as a // result of the edit m_PreChangeFilters = categoryFilter(); setCategoryFilter(std::vector<int>()); }