1
0
mirror of https://github.com/strawberrymusicplayer/strawberry synced 2025-01-27 15:49:43 +01:00

49 lines
1.0 KiB
C
Raw Normal View History

2018-02-27 18:06:05 +01:00
#ifndef QSEARCHFIELD_H
#define QSEARCHFIELD_H
#include <QWidget>
#include <QPointer>
2018-07-01 22:26:46 +02:00
#include <QMenu>
2018-02-27 18:06:05 +01:00
class QSearchFieldPrivate;
class QSearchField : public QWidget
{
Q_OBJECT
2018-07-01 22:26:46 +02:00
Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged USER true);
Q_PROPERTY(QString placeholderText READ placeholderText WRITE setPlaceholderText);
2018-02-27 18:06:05 +01:00
public:
explicit QSearchField(QWidget *parent);
QString text() const;
QString placeholderText() const;
2018-07-01 22:26:46 +02:00
void setFocus(Qt::FocusReason);
void setMenu(QMenu *menu);
2018-02-27 18:06:05 +01:00
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();
2018-07-01 22:26:46 +02:00
private slots:
void popupMenu();
2018-02-27 18:06:05 +01:00
protected:
2018-07-01 22:26:46 +02:00
void changeEvent(QEvent*);
2018-02-27 18:06:05 +01:00
void resizeEvent(QResizeEvent*);
private:
friend class QSearchFieldPrivate;
QPointer <QSearchFieldPrivate> pimpl;
};
#endif // QSEARCHFIELD_H