PasswordField QML Type
A text field for password entry More...
Import Statement: | import Sailfish.Silica 1.0 |
Inherits: | TextField
|
Properties
Detailed Description
The PasswordField type provides a text field for password entry. It includes a button that allows the user to toggle the echoMode between TextInput.Normal
and the passwordEchoMode.
For example, below the PasswordField is used as part of a UI that requests the username and password. When the EnterKey is activated within the password field, the dialog is accepted:
import QtQuick 2.2
import Sailfish.Silica 1.0
Dialog {
id: dialog
Column {
width: parent.width
TextField {
label: "Username"
width: parent.width
EnterKey.iconSource: "image://theme/icon-m-enter-next"
EnterKey.onClicked: passwordField.focus = true
}
PasswordField {
id: passwordField
EnterKey.iconSource: "image://theme/icon-m-enter-accept"
EnterKey.onClicked: dialog.accept()
}
}
}
The label and placeholderText values are set to a localized translation of "Password".
Property Documentation
The password field UI includes a button that allows the user to toggle the echoMode between TextInput.Normal
and the value of this property.
The default value is TextInput.Password
.
showEchoModeToggle : bool |
Holds whether the button that toggles the echoMode should be shown.