2012-06-27 17:08:51 +02:00
|
|
|
#ifndef QSEARCHFIELD_H
|
|
|
|
#define QSEARCHFIELD_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
#include <QPointer>
|
|
|
|
|
|
|
|
class QSearchFieldPrivate;
|
|
|
|
class QSearchField : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit QSearchField(QWidget *parent);
|
|
|
|
|
|
|
|
QString text() const;
|
2012-06-27 17:37:55 +02:00
|
|
|
QString placeholderText() const;
|
2012-07-12 16:51:11 +02:00
|
|
|
void setFocus(Qt::FocusReason reason);
|
2012-06-27 17:08:51 +02:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void setText(const QString &text);
|
|
|
|
void setPlaceholderText(const QString &text);
|
|
|
|
void clear();
|
2012-06-28 12:27:32 +02:00
|
|
|
void selectAll();
|
2012-07-12 16:51:11 +02:00
|
|
|
void setFocus();
|
2012-06-28 12:27:32 +02:00
|
|
|
|
2012-06-27 17:08:51 +02:00
|
|
|
signals:
|
|
|
|
void textChanged(const QString &text);
|
|
|
|
void editingFinished();
|
2012-06-28 11:34:44 +02:00
|
|
|
void returnPressed();
|
2012-06-27 17:08:51 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void resizeEvent(QResizeEvent*);
|
2012-07-02 00:49:37 +02:00
|
|
|
bool eventFilter(QObject*, QEvent*);
|
2012-06-27 17:08:51 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
friend class QSearchFieldPrivate;
|
|
|
|
QPointer <QSearchFieldPrivate> pimpl;
|
2012-06-27 17:37:55 +02:00
|
|
|
|
|
|
|
Q_PROPERTY(QString placeholderText READ placeholderText WRITE setPlaceholderText);
|
2012-06-27 17:08:51 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // QSEARCHFIELD_H
|