forked from altairwei/WizNotePlus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWizSearchWidget.h
executable file
·72 lines (54 loc) · 1.5 KB
/
WizSearchWidget.h
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
#ifndef WIZSEARCHWIDGET_H
#define WIZSEARCHWIDGET_H
#include <QtGlobal>
#include <QWidget>
#include <QLineEdit>
#include <QLabel>
#include <QHBoxLayout>
// Wrap widget for qt widget and mac native search field
// refer to mac/wizSearchWidget.mm for osx NSSearchField
class WizExplorerApp;
class WizSearchEdit : public QLineEdit
{
Q_OBJECT
public:
WizSearchEdit(QWidget* parent = 0);
public slots:
void on_actionAdvancedSearch();
void on_addCustomSearch();
signals:
void advanceSearchRequest();
void addCustomSearchRequest();
protected:
void paintEvent(QPaintEvent* event);
void mousePressEvent(QMouseEvent* event);
void mouseMoveEvent(QMouseEvent* event);
private:
QPixmap m_searchIcon;
QPixmap m_deleteIcon;
QMenu* m_menu;
};
class WizSearchView : public QWidget
{
Q_OBJECT
public:
WizSearchView(QWidget* parent = 0);
void clear();
void focus();
virtual QSize sizeHint() const;
//
void setCurrentKb(const QString& kbGuid) { m_strCurrentKbGuid = kbGuid; }
QString currentKb() const { return m_strCurrentKbGuid; }
public Q_SLOTS:
void on_search_returnPressed();
void on_searchTextChanged(QString str);
void setWidthHint(int nWidth);
private:
WizSearchEdit* m_editSearch;
int m_widthHint;
QString m_strCurrentKbGuid;
Q_SIGNALS:
void addCustomSearchRequest();
void doSearch(const QString& keywords);
};
#endif // WIZSEARCHWIDGET_H