ui: added smart search box

This change switches the search box in the search view from QLineEdit to the derived QtSmartSearchBox implementation,
which is capeable of displaying tokens of the query as selectable button elements in different colors. It allows for all
the usual mouse and keyboard interactions that the QLineEdit offers.

fortune cookie message = Good news from someone dear is coming soon.
This commit is contained in:
Eberhard Graether
2014-10-22 17:28:46 +02:00
parent 89ac3a0512
commit a9c93a9437
28 changed files with 1102 additions and 268 deletions
@@ -6,6 +6,7 @@
SearchController::SearchController(GraphAccess* graphAccess)
: m_graphAccess(graphAccess)
, m_ignoreNextMessageActivateToken(false)
{
}
@@ -15,10 +16,12 @@ SearchController::~SearchController()
void SearchController::handleMessage(MessageActivateToken* message)
{
if (message->tokenId)
if (!m_ignoreNextMessageActivateToken && message->tokenId)
{
getView()->setText(m_graphAccess->getNameForNodeWithId(message->tokenId));
}
m_ignoreNextMessageActivateToken = false;
}
void SearchController::handleMessage(MessageFind* message)
@@ -37,6 +40,8 @@ void SearchController::handleMessage(MessageSearch* message)
LOG_INFO("search string: \"" + query + "\"");
m_ignoreNextMessageActivateToken = true;
std::vector<Id> ids = m_graphAccess->getTokenIdsForQuery(query);
if (ids.size())
{