Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-25038

QLineEdit eventFilter (KeyPress/KeyRelease) events with querty keyboard erratic behaviour

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Not Evaluated
    • None
    • 4.7.4
    • None
    • Qt 4.7.4
      E7, E6

    Description

      A released app on Nokia Store intercepts all keystrokes from a QLineEdit (configured with: ImhNoAutoUpperCase | ImhNoPredictiveText ) throught an eventFilter().
      Using a software input panel, all printable and non-printable key strokes are properly intercepted (upper and lower case letters, numbers, arrow keys, command key, return, backspace etc).

      Using a hardware querty keyboard, the same eventFilter() does not report printable key() values in the KeyPressEvent. Non printable keys seems to be OK, along with some other keys like ';', '/'.
      Using modifiers (CTRL) seems to alter the behaviour, but key() values still seems erratic.

      Steps to reproduce the problem:
      QWidget mobile application wizard
      place a QLabel and a QLineEdit at the MainWindow.

      Use the following code.
      MainWindow::MainWindow(QWidget *parent)
      : QMainWindow(parent), ui(new Ui::MainWindow)
      {
      ui->setupUi(this);
      ui->lineEdit->installEventFilter(this);
      }

      MainWindow::~MainWindow()
      {
      delete ui;
      }

      bool MainWindow::eventFilter(QObject *, QEvent * e) {
      if (e->type() == QEvent::KeyPress)

      { QKeyEvent * qe = static_cast<QKeyEvent*>(e); QString text = (QChar) qe->key(); text += "(" + QString::number(qe->key()) + ")"; ui->label->setText(text); }

      return false;
      }

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            hajjar Saumar Hajjar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes