/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
- #ifndef QSEARCHFIELD_H
- #define QSEARCHFIELD_H
- #include <QWidget>
- #include <QPointer>
- #include <QMenu>
- #include "DllMacro.h"
- class QSearchFieldPrivate;
- class DLLEXPORT QSearchField : public QWidget
- {
- Q_OBJECT
- Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged USER true);
- Q_PROPERTY(QString placeholderText READ placeholderText WRITE setPlaceholderText);
- public:
- explicit QSearchField(QWidget *parent);
- QString text() const;
- QString placeholderText() const;
- void setFocus(Qt::FocusReason);
- void setMenu(QMenu *menu);
- public slots:
- void setText(const QString &text);
- void setPlaceholderText(const QString &text);
- void clear();
- void selectAll();
- void setFocus();
- signals:
- void textChanged(const QString &text);
- void editingFinished();
- void returnPressed();
- private slots:
- void popupMenu();
- protected:
- void changeEvent(QEvent*);
- void resizeEvent(QResizeEvent*);
- private:
- friend class QSearchFieldPrivate;
- QPointer <QSearchFieldPrivate> pimpl;
- };
- #endif // QSEARCHFIELD_H