Results 1 to 10 of 10

Thread: Use QLineEdit as password field

  1. #1
    Join Date
    Aug 2010
    Posts
    19
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows Symbian S60 Maemo/MeeGo
    Wiki edits
    9

    Question Use QLineEdit as password field

    Hello,

    I need an edit for for password in my login form.
    I use QLineEdit class and set echo mode to password, inputHintMethod
    to
    - NoAutoUpperCase
    - NoPredictiveText

    The problem is that:
    When application is installed on device N97mini, the first letter is always uppercase automatically and text autocorrection is applied and it makes end-user extremely difficult to enter the correct password when user uses the hard keyboard.

    Do you have any ideas how to avoid this problem?
    Is it a Qt bug? or N97 mini firmware bug? Anybody experiences this before?

    Thanks
    Hai
    Last edited by lyhoanghai; 23rd September 2010 at 15:18.

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Use QLineEdit as password field

    I've browsed through the qt bugs for a moment and there are a couple of bugs related to the line edit and the N97. But I didn't see your description.

    Is at absolutely necessary to use the password masking?

  3. #3
    Join Date
    Aug 2010
    Posts
    19
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows Symbian S60 Maemo/MeeGo
    Wiki edits
    9

    Default Re: Use QLineEdit as password field

    Hello tbscope,

    Because that field is for inputting user's password within a Login form, the text must be hidden/masked. It is mandatory.
    Actually, I found that the virtual keyboard of N97 mini works normally while the physical keyboards has problem.

    Hai

  4. #4
    Join Date
    Aug 2010
    Posts
    19
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows Symbian S60 Maemo/MeeGo
    Wiki edits
    9

    Default Re: Use QLineEdit as password field

    I was upset that the physical keyboard does not work for both N97 mini and N97. I don't have conditions to test on other device and I have to publish application with the uncertainty !
    The following is my code.
    Qt Code:
    1. editPassword = new QLineEdit(this);
    2. editPassword->setEchoMode(QLineEdit::Password);
    3. editPassword->setInputMethodHints(Qt::ImhHiddenText| Qt::ImhNoPredictiveText|Qt::ImhNoAutoUppercase);
    To copy to clipboard, switch view to plain text mode 
    If i remove the second line then my edit field don't have preditivce text. But if I add the second line, my password field is completely useless. The user has to enter password with predictive text !!!!
    My customer cannot use the application if he cannot login. My applicaiton is completely useless
    Any idea how to implement a password field in Qt? This is really a very basic problem, i think !

    Thank you in advance

    Hai

  5. #5
    Join Date
    Oct 2010
    Posts
    37
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Use QLineEdit as password field

    have you thought about something else like maybe a 6x6 grid where he has to select some (6+) items in a row? just a suggestion...
    they could be colour coded so he might remember a password as red, red, green, purple, pink, blue, blue

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Use QLineEdit as password field

    The problem is unrelated to Qt. I'm having the same issue when entering passwords on my N900 in software not written using Qt. What you can surely do is to make passwords case-insensitive.

    On the other hand I don't know what is the point of having passwords with predictive text - then you are revealing your password to all applications in the system so what's the point in obscuring the input in the first place?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Aug 2010
    Posts
    19
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows Symbian S60 Maemo/MeeGo
    Wiki edits
    9

    Default Re: Use QLineEdit as password field

    Hello wysota,

    Unfortunately, I cannot make the password case-insenstive because the authentication module was developed long time ago by other group inside my company.
    It must be case-sensitive.
    Second, my goal is to make the password field is NOT predictive text. I can do that with a normal field. However, when I set
    editPassword->setEchoMode(QLineEdit::Password);
    then the predictive text feature is "turned on" and make my application completed useless for user (because most of the case they try to use physical keyboard to input password and they cannot do taht with predictive text is "on").

    If this error is not Qt error then Nokia did a very bad error. Most serious application needs authentication and what will happen if user cannot do that with the physical keyboard. Nokia should have fixed this error very long time ago .

    I'm going to realease my application an I desperately need a solution for this.

    Hai

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Use QLineEdit as password field

    What happens if you remove line #2 from your code or move it after line #3?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #9
    Join Date
    Aug 2010
    Posts
    19
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows Symbian S60 Maemo/MeeGo
    Wiki edits
    9

    Default Re: Use QLineEdit as password field

    Hello,

    If I remove line 2, QLineEdit does not mask the password anymore. All password are displayed when user inputs them
    If I swap line 2 and line 3, the result is not changed. QLineEdit still has "predictive text" feature.

    Hai

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Use QLineEdit as password field

    It seems that Qt hints the firmware it wants to hide the text (as this is what line #3 does) but the hint gets ignored. I don't know if you can overcome this problem without subclassing QLineEdit. You can try using style-sheets instead of line #2 to ask the widget to use a different echo character but I don't know if it will work without setting the widget to password mode.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 2
    Last Post: 21st August 2010, 11:26
  2. QHttp get AND get field
    By TomASS in forum Newbie
    Replies: 0
    Last Post: 10th November 2009, 22:45
  3. QuaZIP and Password?
    By NoRulez in forum Qt Programming
    Replies: 1
    Last Post: 16th December 2008, 10:10
  4. password authentication with QsslSocket
    By mate in forum Qt Programming
    Replies: 2
    Last Post: 16th July 2008, 09:17
  5. Masking password
    By Lebowski in forum Qt Tools
    Replies: 3
    Last Post: 14th April 2006, 12:17

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.