blob: d1ff5ad1bc8510d5d0f19dba1865b92f5a004b7c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
#pragma once
#include "search/result.hpp"
#include "search/params.hpp"
#include "std/vector.hpp"
#include <QtGui/QPixmap>
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
#include <QtGui/QWidget>
#else
#include <QtWidgets/QWidget>
#endif
class QTableWidget;
class QLineEdit;
class QPushButton;
class QTimer;
namespace qt
{
class DrawWidget;
class SearchPanel : public QWidget
{
DrawWidget * m_pDrawWidget;
QTableWidget * m_pTable;
QLineEdit * m_pEditor;
QPushButton * m_pClearButton;
QTimer * m_pAnimationTimer;
QPixmap m_busyIcon;
/// Stores current search results
typedef search::Results ResultsT;
typedef search::Result ResultT;
vector<ResultT> m_results;
search::SearchParams m_params;
Q_OBJECT
public:
SearchPanel(DrawWidget * drawWidget, QWidget * parent);
private:
virtual void hideEvent(QHideEvent *);
void SearchResultThreadFunc(ResultsT const & result);
void ClearResults();
signals:
void SearchResultSignal(ResultsT * result);
private slots:
void OnSearchPanelItemClicked(int row, int column);
void OnSearchTextChanged(QString const &);
/// Called via signal to support multithreading
void OnSearchResult(ResultsT * results);
void OnAnimationTimer();
void OnClearButton();
bool TryChangeMapStyleCmd(QString const & str);
bool TryChangeRouterCmd(QString const & str);
bool Try3dModeCmd(QString const & str);
bool TryMigrate(QString const & str);
bool TryDisplacementModeCmd(QString const & str);
};
} // namespace qt
|