1 #ifndef SEARCHLINEEDIT_H
2 #define SEARCHLINEEDIT_H
4 #include "urllineedit.h"
5 #include "autocomplete.h"
8 #include <QAbstractButton>
18 Clear button on the right hand side of the search widget.
20 "A circle with an X in it"
22 class ClearButton : public QAbstractButton
27 ClearButton(QWidget *parent = 0);
28 void paintEvent(QPaintEvent *event);
31 void textChanged(const QString &text);
35 class SearchLineEdit : public ExLineEdit
38 Q_PROPERTY(QString inactiveText READ inactiveText WRITE setInactiveText)
41 void textChanged(const QString &text);
42 void textEdited(const QString &text);
43 void search(const QString &text);
44 void suggestionAccepted(Suggestion *suggestion);
47 SearchLineEdit(QWidget *parent = 0);
49 QString inactiveText() const;
50 void setInactiveText(const QString &text);
53 void setMenu(QMenu *menu);
54 void updateGeometries();
56 void preventSuggest();
57 void selectAll() { lineEdit()->selectAll(); }
58 void setSuggester(Suggester *suggester) { completion->setSuggester(suggester); }
59 void setText(const QString &text) { lineEdit()->setText(text); }
62 void resizeEvent(QResizeEvent *event);
63 void paintEvent(QPaintEvent *event);
64 void focusInEvent(QFocusEvent *event);
70 SearchButton *m_searchButton;
71 QString m_inactiveText;
72 AutoComplete *completion;
75 #endif // SEARCHLINEEDIT_H