64 lines
1.4 KiB
C++
64 lines
1.4 KiB
C++
#ifndef QTMATERIALTEXTFIELD_H
|
|
#define QTMATERIALTEXTFIELD_H
|
|
|
|
#include <QtWidgets/QLineEdit>
|
|
#include <QColor>
|
|
namespace md
|
|
{
|
|
|
|
class TextFieldPrivate;
|
|
|
|
class TextField : public QLineEdit
|
|
{
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY(QColor textColor WRITE setTextColor READ textColor)
|
|
Q_PROPERTY(QColor inkColor WRITE setInkColor READ inkColor)
|
|
Q_PROPERTY(QColor inputLineColor WRITE setInputLineColor READ inputLineColor)
|
|
|
|
public:
|
|
explicit TextField(QWidget *parent = 0);
|
|
~TextField();
|
|
|
|
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;
|
|
|
|
void setTextColor(const QColor &color);
|
|
QColor textColor() const;
|
|
|
|
void setLabelColor(const QColor &color);
|
|
QColor labelColor() const;
|
|
|
|
void setInkColor(const QColor &color);
|
|
QColor inkColor() const;
|
|
|
|
void setInputLineColor(const QColor &color);
|
|
QColor inputLineColor() const;
|
|
|
|
void setShowInputLine(bool value);
|
|
bool hasInputLine() const;
|
|
|
|
protected:
|
|
TextField(TextFieldPrivate &d, QWidget *parent = 0);
|
|
|
|
bool event(QEvent *event) Q_DECL_OVERRIDE;
|
|
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
|
|
|
|
const QScopedPointer<TextFieldPrivate> d_ptr;
|
|
|
|
private:
|
|
Q_DISABLE_COPY(TextField)
|
|
Q_DECLARE_PRIVATE(TextField)
|
|
};
|
|
}
|
|
#endif // QTMATERIALTEXTFIELD_H
|