Important: Please read the Qt Code of Conduct -

QT5.3 : pb QLineEdit + android 4.1.1 keyboard [SOLVED]

  • Hi all,

    I am experiencing something strange. I did some google and found that it has been a bug reported but it should be solved by now.
    For editing my QtableView, i have a QItemDelegate that uses a QLineEdit as editor.

    1 - The first problem is that i have to click 2 times in the item edited in order that the android keyboard appears.
    2 - The second problem is that the editor->text is empty when i click on the OK button. I have checked that overriding the QLineEdit::keypressevent. It appears when i click the OK button as if i have typed nothing....But the strange thing is that if i do not click on the OK button but instead on another cell from my Qtableview, the line->text is taken in account and the commitdata operates well with the value not empty!!!!

    On the Desktop version, everything works as expected....
    Could you confirm me that the bug is still a Qt Bug ? Could i do something to fake a good behaviour ?

    Thanks very much for any help.
    Best regards!

  • Hi,

    I found some tricks:

    1. first problem: in my itemdelegate, i override the QLineEdit editor in order to define a method which does :
      QEvent event (QEvent::RequestSoftwareInputPanel)
      QApplication::sendEvent (this, &event);

    and call it in itemdelegate::createditor
    that forces the android keyboard to appear

    1. i override keypressevent and inside:
      if (key == Qt::key_return) {
      return QLineEdit::keypressevent.

    Youhou, that works! no no, do not thank me ;-)


  • Lifetime Qt Champion


    You should also post a link to the bug report that way other users may find it

Log in to reply