diff options
author | Yulong Bai <yulong.bai@qt.io> | 2018-02-20 14:42:49 +0100 |
---|---|---|
committer | Yulong Bai <yulong.bai@qt.io> | 2018-02-21 14:03:30 +0000 |
commit | 6b28a01d3f4c7c28e38b395bc3d916154bdfdcaa (patch) | |
tree | 343c7b329dfe2c4897e966755316291b8fe36cbe /src/quicktemplates2/qquicktextarea.cpp | |
parent | 8505b96fbe88980e45c0f78792ad48c02f34bfa7 (diff) |
QQuickTextArea: add placeholderTextColor property
Add placeholderTextColor property for user convenience to customize the
placeholderText color to fit the backgrounds.
[ChangeLog][TextArea] Added placeholderTextColor property for user
convenience to customize the placeholderText color to fit the backgrounds.
Change-Id: Iea0233f909ca9cfe19d88f9bc24691aa35b5ab35
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquicktextarea.cpp')
-rw-r--r-- | src/quicktemplates2/qquicktextarea.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquicktextarea.cpp b/src/quicktemplates2/qquicktextarea.cpp index c4818304..fb724225 100644 --- a/src/quicktemplates2/qquicktextarea.cpp +++ b/src/quicktemplates2/qquicktextarea.cpp @@ -566,6 +566,30 @@ void QQuickTextArea::setPlaceholderText(const QString &text) } /*! + \qmlproperty color QtQuick.Controls::TextArea::placeholderTextColor + \since QtQuick.Controls 2.5 (Qt 5.12) + + This property holds the color of placeholderText. + + \sa placeholderText +*/ +QColor QQuickTextArea::placeholderTextColor() const +{ + Q_D(const QQuickTextArea); + return d->placeholderColor; +} + +void QQuickTextArea::setPlaceholderTextColor(const QColor &color) +{ + Q_D(QQuickTextArea); + if (d->placeholderColor == color) + return; + + d->placeholderColor = color; + emit placeholderTextColorChanged(); +} + +/*! \qmlproperty enumeration QtQuick.Controls::TextArea::focusReason \include qquickcontrol-focusreason.qdocinc |