ui: integrated autocompletion and filtering into SearchView

- QtSearchView was split into QtSearchView and QtSearchBox.
- QtSearchBox contains all Qt elements and can use them purely
- QtSearchView forwards calls from the SearchController to QtSearchBox
- Searching is initiated with MessageSearch to the SearchController
- Autocompletion is initiated with MessageSearchAutocomplete to the SearchController
- The search field is able to create filter queries by only giving autocompletions for the last token in the query
- For named tokens the search field adds their token ids to the query in the form of "A,25" for faster lookup

bug id = #21
This commit is contained in:
Eberhard Graether
2014-09-11 14:53:03 +02:00
parent 760e5ffafd
commit fec7abbc9b
48 changed files with 786 additions and 391 deletions
+2 -1
View File
@@ -6,6 +6,7 @@
#include <vector>
#include "data/graph/Graph.h"
#include "data/SearchIndex.h"
#include "utility/types.h"
class GraphAccess
@@ -15,7 +16,7 @@ public:
virtual Id getIdForNodeWithName(const std::string& name) const = 0;
virtual std::string getNameForNodeWithId(Id id) const = 0;
virtual std::vector<std::string> getNamesForNodesWithNamePrefix(const std::string& prefix) const = 0;
virtual std::vector<SearchIndex::SearchMatch> getAutocompletionMatches(const std::string& query) const = 0;
virtual std::shared_ptr<Graph> getGraphForActiveTokenIds(const std::vector<Id>& tokenIds) const = 0;
+3 -3
View File
@@ -47,14 +47,14 @@ std::string GraphAccessProxy::getNameForNodeWithId(Id id) const
return "";
}
std::vector<std::string> GraphAccessProxy::getNamesForNodesWithNamePrefix(const std::string& prefix) const
std::vector<SearchIndex::SearchMatch> GraphAccessProxy::getAutocompletionMatches(const std::string& query) const
{
if (hasSubject())
{
return m_subject->getNamesForNodesWithNamePrefix(prefix);
return m_subject->getAutocompletionMatches(query);
}
return std::vector<std::string>();
return std::vector<SearchIndex::SearchMatch>();
}
std::shared_ptr<Graph> GraphAccessProxy::getGraphForActiveTokenIds(const std::vector<Id>& tokenIds) const
+1 -1
View File
@@ -15,7 +15,7 @@ public:
// GraphAccess implementation
virtual Id getIdForNodeWithName(const std::string& name) const;
virtual std::string getNameForNodeWithId(Id id) const;
virtual std::vector<std::string> getNamesForNodesWithNamePrefix(const std::string& prefix) const;
virtual std::vector<SearchIndex::SearchMatch> getAutocompletionMatches(const std::string& query) const;
virtual std::shared_ptr<Graph> getGraphForActiveTokenIds(const std::vector<Id>& tokenIds) const;