PageRenderTime 24ms CodeModel.GetById 17ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/src/libtomahawk/thirdparty/Qocoa/qsearchfield.h

http://github.com/tomahawk-player/tomahawk
C Header | 50 lines | 38 code | 12 blank | 0 comment | 0 complexity | c7cf1b4e0009c8839065bd0fb56d8d06 MD5 | raw file
 1#ifndef QSEARCHFIELD_H
 2#define QSEARCHFIELD_H
 3
 4#include <QWidget>
 5#include <QPointer>
 6#include <QMenu>
 7
 8#include "DllMacro.h"
 9
10class QSearchFieldPrivate;
11class DLLEXPORT QSearchField : public QWidget
12{
13    Q_OBJECT
14
15    Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged USER true);
16    Q_PROPERTY(QString placeholderText READ placeholderText WRITE setPlaceholderText);
17
18public:
19    explicit QSearchField(QWidget *parent);
20
21    QString text() const;
22    QString placeholderText() const;
23    void setFocus(Qt::FocusReason);
24    void setMenu(QMenu *menu);
25
26public slots:
27    void setText(const QString &text);
28    void setPlaceholderText(const QString &text);
29    void clear();
30    void selectAll();
31    void setFocus();
32
33signals:
34    void textChanged(const QString &text);
35    void editingFinished();
36    void returnPressed();
37
38private slots:
39    void popupMenu();
40
41protected:
42    void changeEvent(QEvent*);
43    void resizeEvent(QResizeEvent*);
44
45private:
46    friend class QSearchFieldPrivate;
47    QPointer <QSearchFieldPrivate> pimpl;
48};
49
50#endif // QSEARCHFIELD_H