aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@digia.com>2013-03-13 14:34:51 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-23 12:53:48 +0200
commitf711f9387544aabf21ec19a7dd1dcb91f3d947fc (patch)
tree41bb9f8902e65ce072e858522f427f5537a19976 /src/quick/items
parent88e215b6d56b406d994f97a0adbd2a6afff655be (diff)
Use the platform theme's password mask character for text input fields.
Task-number: QTBUG-29871 Change-Id: I3b15dfab5ca6455df465c502c93aac7b85a64531 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Caroline Chao <caroline.chao@digia.com>
Diffstat (limited to 'src/quick/items')
-rw-r--r--src/quick/items/qquicktextinput.cpp8
-rw-r--r--src/quick/items/qquicktextinput_p_p.h2
2 files changed, 6 insertions, 4 deletions
diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp
index 65a0d6215a..30be92672d 100644
--- a/src/quick/items/qquicktextinput.cpp
+++ b/src/quick/items/qquicktextinput.cpp
@@ -1229,10 +1229,11 @@ Qt::InputMethodHints QQuickTextInputPrivate::effectiveInputMethodHints() const
Specifies how the text should be displayed in the TextInput.
\list
\li TextInput.Normal - Displays the text as it is. (Default)
- \li TextInput.Password - Displays asterisks instead of characters.
+ \li TextInput.Password - Displays platform-dependent password mask
+ characters instead of the actual characters.
\li TextInput.NoEcho - Displays nothing.
\li TextInput.PasswordEchoOnEdit - Displays characters as they are entered
- while editing, otherwise displays asterisks.
+ while editing, otherwise identical to \c TextInput.Password.
\endlist
*/
QQuickTextInput::EchoMode QQuickTextInput::echoMode() const
@@ -2199,7 +2200,8 @@ void QQuickTextInput::selectWord()
\qmlproperty string QtQuick2::TextInput::passwordCharacter
This is the character displayed when echoMode is set to Password or
- PasswordEchoOnEdit. By default it is an asterisk.
+ PasswordEchoOnEdit. By default it is the password character used by
+ the platform theme.
If this property is set to a string with more than one character,
the first character is used. If the string is empty, the value
diff --git a/src/quick/items/qquicktextinput_p_p.h b/src/quick/items/qquicktextinput_p_p.h
index 57eff175a2..11096cfa1d 100644
--- a/src/quick/items/qquicktextinput_p_p.h
+++ b/src/quick/items/qquicktextinput_p_p.h
@@ -110,7 +110,7 @@ public:
, updateType(UpdatePaintNode)
, mouseSelectionMode(QQuickTextInput::SelectCharacters)
, m_layoutDirection(Qt::LayoutDirectionAuto)
- , m_passwordCharacter(QLatin1Char('*'))
+ , m_passwordCharacter(qApp->styleHints()->passwordMaskCharacter())
, focusOnPress(true)
, cursorVisible(false)
, cursorPending(false)