API Documentation

Documentation for developing SailfishOS applications

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"
             placeholderText: label

             EnterKey.iconSource: "image://theme/icon-m-enter-next"
             EnterKey.onClicked: passwordField.focus = true
         }

         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

passwordEchoMode : int

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.


We use cookies to improve your user experience and to help us to develop our services. By continuing to browse the site, you approve of our use of cookies.