Results 1 to 4 of 4

Thread: QLineEdit and EchoMode Passowrd

  1. #1
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default QLineEdit and EchoMode Passowrd

    Hi,

    I am trying to make a password field by using QLineEdit with the EchoMode Password and the field is filled with '*' even when it is empty.
    Calleing clear() or setting an empty string at startup makes no difference.
    It works ok, I can type in my password, but it is always filled with '*'.
    I thought it was a Qt-Vista related bug, but it is the same under XP.

    Any one knows any thing about this?

    Thanks.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  2. #2
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QLineEdit and EchoMode Passowrd

    what is returned when u call text() on lineedit with "*" in it..call length of the returned string..there must be something there..

  3. #3
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QLineEdit and EchoMode Passowrd

    Hi,

    length is 0.
    text() returns an empty string. (while is is full with '*' at the same time!)

    As I said, I also can type in in "insert" mode (the whole length of the field), which would be possible if there was something already.

    This project it really a very simple project, almost a hello world app!
    Its just an ui done by designer, and all i do is read the text from the QLineEdits, thats it!

    Thanks for the help!

    P.S
    This happens as soon as I choose Password EchoMode in Designer!!
    This has nothing to do with my code!
    Last edited by high_flyer; 1st April 2009 at 17:31.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QLineEdit and EchoMode Passowrd

    Ok - as always, the problem is between the keyboard and the chair.
    I had an input mask, which required numeric input.

    Thanks!
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.