Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-95653

TextField echoMode TextInput.Password not working

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • None
    • 5.15
    • Quick: Controls 2
    • Qt 5.15.5, QtC 4.15.1, MacOS 10.15.7, Android Device Android 10
    • Android

    Description

      2 TextFields: first normal text, second PasswordText

      if first TextField uses Return key to jump into the Password TextField:

      Keys.onReturnPressed: pwText.forceActiveFocus()
      

      Then typing the PasswordText the Password is readable Text if first character isn't a digit.

      Without Keys.onReturnPressed and tapping into the Password Field all works as expected: Password text isn't readable

      Here's the App to test:

      import QtQuick 2.15
      import QtQuick.Controls 2.15
      
      ApplicationWindow {
          id: window
          width: 640
          height: 480
          visible: true
          title: qsTr("Test Password")
          Page {
              TextField {
                  id: userName
                  selectByMouse: true
                  anchors.top: parent.top
                  anchors.left: parent.left
                  anchors.topMargin: 24
                  anchors.leftMargin: 24
                  placeholderText: qsTr("Please enter your User Name")
                  inputMethodHints: Qt.ImhEmailCharactersOnly | Qt.ImhNoAutoUppercase
                  // comment following line and all works as expected
                  // otherwise password text only not readable if starts with a digit
                  Keys.onReturnPressed: pwText.forceActiveFocus()
              }
              TextField {
                  id: pwText
                  selectByMouse: true
                  anchors.top: userName.bottom
                  anchors.left: parent.left
                  anchors.topMargin: 24
                  anchors.leftMargin: 24
                  width: 200
                  placeholderText: qsTr("Please enter your Password")
                  inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
                  echoMode: TextInput.Password
                  Keys.onReturnPressed:  {
                      dummi.forceActiveFocus()
                  }
              }
              Label {
                  id: dummi
                  anchors.top: pwText.bottom
              }
          }
      }
      

      On iOS and macOS all works well - problem only happens on Android

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            ekkescorner Ekkehard
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes