×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    34

    Virtual keyboard and password echo

    Our Qt app for Symbian^3 has a password field. It's a QLineEdit set up like this:

    Code:
    ui->passwordLine->setInputMethodHints(Qt::ImhHiddenText| Qt::ImhNoPredictiveText | Qt::ImhNoAutoUppercase);
    ui->passwordLine->setEchoMode(QLineEdit::Password);
    When writing password with physical keyboard, characters are shown as asterisks as excepted. This works with deskop builds, Maemo and E7.
    However when using virtual keyboard, characters are shown as plain text. There is user option in virtual keyboard to hide/preview characters, but shouldn't it be turned on by Qt? After ticking that on, characters are shown as asterisks and it can not be turned off anymore. Also after closing virtual keyboard, characters are shown as asterisks in password field.

    This behavior happens with Qt 4.6.3 and 4.7.3. (With 4.7.3 auto uppercase is also ignored! It works with 4.6.3)
    I found quite a deal of bugs around QLineEdit and text input in general, but I didn't found this specific issue.

    Should virtual keyboard hide characters by echo mode of QLineEdit?
    Is there some Symbian specific way to work-around this? (I already had to use some magic to find out when virtual keyboard is on.)
    Last edited by virne; 2011-04-07 at 22:50.

  2. #2
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Virtual keyboard and password echo

    The virtual keyboard "support" is pretty sucky in general. One reason why Qt is getting canned, I suspect.

  3. #3
    Nokia Developer Expert
    Join Date
    Feb 2008
    Posts
    183

    Re: Virtual keyboard and password echo

    Quote Originally Posted by danhicksbyron View Post
    The virtual keyboard "support" is pretty sucky in general. One reason why Qt is getting canned, I suspect.
    Hey! We are not getting canned!
    And if we did, it would had nothing to do with virtual keyboard "support" (which I agree, could be soooo much better).

    As to the problem in the original post, it seems to be an issue in the E7, since I cannot reproduce it with N8 or C7.
    Could you please report it as an issue to the http://bugreports.qt.nokia.com ?

  4. #4
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    286

    Re: Virtual keyboard and password echo

    AutoUpperCasing was removed on purpose from password fields. It was considered usability issue when entering passwords.
    Preview echoing was working at some point, I personally verified that it works so this is regression in 4.7.3.

    Not sure there is easy workaround, you'd probably need derive your own QInputContext and make the association with FEP (MCoeFepAwareTextEditor). This is not task for faint hearted :S

    EDIT: Fuzzbender is probably right, echo not working is E7 specific issue? This could be due to E7 reporting QWERTY keyboard.

    -Janne
    http://twitter.com/#!/koshui

  5. #5
    Registered User
    Join Date
    Mar 2003
    Posts
    34

    Re: Virtual keyboard and password echo

    Well hmm.. Since you guys were saying that it works, I did small application that tries to replicate what my big app is doing - and - it worked! This however leads to question, what my big app is doing wrong then.

    It does have a quite complicated hierarchy of widgets and graphics view. Password field/QLineEdit is in QWidget that is wrapped by QGraphicsProxyWidget in QGraphicsWidget in scene in QGraphicsView inside main widget. Maybe that's where this problem is. However my test app tried to replicate that hierarchy too.

    This happens with N8, C7 and with E7 using virtual keyboard, so it's a same problem with all Symbian^3 devices. Not an E7 specific issue.

    I will report a bug if I can pin point a specific case when this happens.

  6. #6
    Registered User
    Join Date
    Mar 2003
    Posts
    34

    Re: Virtual keyboard and password echo

    Ok. Found the issue. Problem arises when password field is child of a top-level widget that is wrapped by QGraphicsProxyWidget. If I wrap just password field with QGraphicsWidgetProxy it works.

    This code works fine. But if you change parent of QLineEdit and set that parent to QGraphicsProxyWidget, it will break. Both password echo and ImhNoAutoUppercase are missing.
    Code:
    #include <QtGui/QApplication>
    #include <QLineEdit>
    #include <QGraphicsView>
    #include <QGraphicsProxyWidget>
    #include <QGraphicsWidget>
    
    int main(int argc, char *argv[])
    {
        QApplication app(argc, argv);
    
        QGraphicsView graphicsView;
        QGraphicsScene scene;
        graphicsView.setScene(&scene);
    
        QGraphicsWidget gw;
    
        QWidget w;
        QLineEdit* lineEdit = new QLineEdit(/* &w */); // Change this. Parent will break vkb password
        lineEdit->setEchoMode(QLineEdit::Password);
        lineEdit->setInputMethodHints(Qt::ImhHiddenText| Qt::ImhNoPredictiveText | Qt::ImhNoAutoUppercase);
    
        QGraphicsProxyWidget* pw = new QGraphicsProxyWidget();
        pw->setWidget(lineEdit /* &w */);   // Change this.
        pw->setFlag(QGraphicsItem::ItemAcceptsInputMethod);
        pw->setParentItem(&gw);
        scene.addItem(pw);
    
        graphicsView.showMaximized();
    
        return app.exec();
    }
    This isn't easy to fix, but much easier than tinkering with Symbian specific voodoo. In my specific case, there is a login widget in scene. I have to make password field as separate item. It will break some animations, but this hiding of password seems to be important issue to many users.

  7. #7
    Nokia Developer Expert
    Join Date
    Feb 2008
    Posts
    183

    Re: Virtual keyboard and password echo

    I reported this to Qt's error handling tool JIRA: http://bugreports.qt.nokia.com/browse/QTBUG-18873

Similar Threads

  1. Virtual keyboard and Editor field
    By amey_kulkarni in forum Symbian User Interface
    Replies: 2
    Last Post: 2009-12-28, 11:49

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×