qt-material-widgets/components/textfield.h

63 lines
1.5 KiB
C
Raw Normal View History

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-16 16:08:54 +00:00
Q_PROPERTY(QColor textColor WRITE setTextColor READ textColor)
Q_PROPERTY(QColor backgroundColor WRITE setBackgroundColor READ backgroundColor)
Q_PROPERTY(QColor inkColor WRITE setInkColor READ inkColor)
Q_PROPERTY(QColor underlineColor WRITE setUnderlineColor READ underlineColor)
Q_PROPERTY(QColor hintColor WRITE setHintColor READ hintColor)
2016-06-14 17:29:20 +00:00
2016-04-14 13:47:27 +00:00
public:
explicit TextField(QWidget *parent = 0);
~TextField();
2016-06-16 16:08:54 +00:00
void setUseThemeColors(bool value);
bool useThemeColors() const;
void setShowLabel(bool value);
bool hasLabel() const;
void setLabelFontSize(qreal size);
qreal labelFontSize() const;
void setLabel(const QString &label);
QString label() const;
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-06-16 16:08:54 +00:00
void setHintColor(const QColor &color);
QColor hintColor() const;
2016-07-18 13:26:29 +00:00
QSize sizeHint() const Q_DECL_OVERRIDE;
2016-04-14 13:47:27 +00:00
protected:
2016-06-16 16:08:54 +00:00
bool event(QEvent *event) Q_DECL_OVERRIDE;
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