Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Password input with others then asterisks
Forum Updated to NodeBB v4.3 + New Features

Password input with others then asterisks

Scheduled Pinned Locked Moved QML and Qt Quick
qmlvirtual keyboar5.4.1password
3 Posts 2 Posters 5.9k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    PhTe
    wrote on 16 Jun 2015, 10:18 last edited by
    #1

    I have created a TextField which acts as a password input field

    TextField {
        id: passwordInput
        echoMode: TextInput.Password
        style: TextFieldStyle {
            background: Rectangle {
                radius: 6
                border.color: "#AAA"
            }
        }
    }
    

    This works so far, except that the font i use seems not compatible with password fields and it shows only small boxes instead of asterisks which looks very ugly.

    So is it possible to show other characters instead of *, for example a # or an X or something like this?

    My first try was to handle the keys.onpressed event and set the characters in the text field manually, but i use a virtual keyboard and there is a bug (QTBUG-40803) which prevent qt from receiving key events from virtual keyboards in text inputs. So this does not work...

    Does anyone know a solution for this?

    1 Reply Last reply
    0
    • L Offline
      L Offline
      Leonardo
      wrote on 16 Jun 2015, 16:00 last edited by
      #2

      Try using a TextInput instead. Then you can set the passwordCharacter property.

      http://doc.qt.io/qt-5/qml-qtquick-textinput.html#passwordCharacter-prop

      P 1 Reply Last reply 22 Jun 2015, 09:21
      0
      • L Leonardo
        16 Jun 2015, 16:00

        Try using a TextInput instead. Then you can set the passwordCharacter property.

        http://doc.qt.io/qt-5/qml-qtquick-textinput.html#passwordCharacter-prop

        P Offline
        P Offline
        PhTe
        wrote on 22 Jun 2015, 09:21 last edited by
        #3

        @Leonardo Yeah, that works. Thank you.

        1 Reply Last reply
        0

        2/3

        16 Jun 2015, 16:00

        • Login

        • Login or register to search.
        2 out of 3
        • First post
          2/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved