data: split off inner classes of SearchIndex
This commit is contained in:
@@ -49,7 +49,7 @@ void QtSearchBar::setFocus()
|
||||
m_searchBox->setFocus();
|
||||
}
|
||||
|
||||
void QtSearchBar::setAutocompletionList(const std::vector<SearchIndex::SearchMatch>& autocompletionList)
|
||||
void QtSearchBar::setAutocompletionList(const std::vector<SearchMatch>& autocompletionList)
|
||||
{
|
||||
m_searchBox->setAutocompletionList(autocompletionList);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include <QAbstractItemView>
|
||||
#include <QFrame>
|
||||
|
||||
#include "data/SearchIndex.h"
|
||||
#include "data/search/SearchMatch.h"
|
||||
|
||||
class QPushButton;
|
||||
class QtSmartSearchBox;
|
||||
@@ -22,7 +22,7 @@ public:
|
||||
|
||||
void setText(const std::string& text);
|
||||
void setFocus();
|
||||
void setAutocompletionList(const std::vector<SearchIndex::SearchMatch>& autocompletionList);
|
||||
void setAutocompletionList(const std::vector<SearchMatch>& autocompletionList);
|
||||
|
||||
QAbstractItemView* getCompleterPopup();
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ QtSmartSearchBox::~QtSmartSearchBox()
|
||||
{
|
||||
}
|
||||
|
||||
void QtSmartSearchBox::setAutocompletionList(const std::vector<SearchIndex::SearchMatch>& autocompletionList)
|
||||
void QtSmartSearchBox::setAutocompletionList(const std::vector<SearchMatch>& autocompletionList)
|
||||
{
|
||||
m_matches = autocompletionList;
|
||||
|
||||
@@ -63,7 +63,7 @@ void QtSmartSearchBox::setAutocompletionList(const std::vector<SearchIndex::Sear
|
||||
}
|
||||
|
||||
QStringList wordList;
|
||||
for (const SearchIndex::SearchMatch& match: autocompletionList)
|
||||
for (const SearchMatch& match: autocompletionList)
|
||||
{
|
||||
wordList << match.fullName.c_str();
|
||||
}
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
#ifndef QT_SMART_SEARCH_BOX_H
|
||||
#define QT_SMART_SEARCH_BOX_H
|
||||
|
||||
#include <deque>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include <QLineEdit>
|
||||
#include <QPushButton>
|
||||
|
||||
#include "data/SearchIndex.h"
|
||||
#include "data/search/SearchMatch.h"
|
||||
|
||||
class QtQueryElement
|
||||
: public QPushButton
|
||||
@@ -37,7 +38,7 @@ public:
|
||||
QtSmartSearchBox(QWidget* parent);
|
||||
virtual ~QtSmartSearchBox();
|
||||
|
||||
void setAutocompletionList(const std::vector<SearchIndex::SearchMatch>& autocompletionList);
|
||||
void setAutocompletionList(const std::vector<SearchMatch>& autocompletionList);
|
||||
void setQuery(const std::string& text);
|
||||
void setFocus();
|
||||
|
||||
@@ -90,7 +91,7 @@ private:
|
||||
|
||||
size_t m_cursorIndex;
|
||||
|
||||
std::vector<SearchIndex::SearchMatch> m_matches;
|
||||
std::vector<SearchMatch> m_matches;
|
||||
|
||||
bool m_shiftKeyDown;
|
||||
bool m_mousePressed;
|
||||
|
||||
@@ -43,7 +43,7 @@ void QtSearchView::setFocus()
|
||||
m_setFocusFunctor();
|
||||
}
|
||||
|
||||
void QtSearchView::setAutocompletionList(const std::vector<SearchIndex::SearchMatch>& autocompletionList)
|
||||
void QtSearchView::setAutocompletionList(const std::vector<SearchMatch>& autocompletionList)
|
||||
{
|
||||
m_setAutocompletionListFunctor(autocompletionList);
|
||||
}
|
||||
@@ -64,7 +64,7 @@ void QtSearchView::doSetFocus()
|
||||
m_widget->setFocus();
|
||||
}
|
||||
|
||||
void QtSearchView::doSetAutocompletionList(const std::vector<SearchIndex::SearchMatch>& autocompletionList)
|
||||
void QtSearchView::doSetAutocompletionList(const std::vector<SearchMatch>& autocompletionList)
|
||||
{
|
||||
m_widget->setAutocompletionList(autocompletionList);
|
||||
setStyleSheet();
|
||||
|
||||
@@ -21,20 +21,20 @@ public:
|
||||
// SearchView implementation
|
||||
virtual void setText(const std::string& text);
|
||||
virtual void setFocus();
|
||||
virtual void setAutocompletionList(const std::vector<SearchIndex::SearchMatch>& autocompletionList);
|
||||
virtual void setAutocompletionList(const std::vector<SearchMatch>& autocompletionList);
|
||||
|
||||
private:
|
||||
void doRefreshView();
|
||||
void doSetText(const std::string& text);
|
||||
void doSetFocus();
|
||||
void doSetAutocompletionList(const std::vector<SearchIndex::SearchMatch>& autocompletionList);
|
||||
void doSetAutocompletionList(const std::vector<SearchMatch>& autocompletionList);
|
||||
|
||||
void setStyleSheet();
|
||||
|
||||
QtThreadedFunctor<> m_refreshViewFunctor;
|
||||
QtThreadedFunctor<const std::string&> m_setTextFunctor;
|
||||
QtThreadedFunctor<> m_setFocusFunctor;
|
||||
QtThreadedFunctor<const std::vector<SearchIndex::SearchMatch>&> m_setAutocompletionListFunctor;
|
||||
QtThreadedFunctor<const std::vector<SearchMatch>&> m_setAutocompletionListFunctor;
|
||||
|
||||
std::shared_ptr<QtSearchBar> m_widget;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user