2016-04-14 13:47:27 +00:00
|
|
|
#ifndef TEXTFIELD_H
|
|
|
|
#define TEXTFIELD_H
|
|
|
|
|
2016-04-14 14:11:41 +00:00
|
|
|
#include <QLineEdit>
|
2016-04-14 13:47:27 +00:00
|
|
|
|
2016-06-14 15:30:46 +00:00
|
|
|
class TextFieldPrivate;
|
2016-04-14 15:15:17 +00:00
|
|
|
|
2016-04-14 14:11:41 +00:00
|
|
|
class TextField : public QLineEdit
|
2016-04-14 13:47:27 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
2016-06-14 17:29:20 +00:00
|
|
|
Q_PROPERTY(QColor textColor WRITE setTextColor READ progress NOTIFY textColor)
|
|
|
|
Q_PROPERTY(QColor backgroundColor WRITE setBackgroundColor READ progress NOTIFY backgroundColor)
|
|
|
|
Q_PROPERTY(QColor inkColor WRITE setInkColor READ progress NOTIFY inkColor)
|
|
|
|
Q_PROPERTY(QColor underlineColor WRITE setUnderlineColor READ progress NOTIFY underlineColor)
|
|
|
|
|
2016-04-14 13:47:27 +00:00
|
|
|
public:
|
|
|
|
explicit TextField(QWidget *parent = 0);
|
|
|
|
~TextField();
|
|
|
|
|
2016-06-14 17:29:20 +00:00
|
|
|
void setTextColor(const QColor &color);
|
|
|
|
QColor textColor() const;
|
|
|
|
|
|
|
|
void setBackgroundColor(const QColor &color);
|
|
|
|
QColor backgroundColor() const;
|
|
|
|
|
|
|
|
void setInkColor(const QColor &color);
|
|
|
|
QColor inkColor() const;
|
|
|
|
|
|
|
|
void setUnderlineColor(const QColor &color);
|
|
|
|
QColor underlineColor() const;
|
|
|
|
|
2016-04-14 13:47:27 +00:00
|
|
|
protected:
|
2016-06-14 17:29:20 +00:00
|
|
|
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
|
|
|
|
|
2016-06-14 15:30:46 +00:00
|
|
|
const QScopedPointer<TextFieldPrivate> d_ptr;
|
2016-04-14 15:15:17 +00:00
|
|
|
|
|
|
|
private:
|
2016-06-14 15:30:46 +00:00
|
|
|
Q_DISABLE_COPY(TextField)
|
|
|
|
Q_DECLARE_PRIVATE(TextField)
|
2016-04-14 13:47:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TEXTFIELD_H
|