Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QT5.3 : pb QLineEdit + android 4.1.1 keyboard [SOLVED]

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

Scheduled Pinned Locked Moved Mobile and Embedded
3 Posts 2 Posters 1.9k Views 1 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.
  • B Offline
    B Offline
    bizut
    wrote on last edited by
    #1

    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!

    1 Reply Last reply
    0
    • B Offline
      B Offline
      bizut
      wrote on last edited by
      #2

      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) {
        this->clearFocus();!!!
        }
        return QLineEdit::keypressevent.

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

      Cheers,
      Alexis

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

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

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0

        • Login

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