summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaiwei Li <daiweili@suitabletech.com>2015-01-30 20:24:31 -0800
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2015-02-02 10:05:38 +0000
commite7fc6186be4700565505ef890c53dbe3d22ba3f4 (patch)
treed237f90981cce9d18d43ea22b54d77fde1aa820e /src
parent02d7f36ddfd444d715f82c1a780e99f6e0a7c14a (diff)
downloadqtquickcontrols-e7fc6186be4700565505ef890c53dbe3d22ba3f4.tar.gz
Allow override of passwordCharacter in TextFieldStyle
Task-number: QTBUG-41276 Change-Id: If384db2387d8e08459fd65c18fdc1541fdf4c084 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/controls/Styles/Base/TextFieldStyle.qml10
-rw-r--r--src/controls/TextField.qml2
2 files changed, 12 insertions, 0 deletions
diff --git a/src/controls/Styles/Base/TextFieldStyle.qml b/src/controls/Styles/Base/TextFieldStyle.qml
index 4d0a66eb..a3ed52d8 100644
--- a/src/controls/Styles/Base/TextFieldStyle.qml
+++ b/src/controls/Styles/Base/TextFieldStyle.qml
@@ -87,6 +87,16 @@ Style {
property color selectedTextColor: SystemPaletteSingleton.highlightedText(control.enabled)
/*!
+ \qmlproperty string passwordCharacter
+ \since QtQuick.Controls.Styles 1.4
+
+ The password character that is displayed when echoMode
+ on the TextField is set to TextInput.Password or
+ TextInput.PasswordEchoOnEdit.
+ */
+ property string passwordCharacter: Qt.styleHints.passwordMaskCharacter
+
+ /*!
\qmlproperty enumeration renderType
\since QtQuick.Controls.Styles 1.1
diff --git a/src/controls/TextField.qml b/src/controls/TextField.qml
index 8a544a69..b544d050 100644
--- a/src/controls/TextField.qml
+++ b/src/controls/TextField.qml
@@ -639,6 +639,8 @@ Control {
TextInputWithHandles {
id: textInput
focus: true
+ passwordCharacter: __style && __style.passwordCharacter !== undefined ? __style.passwordCharacter
+ : Qt.styleHints.passwordMaskCharacter
selectionColor: __panel ? __panel.selectionColor : "darkred"
selectedTextColor: __panel ? __panel.selectedTextColor : "white"