-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathsearchlineedit.h
51 lines (38 loc) · 1.01 KB
/
searchlineedit.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
#ifndef SEARCHLINEEDIT_H
#define SEARCHLINEEDIT_H
#include "urllineedit.h"
#include <QMouseEvent>
#include <QAbstractButton>
#include <QObject>
#include <QLineEdit>
class SearchButton : public QAbstractButton {
public:
SearchButton(QWidget *parent = 0);
void paintEvent(QPaintEvent *event);
QMenu *m_menu;
protected:
void mousePressEvent(QMouseEvent *event);
};
class SearchLineEdit : public ExLineEdit
{
Q_OBJECT
Q_PROPERTY(QString inactiveText READ inactiveText WRITE setInactiveText)
signals:
void textChanged(const QString &text);
void returnPressed();
public:
SearchLineEdit(QWidget *parent = 0);
QString text();
QString inactiveText() const;
void setInactiveText(const QString &text);
QMenu *menu() const;
void setMenu(QMenu *menu);
protected:
void resizeEvent(QResizeEvent *event);
void paintEvent(QPaintEvent *event);
private:
void updateGeometries();
SearchButton *m_searchButton;
QString m_inactiveText;
};
#endif // SEARCHLINEEDIT_H